diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-06-26 00:19:22 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-26 00:19:22 +0400 |
commit | e4403d8bd3ccb6bcc3b6569012944d932334f5c4 (patch) | |
tree | 6973c0ae624070e9d96aa4e0d2d21223b48ab60b /t/test-lib.sh | |
parent | 01d8ff70f40d8be3c4e2efb245ffc3d013b7fcbf (diff) | |
parent | f8d5ffc2c7c002cebb8842afcf58cbd4cea481b8 (diff) |
Merge branch 'sr/tests'
* sr/tests:
Hook up the result aggregation in the test makefile.
A simple script to parse the results from the testcases
Modify test-lib.sh to output stats to t/test-results/*
Conflicts:
t/test-lib.sh
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index f4f35ed433..4010110010 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -154,6 +154,7 @@ test_failure=0 test_count=0 test_fixed=0 test_broken=0 +test_success=0 die () { echo >&5 "FATAL: Unexpected exit with code $?" @@ -195,6 +196,7 @@ test_tick () { test_ok_ () { test_count=$(expr "$test_count" + 1) + test_success=$(expr "$test_success" + 1) say_color "" " ok $test_count: $@" } @@ -413,6 +415,16 @@ test_create_repo () { test_done () { trap - exit + test_results_dir="$TEST_DIRECTORY/test-results" + mkdir -p "$test_results_dir" + test_results_path="$test_results_dir/${0%-*}-$$" + + echo "total $test_count" >> $test_results_path + echo "success $test_success" >> $test_results_path + echo "fixed $test_fixed" >> $test_results_path + echo "broken $test_broken" >> $test_results_path + echo "failed $test_failure" >> $test_results_path + echo "" >> $test_results_path if test "$test_fixed" != 0 then @@ -447,7 +459,8 @@ test_done () { # Test the binaries we have just built. The tests are kept in # t/ subdirectory and are run in 'trash directory' subdirectory. -PATH=$(pwd)/..:$PATH +TEST_DIRECTORY=$(pwd) +PATH=$TEST_DIRECTORY/..:$PATH GIT_EXEC_PATH=$(pwd)/.. GIT_TEMPLATE_DIR=$(pwd)/../templates/blt unset GIT_CONFIG |