##// END OF EJS Templates
tests: use test harness `hg` in test-hghave.t...
Gregory Szorc -
r43275:7eac24de default
parent child Browse files
Show More
@@ -1,46 +1,46 b''
1 $ . "$TESTDIR/helpers-testrepo.sh"
1 $ . "$TESTDIR/helpers-testrepo.sh"
2
2
3 Testing that hghave does not crash when checking features
3 Testing that hghave does not crash when checking features
4
4
5 $ hghave --test-features 2>/dev/null
5 $ hghave --test-features 2>/dev/null
6
6
7 Testing hghave extensibility for third party tools
7 Testing hghave extensibility for third party tools
8
8
9 $ cat > hghaveaddon.py <<EOF
9 $ cat > hghaveaddon.py <<EOF
10 > import hghave
10 > import hghave
11 > @hghave.check("custom", "custom hghave feature")
11 > @hghave.check("custom", "custom hghave feature")
12 > def has_custom():
12 > def has_custom():
13 > return True
13 > return True
14 > EOF
14 > EOF
15
15
16 (invocation via run-tests.py)
16 (invocation via run-tests.py)
17
17
18 $ cat > test-hghaveaddon.t <<EOF
18 $ cat > test-hghaveaddon.t <<EOF
19 > #require custom
19 > #require custom
20 > $ echo foo
20 > $ echo foo
21 > foo
21 > foo
22 > EOF
22 > EOF
23 $ ( \
23 $ ( \
24 > testrepohgenv; \
24 > testrepohgenv; \
25 > "$PYTHON" $TESTDIR/run-tests.py -j 1 \
25 > "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j 1 \
26 > $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
26 > $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
27 > )
27 > )
28 running 1 tests using 1 parallel processes
28 running 1 tests using 1 parallel processes
29 .
29 .
30 # Ran 1 tests, 0 skipped, 0 failed.
30 # Ran 1 tests, 0 skipped, 0 failed.
31
31
32 (invocation via command line)
32 (invocation via command line)
33
33
34 $ unset TESTDIR
34 $ unset TESTDIR
35 $ hghave custom
35 $ hghave custom
36
36
37 (terminate with exit code 2 at failure of importing hghaveaddon.py)
37 (terminate with exit code 2 at failure of importing hghaveaddon.py)
38
38
39 $ rm hghaveaddon.*
39 $ rm hghaveaddon.*
40 $ cat > hghaveaddon.py <<NO_CHECK_EOF
40 $ cat > hghaveaddon.py <<NO_CHECK_EOF
41 > importing this file should cause syntax error
41 > importing this file should cause syntax error
42 > NO_CHECK_EOF
42 > NO_CHECK_EOF
43
43
44 $ hghave custom
44 $ hghave custom
45 failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1)
45 failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1)
46 [2]
46 [2]
General Comments 0
You need to be logged in to leave comments. Login now