Skip to content

Commit

Permalink
Add a m-spectest5_precompile to run tests in precompilation mode
Browse files Browse the repository at this point in the history
Currently this fails for both tests that use 'use lib' or have
precompilation only bugs. Fixing the 'use lib' part need further
work.
  • Loading branch information
pmurias committed Jan 16, 2019
1 parent 836c18a commit 89fee86
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/harness5
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GetOptions(
'quick:1' => \my $do_quick,
'stress:1' => \my $do_stress,
'archive=s' => \my $archive,
'precompile' => \my $precompile,
'jvm' => \my $jvm,
'js' => \my $js,
'moar' => \my $moar,
Expand Down Expand Up @@ -120,8 +121,9 @@ if ($jvm) {
}

if (eval "require $tap_harness_class;") {
my $run_with_perl = $precompile ? [$ENV{HARNESS_PERL}, 't/precompileandrun'] : [$ENV{HARNESS_PERL}];
my %harness_options = (
exec => $jvm ? [$^X, "./eval-client.pl", "TESTTOKEN", "run"] : [$ENV{HARNESS_PERL}],
exec => $jvm ? [$^X, "./eval-client.pl", "TESTTOKEN", "run"] : $run_with_perl,
verbosity => 0+$Test::Harness::verbose,
jobs => $jobs,
ignore_exit => 1,
Expand Down Expand Up @@ -239,6 +241,7 @@ Options:
--slow - spread tests marked "slow" equally over the run (default on non-Win)
--moar/--jvm/--js - mutually exclusive. Use MoarVM/JVM backend
--no-merge - pass STDERR from the tests through to the terminal's STDERR
--precompile - precompile tests before running them
--verbosity=[level] - set the verbosity level.
1 verbose Print individual test results to STDOUT.
Expand Down
2 changes: 2 additions & 0 deletions t/precompileandrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$*REPO.precomp-repository.precompile(@*ARGS[0].IO, 'precompiled_test', :force);
$*REPO.precomp-repository.load('precompiled_test');
4 changes: 4 additions & 0 deletions tools/build/Makefile-Moar.in
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ m-coretest5: m-all
m-spectest5: m-testable t/spectest.data
$(M_HARNESS5_WITH_FUDGE) --tests-from-file=t/spectest.data

# Run the spectests that we know work after precompiling them.
m-spectest5_precompile: m-testable t/spectest.data
$(M_HARNESS5_WITH_FUDGE) --precompile --tests-from-file=t/spectest.data

m-spectest_full5: m-testable
$(M_HARNESS5_WITH_FUDGE) t/spec

Expand Down

0 comments on commit 89fee86

Please sign in to comment.