aboutsummaryrefslogtreecommitdiffstats
path: root/include/jau/test
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-04-30 11:57:13 +0200
committerSven Göthel <[email protected]>2024-04-30 11:57:13 +0200
commitfbb8e8b51e6a47f47064e357a51f9b3340330caa (patch)
tree0a9b1c68671e9ad06e73b860e42ebc1cf0aa6d92 /include/jau/test
parent056b6a35a30b492577be755c5136f38733ca6277 (diff)
file_util: Add absolute() and isAbsolute(), make test_fileutils* more robust using test-exe-path -> test_data dir
Diffstat (limited to 'include/jau/test')
-rw-r--r--include/jau/test/catch2_my_main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/jau/test/catch2_my_main.cpp b/include/jau/test/catch2_my_main.cpp
index 1f9550e..1a0b625 100644
--- a/include/jau/test/catch2_my_main.cpp
+++ b/include/jau/test/catch2_my_main.cpp
@@ -36,6 +36,9 @@
#define CATCH_AMALGAMATED_CUSTOM_MAIN 1
#include <catch2/catch_amalgamated.hpp>
+/** The main argv[0] test executable path */
+std::string executable_path;
+
/** Run w/o command-line args, i.e. default CI unit test. */
bool catch_auto_run;
@@ -49,6 +52,12 @@ int main( int argc, char* argv[] )
{
Catch::Session session; // There must be exactly one instance
+ if( 1 <= argc ) {
+ executable_path = std::string(argv[0]);
+ } else {
+ executable_path = "undef";
+ }
+
catch_auto_run = ( 1 >= argc );
int argc_2=0;