Skip to content

Commit

Permalink
Let "make test" work on non-windows
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Dec 31, 2012
1 parent 7cfd727 commit 921bdb8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 8 additions & 3 deletions t/jast.t
Expand Up @@ -341,11 +341,11 @@ sub jast_test($jast_maker, $exercise, $expected, $desc = '') {
my $c := JAST::Class.new(:name('JASTTest'), :super('java.lang.Object'));
$jast_maker($c);
spurt('jastdump.temp', $c.dump());
my $cps := is_windows ?? ";" !! ":";
run('java',
'-cp bin;3rdparty/bcel/bcel-5.2.jar',
'-cp bin' ~ $cps ~ '3rdparty/bcel/bcel-5.2.jar',
'org/perl6/nqp/jast2bc/JASTToJVMBytecode',
'jastdump.temp', 'JASTTest.class');

# Compile the test program.
spurt('RunTest.java', '
public class RunTest {
Expand Down Expand Up @@ -383,5 +383,10 @@ sub run($cmd, *@args) {
}

sub unlink($file) {
run('del', $file);
my $command := is_windows ?? "del" !! "rm";
run($command, $file);
}

sub is_windows() {
pir::interpinfo__Si(30) eq "windows";
}
12 changes: 9 additions & 3 deletions t/qast.t
Expand Up @@ -1107,12 +1107,13 @@ sub qast_test($qast_maker, $expected, $desc = '') {
my $jast := QAST::CompilerJAST.jast($qast_maker());
my $dump := $jast.dump();
spurt('QAST2JASTOutput.dump', $dump);
my $cps := is_windows ?? ";" !! ":";
run('java',
'-cp bin;3rdparty/bcel/bcel-5.2.jar',
'-cp bin' ~ $cps ~ '3rdparty/bcel/bcel-5.2.jar',
'org/perl6/nqp/jast2bc/JASTToJVMBytecode',
'QAST2JASTOutput.dump', 'QAST2JASTOutput.class');
run('java',
'-cp .;bin;3rdparty/bcel/bcel-5.2.jar',
'-cp .' ~ $cps ~ 'bin' ~ $cps ~ '3rdparty/bcel/bcel-5.2.jar',
'QAST2JASTOutput',
'> QAST2JASTOutput.output');
my $output := subst(slurp('QAST2JASTOutput.output'), /\r\n/, "\n", :global);
Expand Down Expand Up @@ -1142,5 +1143,10 @@ sub run($cmd, *@args) {
}

sub unlink($file) {
run('del', $file);
my $command := is_windows ?? "del" !! "rm";
run($command, $file);
}

sub is_windows() {
pir::interpinfo__Si(30) eq "windows";
}

0 comments on commit 921bdb8

Please sign in to comment.