git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sverre Rabbelier" <srabbelier@gmail.com>
To: Git list <git@vger.kernel.org>
Cc: Sverre Rabbelier <srabbelier@gmail.com>
Subject: [PATCH 4/4] Make test-lib warn if the directory changes.
Date: Mon,  9 Jun 2008 02:44:01 +0200	[thread overview]
Message-ID: <1212972241-7348-1-git-send-email-srabbelier@gmail.com> (raw)
In-Reply-To: <7vej77iqxb.fsf@gitster.siamese.dyndns.org>

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

      reply	other threads:[~2008-06-09  0:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-08 14:04 [PATCH 1/3] Modified test-lib.sh to output stats to /tmp/git-test-results Sverre Rabbelier
2008-06-08 14:04 ` [PATCH 2/3] A simple script to parse the results from the testcases Sverre Rabbelier
2008-06-08 14:04 ` [PATCH 3/3] Hook up the result aggregation in the test makefile Sverre Rabbelier
2008-06-08 14:42 ` [PATCH 1/3] Modified test-lib.sh to output stats to /tmp/git-test-results Jakub Narebski
2008-06-08 14:45   ` Sverre Rabbelier
2008-06-08 18:53     ` Junio C Hamano
2008-06-08 19:02       ` Sverre Rabbelier
2008-06-08 20:59         ` Junio C Hamano
2008-06-09  0:44           ` Sverre Rabbelier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1212972241-7348-1-git-send-email-srabbelier@gmail.com \
    --to=srabbelier@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).