Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update so PLA can submit smolder reports. Add a new prove tool, run_t…
…est.nqp, which copies some code from t/harness. Eventually I'll move out shared logic into a shared library
- Loading branch information
1 parent
5894091
commit 8e06466
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#! parrot-nqp | ||
INIT { | ||
pir::load_bytecode('library/kakapo_full.pbc'); | ||
pir::load_bytecode('t/testlib/pla_test.pbc'); | ||
} | ||
|
||
my $interp := pir::getinterp__P(); | ||
my @argv := $interp[2]; | ||
MAIN(@argv); | ||
|
||
sub MAIN(@argv) { | ||
my $test := @argv.shift; | ||
if $test ne 't/sanity.t' { | ||
my $pla := pir::loadlib__ps("./dynext/linalg_group"); | ||
} | ||
compile_and_execute($test); | ||
} | ||
|
||
sub is_pir_test($filename) { | ||
my $idx := pir::index__ISS($filename, 't/pir'); | ||
if $idx == 0 { | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
sub compile_pir_test($filename) { | ||
my $sub; | ||
Q:PIR { | ||
$P1 = find_lex "$filename" | ||
$P0 = new ['FileHandle'] | ||
$P0.'open'($P1) | ||
$P2 = $P0.'readall'() | ||
$P0.'close'() | ||
$P3 = compreg 'PIR' | ||
$P4 = $P3($P2) | ||
$P4 = $P4[0] | ||
store_lex '$sub', $P4 | ||
}; | ||
return $sub; | ||
} | ||
sub compile_nqp_test($filename) { | ||
my $sub := Nqp::compile_file($filename); | ||
return $sub[0]; | ||
} | ||
|
||
sub compile_and_execute($filename) { | ||
my $sub; | ||
my $pirfile := is_pir_test($filename); | ||
if $pirfile == 0 { | ||
$sub := compile_nqp_test($filename); | ||
} else { | ||
$sub := compile_pir_test($filename); | ||
} | ||
try { | ||
$sub(); | ||
CATCH { | ||
# WAT DO? | ||
} | ||
} | ||
} |