aboutsummaryrefslogtreecommitdiff
path: root/challenge-089/abigail
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2020-11-30 18:50:01 +0100
committerAbigail <abigail@abigail.be>2020-11-30 18:50:01 +0100
commit69a1d6dfbfc218f4ff4a05b74dabc56bc386ab92 (patch)
tree3e6fe09d9cdcf24d32a20da82d8ac04fdf36421c /challenge-089/abigail
parent9115d53d1bb66833381e6f5b64a0122f01a7ce37 (diff)
downloadperlweeklychallenge-club-69a1d6dfbfc218f4ff4a05b74dabc56bc386ab92.tar.gz
perlweeklychallenge-club-69a1d6dfbfc218f4ff4a05b74dabc56bc386ab92.tar.bz2
perlweeklychallenge-club-69a1d6dfbfc218f4ff4a05b74dabc56bc386ab92.zip
Test Fortran programs.
This introduced a little improvement of handling compiled languages.
Diffstat (limited to 'challenge-089/abigail')
-rwxr-xr-xchallenge-089/abigail/test.pl14
1 files changed, 10 insertions, 4 deletions
diff --git a/challenge-089/abigail/test.pl b/challenge-089/abigail/test.pl
index 13345e3eaa..da7e32d32a 100755
--- a/challenge-089/abigail/test.pl
+++ b/challenge-089/abigail/test.pl
@@ -47,7 +47,7 @@ my %languages = (
args => ["-f"],
},
C => {
- exe => "/usr/bin/cc",
+ comp => "/usr/bin/cc",
ext => "c",
dir => "c",
},
@@ -79,6 +79,11 @@ my %languages = (
dir => "csh",
exe => "/bin/csh",
},
+ Fortran => {
+ ext => "f90",
+ dir => "fortran",
+ comp => "/opt/local/bin/gfortran-mp-4.4",
+ }
);
@@ -96,6 +101,7 @@ foreach my $challenge (@challenges) {
my $info = $languages {$language};
my $exe = $$info {exe};
my $ext = $$info {ext};
+ my $comp = $$info {comp};
my $dir = $$info {dir} // lc $language;
my @args = @{$$info {args} // []};
my $filter = $$info {filter} // '';
@@ -105,11 +111,11 @@ foreach my $challenge (@challenges) {
next unless -r $source;
#
- # C requires special handling. The source needs to be compiled.
+ # Some languages first need to be compiled.
#
- if ($language eq "C") {
+ if ($comp) {
$compiled = $source =~ s/\.$ext$/.$ext_out/r;
- system $exe, "-o", $compiled, $source;
+ system $comp, "-o", $compiled, $source;
}
#