From 2e0d8b362df11b90c2cc810cfed38c7a18bcc716 Mon Sep 17 00:00:00 2001 From: pmurias Date: Tue, 30 May 2017 12:40:14 +0200 Subject: [PATCH] [js] Add a 'make js-spectest' which run a bunch of passing tests --- t/harness5 | 8 +++-- t/spectest.js.data | 62 +++++++++++++++++++++++++++++++++ tools/build/gen-js-makefile.nqp | 4 +++ 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 t/spectest.js.data diff --git a/t/harness5 b/t/harness5 index cafe1e22d25..662a6626f3c 100644 --- a/t/harness5 +++ b/t/harness5 @@ -27,6 +27,7 @@ GetOptions( 'stress:1' => \my $do_stress, 'archive=s' => \my $archive, 'jvm' => \my $jvm, + 'js' => \my $js, 'moar' => \my $moar, 'randomize' => \my $randomize, 'slow' => \(my $slow = !$win), @@ -36,7 +37,8 @@ GetOptions( my @pass_through_options = grep m/^--?[^-]/, @ARGV; my @files = grep m/^[^-]/, @ARGV; -$ENV{'HARNESS_PERL'} = ".${slash}perl6-" . ($moar ? "m" : $jvm ? "j" : "m"); + +$ENV{'HARNESS_PERL'} = ".${slash}perl6-" . ($js ? "js" : $moar ? "m" : $jvm ? "j" : "m"); $ENV{'PERL6LIB'} = "lib"; my @slow; @@ -176,7 +178,7 @@ sub all_in { } sub fudge { - my $impl = $moar ? 'rakudo.moar' : 'rakudo.jvm'; + my $impl = $js ? 'rakudo.js' : $moar ? 'rakudo.moar' : 'rakudo.jvm'; my $cmd = join ' ', $^X, 't/spec/fudgeall', @pass_through_options, $impl, @_; return split ' ', `$cmd`; @@ -202,4 +204,4 @@ Options: --archive=[archive] - write to an archive. --randomize randomize the order in which test-files are processed. --slow - spread tests marked "slow" equally over the run (default on non-Win) - --moar/--jvm - mutually exclusive. Use MoarVM/JVM backend + --moar/--jvm/--js - mutually exclusive. Use MoarVM/JVM/JS backend diff --git a/t/spectest.js.data b/t/spectest.js.data new file mode 100644 index 00000000000..7e12ae163a5 --- /dev/null +++ b/t/spectest.js.data @@ -0,0 +1,62 @@ +# This is a list of all spec tests that are expected to pass. +# +# Empty lines and those beginning with a # are ignored +# +# We intend to include *all* tests from roast, even when we +# skip most of the tests or the entire test file. To verify +# we are running all tests, run: +# +# perl tools/update-passing-test-data.pl +# +# If a file appears in the output of the script, it is not run +# by default. It may need to be fudged in order to run successfully. +# Open an RT when necessary as part of the fudge process, using the +# RT in the fudge message, and then add the test file to this file, sorted. +# +# Each file may have one or more markers that deselects the test: +# long - run tests unless --quick +# stress - run tests only if --stress +# moar - run tests only for MoarVM backend +# See the "make quicktest" and "make stresstest" targets in +# build/Makefile.in for examples of use. + + +S02-lexical-conventions/begin_end_pod.t +S02-lexical-conventions/bom.t +S02-lexical-conventions/comments.t +S02-lexical-conventions/end-pod.t +S02-lexical-conventions/minimal-whitespace.t +S02-lexical-conventions/one-pass-parsing.t +S02-lexical-conventions/pod-in-multi-line-exprs.t +S02-lexical-conventions/sub-block-parsing.t +S02-lexical-conventions/unicode.t +S02-lexical-conventions/unicode-whitespace.t +S02-lexical-conventions/unspace.t +S02-lists/indexing.t +S02-lists/tree.t +#S02-literals/adverbs.t +#S02-literals/allomorphic.t +S02-literals/array-interpolation.t +S02-literals/autoref.t +#S02-literals/char-by-name.t +S02-literals/char-by-number.t +S02-literals/fmt-interpolation.t +S02-literals/hash-interpolation.t +#S02-literals/heredocs.t +S02-literals/hex_chars.t +S02-literals/listquote.t +S02-literals/listquote-whitespace.t +S02-literals/misc-interpolation.t +S02-literals/numeric.t +S02-literals/pair-boolean.t +S02-literals/pairs.t +S02-literals/pod.t +#S02-literals/quoting.t +S02-literals/quoting-unicode.t +S02-literals/radix.t +#S02-literals/string-interpolation.t +S02-literals/sub-calls.t +S02-literals/subscript.t +S02-literals/types.t +S02-literals/underscores.t +#S02-literals/version.t diff --git a/tools/build/gen-js-makefile.nqp b/tools/build/gen-js-makefile.nqp index 3dddbd409cb..5a7b5e7ff8f 100644 --- a/tools/build/gen-js-makefile.nqp +++ b/tools/build/gen-js-makefile.nqp @@ -130,5 +130,9 @@ say("js-clean:\n\t\$(RM_F) $ModuleLoader-nqp rakudo.js $CORE $CORE-combined {nqp say("js-lint: gjslint --strict --max_line_length=200 --nojsdoc src/vm/js/perl6-runtime/*.js"); + +rule('js-testable', 'js-all spectest_checkout spectest_update'); +rule('js-spectest', 'js-testable', '$(PERL5) t/harness5 --fudge --js --keep-exit-code --tests-from-file=t/spectest.js.data'); + # Stub say("js-runner-default:")