From: Sverre Rabbelier <srabbelier@gmail.com>
If a script moves out of it's directory, but thereafter
does not move back, the test results would not get written
to the proper file, as such, remember where we start at
and then later on, write to that place.
Also, if it is noticed that the directory was changed,
issue a warning.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
---
t/test-lib.sh | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4585fde..d9f2f4e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -5,6 +5,7 @@
# Keep the original TERM for say_color
ORIGINAL_TERM=$TERM
+ORIGINAL_PATH=$PWD
# For repeatability, reset the environment to known value.
LANG=C
@@ -355,7 +356,12 @@ test_create_repo () {
test_done () {
trap - exit
- test_results_path="../test-results"
+ test_results_path="$ORIGINAL_PATH/test-results"
+
+ if test "$ORIGINAL_PATH" != "$PWD"
+ then
+ say_color error "Script changed directory from '$ORIGINAL_PATH' to '$PWD'!"
+ fi
echo "total $test_count" >> $test_results_path
echo "success $test_success" >> $test_results_path
--
1.5.6.rc2
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html| Ingo Molnar | [patch 02/13] syslets: add syslet.h include file, user API/ABI definitions |
| Heiko Carstens | Re: 2.6.25-rc6-git6: Reported regressions from 2.6.24 |
| Greg Kroah-Hartman | [PATCH 010/196] Chinese: add translation of Codingstyle |
| Rafael J. Wysocki | [Bug #10629] 2.6.26-rc1-$sha1: RIP __d_lookup+0x8c/0x160 |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
