File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 94
94
test : test/test clean-coverage-run
95
95
# Make sure an error code is returned when the test fails
96
96
/usr/bin/env bash -c ' set -euo pipefail;\
97
- ./test/test -v | ./test/greenest.awk '
97
+ ./test/test ./test | ./test/greenest.awk '
98
98
99
99
test-valgrind : test/test
100
100
${VALGRIND} \
@@ -104,7 +104,7 @@ test-valgrind: test/test
104
104
--errors-for-leak-kinds=definite \
105
105
--num-callers=40 \
106
106
--error-exitcode=123 \
107
- ./test/test -v
107
+ ./test/test ./test
108
108
109
109
test-coverage : CFLAGS += -fprofile-arcs -ftest-coverage -O0
110
110
test-coverage : test
Original file line number Diff line number Diff line change @@ -33,12 +33,16 @@ SUITE_EXTERN(suite_input);
33
33
GREATEST_MAIN_DEFS ();
34
34
35
35
int main (int argc , char * argv []) {
36
- char * prog = realpath (argv [0 ], NULL );
37
- if (!prog ) {
36
+ if (argc != 2 ) {
37
+ fprintf (stderr , "Usage: %s testdatadir" , argv [0 ]);
38
+ exit (1 );
39
+ }
40
+
41
+ base = realpath (argv [1 ], NULL );
42
+ if (!base ) {
38
43
fprintf (stderr , "Cannot determine actual path of test executable: %s\n" , strerror (errno ));
39
44
exit (1 );
40
45
}
41
- base = dirname (prog );
42
46
43
47
/* By default do not print out warning messages, when executing tests.
44
48
* But allow, if DUNST_TEST_LOG=1 is set in environment. */
@@ -71,9 +75,7 @@ int main(int argc, char *argv[]) {
71
75
RUN_SUITE (suite_rules );
72
76
RUN_SUITE (suite_input );
73
77
74
- base = NULL ;
75
78
g_strfreev (configs );
76
- free (prog );
77
79
78
80
// this returns the error code
79
81
GREATEST_MAIN_END ();
You can’t perform that action at this time.
0 commit comments