aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-01-11 11:08:39 +0100
committerSven Gothel <[email protected]>2021-01-11 11:08:39 +0100
commit0ab693bb8ed831e077e72301e06bf88269c33a07 (patch)
tree57d13830d4e6642fdf3bbd08bb1a928cf6c7635b /include
parent9da96c6df4e029a749d71b3b02efe57bc6df498b (diff)
catch2_my_main: Add '--use-colour no' per default
Diffstat (limited to 'include')
-rw-r--r--include/jau/test/catch2_my_main.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/jau/test/catch2_my_main.cpp b/include/jau/test/catch2_my_main.cpp
index 334f44c..3472616 100644
--- a/include/jau/test/catch2_my_main.cpp
+++ b/include/jau/test/catch2_my_main.cpp
@@ -41,6 +41,9 @@ bool catch_auto_run;
/** Run w/ command-line arg '--perf_analysis'. */
bool catch_perf_analysis;
+static char * extra_args[] = { (char*)"--use-colour", (char*)"no" };
+static int extra_args_c = sizeof(extra_args) / sizeof(const char *);
+
int main( int argc, char* argv[] )
{
Catch::Session session; // There must be exactly one instance
@@ -48,7 +51,7 @@ int main( int argc, char* argv[] )
catch_auto_run = ( 1 >= argc );
int argc_2=0;
- char* argv_2[argc];
+ char* argv_2[argc+extra_args_c];
for(int i=0; i<argc; i++) {
if( 0 == strcmp("--perf_analysis", argv[i]) ) {
@@ -57,8 +60,14 @@ int main( int argc, char* argv[] )
argv_2[argc_2++] = argv[i];
}
}
- fprintf(stderr, "argc %d, auto_run %d, perf_analysis %d\n",
- argc, catch_auto_run, catch_perf_analysis);
+ for(int i=0; i<extra_args_c; i++) {
+ argv_2[argc_2++] = extra_args[i];
+ }
+ fprintf(stderr, "argc %d -> %d, auto_run %d, perf_analysis %d\n",
+ argc, argc_2, catch_auto_run, catch_perf_analysis);
+ for(int i=0; i<argc_2; i++) {
+ printf("[%d] %s\n", i, argv_2[i]);
+ }
// writing to session.configData() here sets defaults
// this is the preferred way to set them