##// END OF EJS Templates
test-run-test: use explicit variables to clarify paths...
marmoute -
r48372:da497189 default
parent child Browse files
Show More
@@ -1381,8 +1381,28 b' Add support for external test formatter'
1381 Test reusability for third party tools
1381 Test reusability for third party tools
1382 ======================================
1382 ======================================
1383
1383
1384 $ mkdir "$TESTTMP"/anothertests
1384 $ THISTESTDIR="$TESTDIR"
1385 $ cd "$TESTTMP"/anothertests
1385 $ export THISTESTDIR
1386 $ THISTESTTMP="$TESTTMP"
1387 $ export THISTESTTMP
1388
1389 #if windows
1390
1391 $ NEWTESTDIR="$THISTESTTMP"\\anothertests
1392
1393 #else
1394
1395 $ NEWTESTDIR="$THISTESTTMP"/anothertests
1396
1397 #endif
1398
1399 $ export NEWTESTDIR
1400
1401 $ echo creating some new test in: $NEWTESTDIR
1402 creating some new test in: $TESTTMP\anothertests (windows !)
1403 creating some new test in: $TESTTMP/anothertests (no-windows !)
1404 $ mkdir "$NEWTESTDIR"
1405 $ cd "$NEWTESTDIR"
1386
1406
1387 test that `run-tests.py` can execute hghave, even if it runs not in
1407 test that `run-tests.py` can execute hghave, even if it runs not in
1388 Mercurial source tree.
1408 Mercurial source tree.
@@ -1400,22 +1420,20 b' Mercurial source tree.'
1400 test that RUNTESTDIR refers the directory, in which `run-tests.py` now
1420 test that RUNTESTDIR refers the directory, in which `run-tests.py` now
1401 running is placed.
1421 running is placed.
1402
1422
1423
1403 $ cat > test-runtestdir.t <<EOF
1424 $ cat > test-runtestdir.t <<EOF
1404 > - $TESTDIR, in which test-run-tests.t is placed
1425 > # \$THISTESTDIR, in which test-run-tests.t (this test file) is placed
1405 > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime)
1426 > # \$THISTESTTMP, in which test-run-tests.t (this test file) is placed
1406 > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime)
1427 > # \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime)
1428 > # \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime)
1407 >
1429 >
1408 > #if windows
1430 > $ test "\$TESTDIR" = "\$NEWTESTDIR"
1409 > $ test "\$TESTDIR" = "$TESTTMP\\anothertests"
1410 > #else
1411 > $ test "\$TESTDIR" = "$TESTTMP"/anothertests
1412 > #endif
1413 > If this prints a path, that means RUNTESTDIR didn't equal
1431 > If this prints a path, that means RUNTESTDIR didn't equal
1414 > TESTDIR as it should have.
1432 > THISTESTDIR as it should have.
1415 > $ test "\$RUNTESTDIR" = "$TESTDIR" || echo "\$RUNTESTDIR"
1433 > $ test "\$RUNTESTDIR" = "\$THISTESTDIR" || echo "\$RUNTESTDIR"
1416 > This should print the start of check-code. If this passes but the
1434 > This should print the start of check-code. If this passes but the
1417 > previous check failed, that means we found a copy of check-code at whatever
1435 > previous check failed, that means we found a copy of check-code at whatever
1418 > RUNTESTSDIR ended up containing, even though it doesn't match TESTDIR.
1436 > RUNTESTSDIR ended up containing, even though it doesn't match THISTESTDIR.
1419 > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's@.!.*python3@#!USRBINENVPY@'
1437 > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's@.!.*python3@#!USRBINENVPY@'
1420 > #!USRBINENVPY
1438 > #!USRBINENVPY
1421 > #
1439 > #
General Comments 0
You need to be logged in to leave comments. Login now