Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[js] Rewrite the test running script in Perl 5.
That should allow detecting the node version and skipping some tests that fail on travis.
  • Loading branch information
pmurias committed Oct 6, 2015
1 parent e8e9b08 commit 7ae59c9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
27 changes: 27 additions & 0 deletions src/vm/js/bin/run_tests.pl
@@ -0,0 +1,27 @@
use TAP::Harness;

my $harness = TAP::Harness->new({
exec => sub {
my ($harness, $test_file) = @_;
return ['./nqp-js', $test_file] if $test_file =~ /\.t$/;
return ['node', $test_file] if $test_file =~ /\.js$/;
}
});
my @regex = "gen/js/qregex.t";
my @serialization = "t/serialization/02-types.t";
my @qast = glob "t/qast/02*";
my @js_specific = "t/js/getcomp-js.t";

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";

my @runtime_unit_tests = qw(t/js/varint.js);

my $node_version = `node -v`;

# avoid failures on the old node.js travis version
if ($node_version =~ /^0\.10/) {

@nqp_tests = grep {!/19|78/} @nqp_tests;
}

$harness->runtests(@runtime_unit_tests, @regex, @nqp_tests, @serialization, @qast, @js_specific);
2 changes: 1 addition & 1 deletion tools/build/Makefile-JS.in
Expand Up @@ -59,7 +59,7 @@ $(JS_STAGE2)/QRegex.moarvm: $(JS_STAGE1_COMPILER) $(JS_STAGE2)/$(QREGEX_COMBINED

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

Expand Down
2 changes: 1 addition & 1 deletion tools/build/gen-js-makefile.nqp
Expand Up @@ -117,7 +117,7 @@ my $QRegex-moarvm := cross-compile(:stage(2), :source($QRegex-combined), :target
deps('js-stage1-compiler', '$(JS_STAGE1_COMPILER)');

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

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

0 comments on commit 7ae59c9

Please sign in to comment.