changeset 20859:e259d4c462b5 stable

tests: use TESTTMP instead of TESTDIR In 57d0c8c3b947, f042d4b263f4, 1e686e55780c, and 5d22cadd1938, new tests were added that used TESTDIR instead of TESTTMP thereby leading to polluting the working directory with these temporary files. Now, we use TESTTMP so that they will be cleaned up properly.
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 28 Mar 2014 14:33:27 -0500
parents bc56ec9e64df
children 81d6dc8c3c63 ab91cc398ea8
files tests/test-commit.t tests/test-histedit-fold.t tests/test-mq-qfold.t tests/test-mq-qnew.t
diffstat 4 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-commit.t	Sat Mar 29 01:20:07 2014 +0900
+++ b/tests/test-commit.t	Fri Mar 28 14:33:27 2014 -0500
@@ -298,7 +298,7 @@
   $ echo 'sub = sub' > .hgsub
   $ hg add .hgsub
 
-  $ cat > $TESTDIR/editor.sh <<EOF
+  $ cat > $TESTTMP/editor.sh <<EOF
   > echo "==== before editing:"
   > cat \$1
   > echo "===="
@@ -306,7 +306,7 @@
   > EOF
 
   $ rm -f .hg/last-message.txt
-  $ HGEDITOR="sh $TESTDIR/editor.sh" hg commit -S -q
+  $ HGEDITOR="sh $TESTTMP/editor.sh" hg commit -S -q
   ==== before editing:
   
   
--- a/tests/test-histedit-fold.t	Sat Mar 29 01:20:07 2014 +0900
+++ b/tests/test-histedit-fold.t	Fri Mar 28 14:33:27 2014 -0500
@@ -107,7 +107,7 @@
 
 check saving last-message.txt
 
-  $ cat > $TESTDIR/abortfolding.py <<EOF
+  $ cat > $TESTTMP/abortfolding.py <<EOF
   > from mercurial import util
   > def abortfolding(ui, repo, hooktype, **kwargs):
   >     ctx = repo[kwargs.get('node')]
@@ -117,10 +117,10 @@
   > EOF
   $ cat > .hg/hgrc <<EOF
   > [hooks]
-  > pretxncommit.abortfolding = python:$TESTDIR/abortfolding.py:abortfolding
+  > pretxncommit.abortfolding = python:$TESTTMP/abortfolding.py:abortfolding
   > EOF
 
-  $ cat > $TESTDIR/editor.sh << EOF
+  $ cat > $TESTTMP/editor.sh << EOF
   > echo "==== before editing"
   > cat \$1
   > echo "===="
@@ -128,7 +128,7 @@
   > EOF
 
   $ rm -f .hg/last-message.txt
-  $ HGEDITOR="sh $TESTDIR/editor.sh" hg histedit 6de59d13424a --commands - 2>&1 <<EOF | fixbundle
+  $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 6de59d13424a --commands - 2>&1 <<EOF | fixbundle
   > pick 6de59d13424a f
   > fold 9c277da72c9b d
   > EOF
--- a/tests/test-mq-qfold.t	Sat Mar 29 01:20:07 2014 +0900
+++ b/tests/test-mq-qfold.t	Fri Mar 28 14:33:27 2014 -0500
@@ -144,7 +144,7 @@
 
   $ hg qrefresh -m "original message"
 
-  $ cat > $TESTDIR/commitfailure.py <<EOF
+  $ cat > $TESTTMP/commitfailure.py <<EOF
   > from mercurial import util
   > def reposetup(ui, repo):
   >     class commitfailure(repo.__class__):
@@ -155,10 +155,10 @@
 
   $ cat > .hg/hgrc <<EOF
   > [extensions]
-  > commitfailure = $TESTDIR/commitfailure.py
+  > commitfailure = $TESTTMP/commitfailure.py
   > EOF
 
-  $ cat > $TESTDIR/editor.sh << EOF
+  $ cat > $TESTTMP/editor.sh << EOF
   > echo "==== before editing"
   > cat \$1
   > echo "===="
@@ -166,7 +166,7 @@
   > EOF
 
   $ rm -f .hg/last-message.txt
-  $ HGEDITOR="sh $TESTDIR/editor.sh" hg qfold -e p3
+  $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e p3
   ==== before editing
   original message====
   refresh interrupted while patch was popped! (revert --all, qpush to recover)
--- a/tests/test-mq-qnew.t	Sat Mar 29 01:20:07 2014 +0900
+++ b/tests/test-mq-qnew.t	Fri Mar 28 14:33:27 2014 -0500
@@ -239,7 +239,7 @@
   $ hg init repo
   $ cd repo
 
-  $ cat > $TESTDIR/commitfailure.py <<EOF
+  $ cat > $TESTTMP/commitfailure.py <<EOF
   > from mercurial import util
   > def reposetup(ui, repo):
   >     class commitfailure(repo.__class__):
@@ -249,10 +249,10 @@
   > EOF
   $ cat > .hg/hgrc <<EOF
   > [extensions]
-  > commitfailure = $TESTDIR/commitfailure.py
+  > commitfailure = $TESTTMP/commitfailure.py
   > EOF
 
-  $ cat > $TESTDIR/editor.sh << EOF
+  $ cat > $TESTTMP/editor.sh << EOF
   > echo "==== before editing"
   > cat \$1
   > echo "===="
@@ -260,7 +260,7 @@
   > EOF
 
   $ rm -f .hg/last-message.txt
-  $ HGEDITOR="sh $TESTDIR/editor.sh" hg qnew -e patch
+  $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch
   ==== before editing
   ====
   abort: emulating unexpected abort