So I am writing a git hook, which calls a script to run some tests in the background. The problem is that the script never goes beyond the exec when the test fails.
The beggining of the script
#!/usr/bin/env bash
set -x
## 4 ##
full_path="$1/$2"
cd $full_path
BODY=""
make > build.log 2> build.error
if [ $? -eq 0 ]; then
## 5 ##
PASSED=0
FAILED=0
for line in $(find . -name '*test*' -executable -type f); do
out="${line:2}.log"
error="${line:2}.error"
exec $line > $out 2> $error
echo "I AM ALIVE"
if [ $? -eq 0 ]; then
((PASSED++))
else
((FAILED++))
And the contents of the error file
cat tree_insert_test.error
tree_insert_test: p2.cpp:69: tree_t insert_tree(int, tree_t): Assertion `false' failed.