changeset 24361:8de8cd34f2e3

tests: replace uses of 'seq' with portable 'seq.py'
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 17 Mar 2015 21:47:47 -0400
parents f554f89a2038
children 58682838f8f7
files tests/test-bookmarks-pushpull.t tests/test-censor.t tests/test-commit-interactive-curses.t tests/test-push-warn.t tests/test-revert-interactive.t tests/test-setdiscovery.t tests/test-tools.t
diffstat 7 files changed, 15 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-bookmarks-pushpull.t	Tue Mar 17 20:59:23 2015 -0400
+++ b/tests/test-bookmarks-pushpull.t	Tue Mar 17 21:47:47 2015 -0400
@@ -167,12 +167,7 @@
 
 (test that too many divergence of bookmark)
 
-  $ cat > $TESTTMP/seq.py <<EOF
-  > import sys
-  > for i in xrange(*[int(a) for a in sys.argv[1:]]):
-  >     print i
-  > EOF
-  $ python $TESTTMP/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
+  $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
   $ hg pull ../a
   pulling from ../a
   searching for changes
@@ -200,7 +195,7 @@
      @1                        2:0d2164f0ce0d
      @foo                      2:0d2164f0ce0d
 
-  $ python $TESTTMP/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
+  $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
   $ hg bookmarks -d "@1"
 
   $ hg push -f ../a
--- a/tests/test-censor.t	Tue Mar 17 20:59:23 2015 -0400
+++ b/tests/test-censor.t	Tue Mar 17 21:47:47 2015 -0400
@@ -299,7 +299,7 @@
 
 Can censor after revlog has expanded to no longer permit inline storage
 
-  $ for x in `seq 0 50000`
+  $ for x in `python $TESTDIR/seq.py 0 50000`
   > do
   >   echo "Password: hunter$x" >> target
   > done
--- a/tests/test-commit-interactive-curses.t	Tue Mar 17 20:59:23 2015 -0400
+++ b/tests/test-commit-interactive-curses.t	Tue Mar 17 21:47:47 2015 -0400
@@ -44,7 +44,7 @@
 Committing only one file
 
   $ echo "a" >> a
-  $ seq 1 10 > b
+  $ python $TESTDIR/seq.py 1 10 > b
   $ hg add b
   $ cat <<EOF >testModeCommands
   > TOGGLE
--- a/tests/test-push-warn.t	Tue Mar 17 20:59:23 2015 -0400
+++ b/tests/test-push-warn.t	Tue Mar 17 21:47:47 2015 -0400
@@ -411,7 +411,7 @@
   adding c
   created new head
 
-  $ for i in `seq 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
+  $ for i in `python $TESTDIR/seq.py 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
 
   $ hg -R i push h
   pushing to h
--- a/tests/test-revert-interactive.t	Tue Mar 17 20:59:23 2015 -0400
+++ b/tests/test-revert-interactive.t	Tue Mar 17 21:47:47 2015 -0400
@@ -21,13 +21,13 @@
   $ mkdir -p a/{folder1,folder2}
   $ cd a
   $ hg init
-  $ seq 1 5 > f ; hg add f ; hg commit -m "adding f"
-  $ seq 1 5 > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g"
-  $ seq 1 5 > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h"
-  $ seq 1 5 > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i"
-  $ echo "a" > f ; seq 1 5 >> f ; echo "b" >> f ; hg commit -m "modifying f"
-  $ echo "c" > folder1/g ; seq 1 5 >> folder1/g ; echo "d" >> folder1/g ; hg commit -m "modifying folder1/g"
-  $ echo "e" > folder2/h ; seq 1 5 >> folder2/h ; echo "f" >> folder2/h ; hg commit -m "modifying folder2/h"
+  $ python $TESTDIR/seq.py 1 5 > f ; hg add f ; hg commit -m "adding f"
+  $ cat f > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g"
+  $ cat f > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h"
+  $ cat f > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i"
+  $ echo "a" > f ; python $TESTDIR/seq.py 1 5 >> f ; echo "b" >> f ; hg commit -m "modifying f"
+  $ echo "c" > folder1/g ; python $TESTDIR/seq.py 1 5 >> folder1/g ; echo "d" >> folder1/g ; hg commit -m "modifying folder1/g"
+  $ echo "e" > folder2/h ; python $TESTDIR/seq.py 1 5 >> folder2/h ; echo "f" >> folder2/h ; hg commit -m "modifying folder2/h"
   $ hg tip
   changeset:   6:59dd6e4ab63a
   tag:         tip
--- a/tests/test-setdiscovery.t	Tue Mar 17 20:59:23 2015 -0400
+++ b/tests/test-setdiscovery.t	Tue Mar 17 21:47:47 2015 -0400
@@ -364,9 +364,9 @@
 #if false
 generate new bundles:
   $ hg init r1
-  $ for i in `seq 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done
+  $ for i in `python $TESTDIR/seq.py 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done
   $ hg clone -q r1 r2
-  $ for i in `seq 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done
+  $ for i in `python $TESTDIR/seq.py 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done
   $ hg -R r2 branch -q r2change && hg -R r2 ci -qmr2change
   $ hg -R r1 bundle -qa $TESTDIR/bundles/issue4438-r1.hg
   $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg
--- a/tests/test-tools.t	Tue Mar 17 20:59:23 2015 -0400
+++ b/tests/test-tools.t	Tue Mar 17 21:47:47 2015 -0400
@@ -43,7 +43,7 @@
   foo: mode=644
 #endif
 
-  $ seq 10 > bar
+  $ python $TESTDIR/seq.py 10 > bar
 #if unix-permissions symlink
   $ chmod +x bar
   $ f bar --newer foo --mode --type --size --dump --links --bytes 7