From 39be07c87f6fd06f831700455def5b6b4e5effa3 Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 1 Dec 2020 14:25:24 +0100 Subject: Skip running tests if we're directed to TIO as "executable". --- challenge-089/abigail/test.pl | 46 +++++++++++++++++++++++-------------------- 1 file 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; + }} } } } -- cgit