diff options
| author | Abigail <abigail@abigail.be> | 2020-12-01 14:25:24 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2020-12-01 14:25:24 +0100 |
| commit | 39be07c87f6fd06f831700455def5b6b4e5effa3 (patch) | |
| tree | 3a46a189c5501f5bcdb36f64e3d0792a9432aa40 /challenge-089/abigail | |
| parent | e94b816b190e7b83ef96fb594486b08311ef83b8 (diff) | |
| download | perlweeklychallenge-club-39be07c87f6fd06f831700455def5b6b4e5effa3.tar.gz perlweeklychallenge-club-39be07c87f6fd06f831700455def5b6b4e5effa3.tar.bz2 perlweeklychallenge-club-39be07c87f6fd06f831700455def5b6b4e5effa3.zip | |
Skip running tests if we're directed to TIO as "executable".
Diffstat (limited to 'challenge-089/abigail')
| -rwxr-xr-x | challenge-089/abigail/test.pl | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/challenge-089/abigail/test.pl b/challenge-089/abigail/test.pl index 668700b0b4..13c18f1e7b 100755 --- a/challenge-089/abigail/test.pl +++ b/challenge-089/abigail/test.pl @@ -115,25 +115,30 @@ foreach my $challenge (@challenges) { my $compiled; next unless -r $source; - # - # Some languages first need to be compiled. - # - if ($comp) { - $compiled = $source =~ s/\.$ext$/.$ext_out/r; - system $comp, "-o", $compiled, $source; - } - - # - # SQL requires requires creating an in-memory database, - # and loading some tables. For that, we need a .tables - # file. We also read the actual query at this time. - # - if ($language eq "SQL") { - my $tables = $source =~ s/\.\Q$ext\E$/.table/r; - ($dbh, $query, $tables_info) = init_sql ($source, $tables); - } - subtest $language => sub { + SKIP: { + if ($exe && $exe eq "TIO") { + skip "No executable present, please use tio.net", 1; + } + + # + # Some languages first need to be compiled. + # + if ($comp) { + $compiled = $source =~ s/\.$ext$/.$ext_out/r; + system $comp, "-o", $compiled, $source; + } + + # + # SQL requires requires creating an in-memory database, + # and loading some tables. For that, we need a .tables + # file. We also read the actual query at this time. + # + if ($language eq "SQL") { + my $tables = $source =~ s/\.\Q$ext\E$/.table/r; + ($dbh, $query, $tables_info) = init_sql ($source, $tables); + } + foreach my $output_exp (@outputs) { SKIP: { my $input = $output_exp =~ s/output/input/r @@ -191,9 +196,8 @@ foreach my $challenge (@challenges) { } is $got, $exp, $name; }} - }; - - unlink $compiled if $compiled; + unlink $compiled if $compiled; + }} } } } |
