Skip to content

Commit 7ae59c9

Browse files
committed
[js] Rewrite the test running script in Perl 5.
That should allow detecting the node version and skipping some tests that fail on travis.
1 parent e8e9b08 commit 7ae59c9

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

src/vm/js/bin/run_tests.pl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use TAP::Harness;
2+
3+
my $harness = TAP::Harness->new({
4+
exec => sub {
5+
my ($harness, $test_file) = @_;
6+
return ['./nqp-js', $test_file] if $test_file =~ /\.t$/;
7+
return ['node', $test_file] if $test_file =~ /\.js$/;
8+
}
9+
});
10+
my @regex = "gen/js/qregex.t";
11+
my @serialization = "t/serialization/02-types.t";
12+
my @qast = glob "t/qast/02*";
13+
my @js_specific = "t/js/getcomp-js.t";
14+
15+
my @nqp_tests = glob "t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,28,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,48,50,51,53,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,83,84,88,89,90,91,92,93,94,95,96}*.t";
16+
17+
my @runtime_unit_tests = qw(t/js/varint.js);
18+
19+
my $node_version = `node -v`;
20+
21+
# avoid failures on the old node.js travis version
22+
if ($node_version =~ /^0\.10/) {
23+
24+
@nqp_tests = grep {!/19|78/} @nqp_tests;
25+
}
26+
27+
$harness->runtests(@runtime_unit_tests, @regex, @nqp_tests, @serialization, @qast, @js_specific);

tools/build/Makefile-JS.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $(JS_STAGE2)/QRegex.moarvm: $(JS_STAGE1_COMPILER) $(JS_STAGE2)/$(QREGEX_COMBINED
5959

6060
js-stage1-compiler : $(JS_STAGE1_COMPILER)
6161
js-test: js-all gen/js/qregex.t
62-
src/vm/js/bin/run_tests
62+
perl src/vm/js/bin/run_tests.pl
6363
gen/js/qregex.t: tools/build/process-qregex-tests
6464
$(JS_NQP) tools/build/process-qregex-tests > gen/js/qregex.t
6565

tools/build/gen-js-makefile.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ my $QRegex-moarvm := cross-compile(:stage(2), :source($QRegex-combined), :target
117117
deps('js-stage1-compiler', '$(JS_STAGE1_COMPILER)');
118118

119119
say('js-test: js-all gen/js/qregex.t
120-
src/vm/js/bin/run_tests');
120+
perl src/vm/js/bin/run_tests.pl');
121121

122122
say('gen/js/qregex.t: tools/build/process-qregex-tests
123123
$(JS_NQP) tools/build/process-qregex-tests > gen/js/qregex.t');

0 commit comments

Comments
 (0)