Martchus
a4be8a56d1
Avoid problems with CppUnit's macros when doing unity builds
2024-02-04 20:56:27 +01:00
Martchus
ce31de2c6f
Fix tests when making a unity build
...
The formatting for chrono types needs to be included before CppUnit
headers. This change makes sure of that by simply including that header via
`tests/testutils.h`. The `chrono/format.h` header is not big (including the
header it includes) so this should not be a big deal.
2024-01-30 23:08:14 +01:00
Martchus
af200403de
Support `execApp()` test helper under Windows as well via Boost.Process
2023-08-18 22:57:54 +02:00
Martchus
cb5ca77658
Improve test helper for launching an app
...
* Add helper that allows to specify the exit code (in case a non-zero
exit code is actually expected)
* Use the proper macros to inspect the status returned by `waitpid()` to
print/check the exit status correctly
2023-04-29 13:06:31 +02: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
7555e6854b
Add test helper to use std::optional via CPPUNIT_ASSERT_EQUAL
2022-05-15 02:18:07 +02:00
Martchus
a8fddad804
Add WorkingCopyMode::Cleanup
2022-01-08 23:35:01 +01:00
Martchus
b3ebe5ce38
Fix typos found via `codespell --skip .git -w`
2021-07-03 19:07:49 +02: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
a7564b8dde
Add TESTUTILS_ASSERT_LIKE_FLAGS to pass regex flags
2020-03-02 18:24:06 +01:00
Martchus
66bb3e5253
Rename TestApplication::m_instance to TestApplication::s_instance
2019-06-17 21:03:37 +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
9a66824739
Add read-only accessors to TestApplication
2019-05-15 15:52:06 +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
9a50d2b8df
Remove types
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
8b35d06aa7
Improve documentation for testFilePath()/workingCopyPath()
2019-01-20 22:15:35 +01:00
Martchus
ca6663a6d5
Prevent breaking source compatibility of TESTUTILS_ASSERT_EXEC
2018-10-21 21:21:01 +02:00
Martchus
66b4b782cd
Improve TESTUTILS_ASSERT_EXEC to print stdout/stderr on failure
2018-10-21 20:22:43 +02:00
Martchus
366f722904
Fix documentation for workingCopyPath()
2018-10-07 21:43:34 +02:00
Martchus
25ef4e28a2
Make tests compile under Windows
2018-09-30 13:55:30 +02:00
Martchus
d029b33a19
Add TESTUTILS_ASSERT_LIKE macro
2018-07-02 23:09:52 +02:00
Martchus
e0fee70d58
Print vector<char> and similar in hex notation on assert fail
2018-06-21 23:27:05 +02:00
Martchus
1aa8b387e1
Apply clang-format
2018-05-08 00:35:51 +02:00
Martchus
a4435bbcf3
Fix usage of enable_if with GCC 8
...
Seems like the trick with the three dots isn't working
with GCC 8 anymore. So let's make it a default template
parameter then.
Not sure whether GCC 8 is here correct and whether this
workaround causes further trouble.
2018-05-07 23:22:43 +02:00
Martchus
3a768508fd
Use src dir as fallback unless arg *and* env var specified
2018-02-03 17:16:30 +01:00
Martchus
cf4789e94d
testutils: Allow asserting maps/hashes
2017-11-13 20:06:09 +01:00
Martchus
2bb4aa36a4
Let tests find the testfiles from sources without extra args
...
Currently the path of the testfiles always had to be specified
either manually using the -p argument or by running the tests
via the build system targets. The first option is annoying and
the second option not so nice when using Qt Creator and the
debugger.
This commit allows tests to find the testfiles from the source
directory automatically (as fallback). This is achieved by
creating a file containing the path of the source directory
with CMake. Note that this file can only be found if the working
directory is set to the binary directory (default in Qt Creator).
2017-10-30 23:01:07 +01:00
Martchus
e393af5dbb
testutils: Print indices of iteratables (on assert equal fail)
2017-10-23 01:11:11 +02:00
Martchus
2ec3df889f
Allow accessing application path from TestApplication
...
Make it static because when this function becomes useful,
the (singleton) instance is likely not available.
2017-10-21 21:25:26 +02:00
Martchus
e52fd5a4af
Apply tidy after updating to clang-format 5.0.0
...
The behavior of clang-format slightly changed in Clang 5.0.0:
http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
2017-09-17 21:45:23 +02:00
Martchus
840700d7af
Fix compiling math tests under 32-bit architectures
...
Same problem as with size_t. The types must match exactly
when using CPPUNIT_ASSERT_EQUAL and using 'l' or 'ul' suffix
is not sufficient under 32-bit.
2017-09-03 20:13:27 +02:00
Martchus
57d5d04d9f
Merge prof data of subprocesses created when executing tests
...
So coverage is accounted correctly when tests create subprocesses
of the application to be tested using execApp().
2017-06-20 23:19:49 +02:00
Martchus
5388337bcc
Fix compiling tests under 32-bit arch
2017-05-30 23:56:08 +02:00
Martchus
18fef23724
testutils: Add execHelperApp()
2017-05-19 00:07:38 +02:00
Martchus
cab1a76ecf
Allow printing iteratable objects
...
So those can be asserted using CPPUNIT_ASSERT_EQUAL
2017-05-10 23:32:48 +02:00
Martchus
59e20b1043
Apply clang-format
2017-05-01 03:13:11 +02:00
Martchus
c13eee6fcc
Add workingCopyPathMode() to be able to skip actual copy
2017-02-04 20:16:50 +01:00
Martchus
a772cdf30b
Add conveniently usable string builder
...
which allows fast string building without multiple heap allocations
2017-01-26 22:16:18 +01:00
Martchus
d6b08b8ed9
Fix decoration for static builds
...
- Also add improvemnts a few other things in the build system
2016-08-29 15:35:48 +02:00
Martchus
1a4087abbc
Use async IO in TestApplication::execApp()
...
rather than multiple threads
2016-08-15 22:35:37 +02:00
Martchus
b36572a4dd
Add macro to assert execution of application
2016-08-06 22:02:14 +02:00
Martchus
ed527021f9
Improve logging when testing applications
2016-08-05 01:43:46 +02:00
Martchus
17d22be584
Support testing applications
2016-07-30 22:34:31 +02:00
Martchus
0c40a510e5
Add functions for character set conversions
2016-07-27 18:24:37 +02:00