Skip to content

Commit 0e69485

Browse files
committed
clar: provide a way to run some shell before exiting
1 parent fa274f7 commit 0e69485

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ci/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ USER=${USER:-$(whoami)}
1414
SUCCESS=1
1515

1616
VALGRIND="valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\"$SOURCE_DIR/libgit2_clar.supp\""
17-
LEAKS="MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null leaks -quiet -atExit -- nohup"
17+
LEAKS="MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null"
1818

1919
cleanup() {
2020
echo "Cleaning up..."

tests/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ int main(int argc, char *argv[])
88
#endif
99
{
1010
int res;
11+
char *at_exit_cmd;
1112

1213
clar_test_init(argc, argv);
1314

@@ -28,5 +29,11 @@ int main(int argc, char *argv[])
2829
cl_global_trace_disable();
2930
git_libgit2_shutdown();
3031

32+
at_exit_cmd = getenv("CLAR_AT_EXIT");
33+
if (at_exit_cmd != NULL) {
34+
int at_exit = system(at_exit_cmd);
35+
return res || at_exit;
36+
}
37+
3138
return res;
3239
}

0 commit comments

Comments
 (0)