Commit Graph

87 Commits

Author SHA1 Message Date
Martchus b526d79eaf Always use a process group in helper for involing test applications
So far only the implementation using Boost.Process was using a process
group; with this change also the implementation using POSIX APIs uses a
process group. This way the code can wait until all sub processes have
terminated.
2024-01-28 21:55:13 +01:00
Martchus c25a3c9c9a Improve error handling when launching test process
* Use `EXIT_FAILURE` instead of an arbitrary exit status
* Print the error message
2024-01-20 17:38:14 +01:00
Martchus c9dea06cfe Remove outdated remarks about `execApp()` and similar test helpers
These functions are supported also on other platforms via Boost.Process.
2024-01-20 17:35:17 +01:00
Martchus 132d25fbb1 Apply clang-format 2023-08-20 20:29:54 +02:00
Martchus 0349037711 Fix passing non-ASCII arguments in `execApp()` under Windows 2023-08-19 00:11:06 +02:00
Martchus af200403de Support `execApp()` test helper under Windows as well via Boost.Process 2023-08-18 22:57:54 +02:00
Martchus ab298b200f Apply clang-format 2023-03-11 17:05:08 +01:00
Martchus 2b6f26895d Support multiple source directories in `srcdirref` file
* Locate test files in all source directories specified in `srcdirref`
* Allow overriding contents of `srcdirref` so the directory of another
  component (within the same repository) can be appended to share testfiles
2023-02-27 18:29:31 +01:00
Martchus a703813b4c Mark helper functions of `testutils.cpp` as static; they're not used elsewhere 2023-02-27 18:29:21 +01:00
Martchus d8c38699ba Avoid warning about unqualified std cast 2022-11-04 16:50:13 +01:00
Martchus a8fddad804 Add WorkingCopyMode::Cleanup 2022-01-08 23:35:01 +01:00
Martchus 15fddad46d Log error when "srcdirref" cannot be opened 2021-08-03 14:05:33 +02:00
Martchus 95202d059a Fix typo 2021-06-04 16:04:26 +02:00
Martchus 0fb533ffc5 Format attempted test file/dir lookups more nicely in the error case 2021-04-06 17:46:15 +02:00
Martchus 8c033ca243 Fix warnings 2021-03-20 21:56:45 +01:00
Martchus dd41762b70 Add testDirPath() for finding directories with test files
The same as testFilePath(), just for directories.
2020-09-23 22:49:33 +02:00
Martchus 52722be407 Add test helper execHelperAppInSearchPath() 2020-06-10 18:42:50 +02:00
Martchus 3fe1ea64cf Improve documentation of some test utilities 2020-04-13 23:35:22 +02:00
Martchus 06e29dd751 test utils: Use /proc/self/exe to find srcdirref, at least where supported
So it also works if e.g. chdir() is called before instantiating
the TestApplication.
2020-04-11 22:12:49 +02:00
Martchus 9fe7053869 Print "Executing test" via cppunit.h
Otherwise it is a bit annoying if one just wants to instantiate
a TestApplication for looking up test files.
2020-04-11 21:50:55 +02:00
Martchus 0cdf2c3492 Use const where possible in code dealing with profiling data 2020-01-12 21:02:43 +01:00
Martchus 1bdc088b54 Close workingCopy in workingCopyPathAs() for correct error handling 2019-12-15 19:01:04 +01:00
Martchus e71d54d93f Make run the default arg of TestApplication 2019-06-17 21:04:13 +02:00
Martchus 66bb3e5253 Rename TestApplication::m_instance to TestApplication::s_instance 2019-06-17 21:03:37 +02:00
Martchus 7249751d30 Apply clang-format and cmake-format 2019-06-16 16:54:26 +02:00
Martchus 428a67d68b Improve test application for cppunit
* Allow to list available tests
* Fail the test if at least one explicitely specified unit
  is not available
2019-06-14 18:07:45 +02:00
Martchus b48b2f5c06 Have everything in one top-level namespace 2019-06-10 21:56:46 +02:00
Martchus 4c1b733290 Rework ArgumentParser::parseArgs()
* Remove "ext()" and "orExit()" versions
* Exit by default (might be intrusive but it is the most
  common use)
* Rename Failure to ParseError
2019-06-10 16:03:27 +02:00
Martchus c701fc25ee Remove directoryEntries() 2019-06-05 23:50:38 +02:00
Martchus f16703ffc0 Remove workingCopyPathMode() 2019-05-11 19:02:32 +02:00
Martchus f0c6035609 Simplify dealing with multiple testfile paths 2019-05-11 18:47:14 +02:00
Martchus 151a3ae9e5 Apply clang-format 2019-05-04 20:58:23 +02:00
Martchus a6fdb3369a Make unsuccessful testFilePath() throw an exception 2019-04-22 20:42:48 +02:00
Martchus 6d7a6ab735 Don't pretent to add arguments implicitely 2019-04-13 20:33:39 +02:00
Marius Kittler 132f936c57 Remove workaround for GCC Bug 66145 2019-04-13 20:33:39 +02:00
Martchus ac8fe5d2c7 Improve constructors for test application 2019-04-13 20:33:39 +02:00
Martchus bc8ea407bc Prevent use of static variables in ArgumentParser
Have --no-color and --help added by default rather
so argument parser is in control over them and don't
has to use static functions.
2019-04-13 20:33:39 +02:00
Martchus 789af62d97 Add workingCopyPathAs() 2019-01-20 22:56:22 +01:00
Martchus d21cde6fe3 Remove unused variable in testFilePath() 2019-01-20 22:16:07 +01:00
Martchus 8b35d06aa7 Improve documentation for testFilePath()/workingCopyPath() 2019-01-20 22:15:35 +01:00
Martchus 757a3476cc test utilities: Print testfile path in all cases 2018-11-02 22:36:22 +01:00
Martchus 34eac527ee Log actual application path when testing 2018-10-25 18:20:14 +02:00
Martchus 17fc55a2c6 Fix compilation of testutils under Windows without NativeFileStream 2018-10-07 21:14:56 +02:00
Martchus 61edf58c3e Fix workingCopyPathMode 2018-10-06 16:18:39 +02:00
Martchus 5356d793fc Make all tests pass under Windows
* Workaround some issues
* Disable some tests (better than not running tests
  at all)
2018-10-03 22:37:55 +02:00
Martchus 8e3c40abb5 Make conversion from multi byte to wide string generic 2018-10-03 21:26:41 +02:00
Martchus 25ef4e28a2 Make tests compile under Windows 2018-09-30 13:55:30 +02:00
Martchus 826c43ef8b Include missing cerrno 2018-08-12 22:17:09 +02:00
Martchus d0bf2fb390 Add more debug output to TestApplication::workingCopyPathMode 2018-08-11 22:21:48 +02:00
Martchus 2347677495 Adjust name of working copy until unique if unable to override 2018-07-28 20:51:25 +02:00