Skip to content

Commit 87949f9

Browse files
Merge branch 'dunst-project:master' into master
2 parents cb96624 + d2faa87 commit 87949f9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ endif
9494
test: test/test clean-coverage-run
9595
# Make sure an error code is returned when the test fails
9696
/usr/bin/env bash -c 'set -euo pipefail;\
97-
./test/test -v | ./test/greenest.awk '
97+
./test/test ./test | ./test/greenest.awk '
9898

9999
test-valgrind: test/test
100100
${VALGRIND} \
@@ -104,7 +104,7 @@ test-valgrind: test/test
104104
--errors-for-leak-kinds=definite \
105105
--num-callers=40 \
106106
--error-exitcode=123 \
107-
./test/test -v
107+
./test/test ./test
108108

109109
test-coverage: CFLAGS += -fprofile-arcs -ftest-coverage -O0
110110
test-coverage: test

test/test.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@ SUITE_EXTERN(suite_input);
3333
GREATEST_MAIN_DEFS();
3434

3535
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) {
3843
fprintf(stderr, "Cannot determine actual path of test executable: %s\n", strerror(errno));
3944
exit(1);
4045
}
41-
base = dirname(prog);
4246

4347
/* By default do not print out warning messages, when executing tests.
4448
* But allow, if DUNST_TEST_LOG=1 is set in environment. */
@@ -71,9 +75,7 @@ int main(int argc, char *argv[]) {
7175
RUN_SUITE(suite_rules);
7276
RUN_SUITE(suite_input);
7377

74-
base = NULL;
7578
g_strfreev(configs);
76-
free(prog);
7779

7880
// this returns the error code
7981
GREATEST_MAIN_END();

0 commit comments

Comments
 (0)