Commit 0e69485e by Etienne Samson

clar: provide a way to run some shell before exiting

parent fa274f7f
...@@ -14,7 +14,7 @@ USER=${USER:-$(whoami)} ...@@ -14,7 +14,7 @@ USER=${USER:-$(whoami)}
SUCCESS=1 SUCCESS=1
VALGRIND="valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\"$SOURCE_DIR/libgit2_clar.supp\"" VALGRIND="valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\"$SOURCE_DIR/libgit2_clar.supp\""
LEAKS="MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null leaks -quiet -atExit -- nohup" LEAKS="MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null"
cleanup() { cleanup() {
echo "Cleaning up..." echo "Cleaning up..."
......
...@@ -8,6 +8,7 @@ int main(int argc, char *argv[]) ...@@ -8,6 +8,7 @@ int main(int argc, char *argv[])
#endif #endif
{ {
int res; int res;
char *at_exit_cmd;
clar_test_init(argc, argv); clar_test_init(argc, argv);
...@@ -28,5 +29,11 @@ int main(int argc, char *argv[]) ...@@ -28,5 +29,11 @@ int main(int argc, char *argv[])
cl_global_trace_disable(); cl_global_trace_disable();
git_libgit2_shutdown(); git_libgit2_shutdown();
at_exit_cmd = getenv("CLAR_AT_EXIT");
if (at_exit_cmd != NULL) {
int at_exit = system(at_exit_cmd);
return res || at_exit;
}
return res; return res;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment