##// END OF EJS Templates
run-tests: allow #require inside #if...
Jun Wu -
r36695:a247a0e8 default
parent child Browse files
Show More
@@ -1373,10 +1373,11 b' class TTest(Test):'
1373 lsplit = l.split()
1373 lsplit = l.split()
1374 if len(lsplit) < 2 or lsplit[0] != b'#require':
1374 if len(lsplit) < 2 or lsplit[0] != b'#require':
1375 after.setdefault(pos, []).append(' !!! invalid #require\n')
1375 after.setdefault(pos, []).append(' !!! invalid #require\n')
1376 haveresult, message = self._hghave(lsplit[1:])
1376 if not skipping:
1377 if not haveresult:
1377 haveresult, message = self._hghave(lsplit[1:])
1378 script = [b'echo "%s"\nexit 80\n' % message]
1378 if not haveresult:
1379 break
1379 script = [b'echo "%s"\nexit 80\n' % message]
1380 break
1380 after.setdefault(pos, []).append(l)
1381 after.setdefault(pos, []).append(l)
1381 elif l.startswith(b'#if'):
1382 elif l.startswith(b'#if'):
1382 lsplit = l.split()
1383 lsplit = l.split()
@@ -921,16 +921,24 b' Skips'
921 ================
921 ================
922 $ cat > test-skip.t <<EOF
922 $ cat > test-skip.t <<EOF
923 > $ echo xyzzy
923 > $ echo xyzzy
924 > #if true
924 > #require false
925 > #require false
926 > #end
927 > EOF
928 $ cat > test-noskip.t <<EOF
929 > #if false
930 > #require false
931 > #endif
925 > EOF
932 > EOF
926 $ rt --nodiff
933 $ rt --nodiff
927 !.s
934 !.s.
928 Skipped test-skip.t: missing feature: nail clipper
935 Skipped test-skip.t: missing feature: nail clipper
929 Failed test-failure.t: output changed
936 Failed test-failure.t: output changed
930 # Ran 2 tests, 1 skipped, 1 failed.
937 # Ran 3 tests, 1 skipped, 1 failed.
931 python hash seed: * (glob)
938 python hash seed: * (glob)
932 [1]
939 [1]
933
940
941 $ rm test-noskip.t
934 $ rt --keyword xyzzy
942 $ rt --keyword xyzzy
935 .s
943 .s
936 Skipped test-skip.t: missing feature: nail clipper
944 Skipped test-skip.t: missing feature: nail clipper
General Comments 0
You need to be logged in to leave comments. Login now