Show More
@@ -1433,6 +1433,9 b' class Test(unittest.TestCase):' | |||||
1433 | env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or '' |
|
1433 | env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or '' | |
1434 | env['HGEMITWARNINGS'] = '1' |
|
1434 | env['HGEMITWARNINGS'] = '1' | |
1435 | env['TESTTMP'] = _bytes2sys(self._testtmp) |
|
1435 | env['TESTTMP'] = _bytes2sys(self._testtmp) | |
|
1436 | # the FORWARD_SLASH version is useful when running `sh` on non unix | |||
|
1437 | # system (e.g. Windows) | |||
|
1438 | env['TESTTMP_FORWARD_SLASH'] = env['TESTTMP'].replace(os.sep, '/') | |||
1436 | uid_file = os.path.join(_bytes2sys(self._testtmp), 'UID') |
|
1439 | uid_file = os.path.join(_bytes2sys(self._testtmp), 'UID') | |
1437 | env['HGTEST_UUIDFILE'] = uid_file |
|
1440 | env['HGTEST_UUIDFILE'] = uid_file | |
1438 | env['TESTNAME'] = self.name |
|
1441 | env['TESTNAME'] = self.name | |
@@ -3113,6 +3116,10 b' class TestRunner(object):' | |||||
3113 | if pathname: |
|
3116 | if pathname: | |
3114 | testdir = os.path.join(testdir, pathname) |
|
3117 | testdir = os.path.join(testdir, pathname) | |
3115 | self._testdir = osenvironb[b'TESTDIR'] = testdir |
|
3118 | self._testdir = osenvironb[b'TESTDIR'] = testdir | |
|
3119 | osenvironb[b'TESTDIR_FORWARD_SLASH'] = osenvironb[b'TESTDIR'].replace( | |||
|
3120 | os.sep.encode('ascii'), b'/' | |||
|
3121 | ) | |||
|
3122 | ||||
3116 | if self.options.outputdir: |
|
3123 | if self.options.outputdir: | |
3117 | self._outputdir = canonpath(_sys2bytes(self.options.outputdir)) |
|
3124 | self._outputdir = canonpath(_sys2bytes(self.options.outputdir)) | |
3118 | else: |
|
3125 | else: | |
@@ -3257,6 +3264,9 b' class TestRunner(object):' | |||||
3257 | fileb = _sys2bytes(__file__) |
|
3264 | fileb = _sys2bytes(__file__) | |
3258 | runtestdir = os.path.abspath(os.path.dirname(fileb)) |
|
3265 | runtestdir = os.path.abspath(os.path.dirname(fileb)) | |
3259 | osenvironb[b'RUNTESTDIR'] = runtestdir |
|
3266 | osenvironb[b'RUNTESTDIR'] = runtestdir | |
|
3267 | osenvironb[b'RUNTESTDIR_FORWARD_SLASH'] = runtestdir.replace( | |||
|
3268 | os.sep.encode('ascii'), b'/' | |||
|
3269 | ) | |||
3260 | if PYTHON3: |
|
3270 | if PYTHON3: | |
3261 | sepb = _sys2bytes(os.pathsep) |
|
3271 | sepb = _sys2bytes(os.pathsep) | |
3262 | else: |
|
3272 | else: |
@@ -9,12 +9,12 b" while we're running" | |||||
9 | $ hg init a |
|
9 | $ hg init a | |
10 | $ cd a |
|
10 | $ cd a | |
11 |
|
11 | |||
12 | $ cat > "$TESTTMP/waitlock_editor.sh" <<EOF |
|
12 | $ cat > "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh" <<EOF | |
13 | > [ -n "\${WAITLOCK_ANNOUNCE:-}" ] && touch "\${WAITLOCK_ANNOUNCE}" |
|
13 | > [ -n "\${WAITLOCK_ANNOUNCE:-}" ] && touch "\${WAITLOCK_ANNOUNCE}" | |
14 | > f="\${WAITLOCK_FILE}" |
|
14 | > f="\${WAITLOCK_FILE}" | |
15 | > start=\`date +%s\` |
|
15 | > start=\`date +%s\` | |
16 | > timeout=5 |
|
16 | > timeout=5 | |
17 | > $RUNTESTDIR/testlib/wait-on-file "\$timeout" "\$f" |
|
17 | > "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" "\$timeout" "\$f" | |
18 | > if [ \$# -gt 1 ]; then |
|
18 | > if [ \$# -gt 1 ]; then | |
19 | > cat "\$@" |
|
19 | > cat "\$@" | |
20 | > fi |
|
20 | > fi | |
@@ -27,9 +27,9 b" this all starts, so let's make one." | |||||
27 | $ hg commit -qAm 'r0' |
|
27 | $ hg commit -qAm 'r0' | |
28 |
|
28 | |||
29 | Start an hg commit that will take a while |
|
29 | Start an hg commit that will take a while | |
30 |
$ EDITOR_STARTED="$ |
|
30 | $ EDITOR_STARTED="$TESTTMP_FORWARD_SLASH/a/.editor_started" | |
31 |
$ MISCHIEF_MANAGED="$ |
|
31 | $ MISCHIEF_MANAGED="$TESTTMP_FORWARD_SLASH/a/.mischief_managed" | |
32 |
$ JOBS_FINISHED="$ |
|
32 | $ JOBS_FINISHED="$TESTTMP_FORWARD_SLASH/a/.jobs_finished" | |
33 |
|
33 | |||
34 | #if fail-if-detected |
|
34 | #if fail-if-detected | |
35 | $ cat >> .hg/hgrc << EOF |
|
35 | $ cat >> .hg/hgrc << EOF | |
@@ -40,7 +40,7 b' Start an hg commit that will take a whil' | |||||
40 |
|
40 | |||
41 | $ cat >> .hg/hgrc << EOF |
|
41 | $ cat >> .hg/hgrc << EOF | |
42 | > [ui] |
|
42 | > [ui] | |
43 | > editor=sh $TESTTMP/waitlock_editor.sh |
|
43 | > editor=sh $TESTTMP_FORWARD_SLASH/waitlock_editor.sh | |
44 | > EOF |
|
44 | > EOF | |
45 |
|
45 | |||
46 | $ echo foo > foo |
|
46 | $ echo foo > foo | |
@@ -50,7 +50,7 b' Start an hg commit that will take a whil' | |||||
50 | > hg commit -qAm 'r1 (foo)' --edit foo > .foo_commit_out 2>&1 ; touch "${JOBS_FINISHED}") & |
|
50 | > hg commit -qAm 'r1 (foo)' --edit foo > .foo_commit_out 2>&1 ; touch "${JOBS_FINISHED}") & | |
51 |
|
51 | |||
52 | Wait for the "editor" to actually start |
|
52 | Wait for the "editor" to actually start | |
53 | $ sh "$RUNTESTDIR/testlib/wait-on-file" 5 "${EDITOR_STARTED}" |
|
53 | $ sh "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" 5 "${EDITOR_STARTED}" | |
54 |
|
54 | |||
55 | $ cat >> .hg/hgrc << EOF |
|
55 | $ cat >> .hg/hgrc << EOF | |
56 | > [ui] |
|
56 | > [ui] | |
@@ -69,7 +69,7 b' Break the locks, and make another commit' | |||||
69 | Awaken the editor from that first commit |
|
69 | Awaken the editor from that first commit | |
70 | $ touch "${MISCHIEF_MANAGED}" |
|
70 | $ touch "${MISCHIEF_MANAGED}" | |
71 | And wait for it to finish |
|
71 | And wait for it to finish | |
72 | $ WAITLOCK_FILE="${JOBS_FINISHED}" sh "$TESTTMP/waitlock_editor.sh" |
|
72 | $ WAITLOCK_FILE="${JOBS_FINISHED}" sh "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh" | |
73 |
|
73 | |||
74 | #if skip-detection |
|
74 | #if skip-detection | |
75 | (Ensure there was no output) |
|
75 | (Ensure there was no output) |
General Comments 0
You need to be logged in to leave comments.
Login now