Commit bb9861f4 authored by Guillaume Huard's avatar Guillaume Huard
Browse files

Several bugfixes

parent 932ef8e4
......@@ -116,19 +116,20 @@ sub run_command($$$) {
my $data = {};
my $timeout = get_value($test, "timeout", 10);
my $IOlimit = get_value($test, "IOlimit", 10);
my $command_line = "ulimit -f$IOlimit;timeout -s9 $timeout $command$arguments>.output.txt 2>.error.txt";
my $command_line = "ulimit -f$IOlimit;timeout -s9 $timeout $command$arguments".
">.internal_output.txt 2>.internal_error.txt";
if (exists($test->{input})) {
write_file(".input.txt", $test->{input});
$command_line .= " <.input.txt";
write_file(".internal_input.txt", $test->{input});
$command_line .= " <.internal_input.txt";
}
debug("Executing: $command_line\n");
# One should use the POSIX macros WIFEXITED, WEXITSTATUS, and so on, but it's too cumbersome
$data->{failure} = system("$command_line");
$data->{signal} = $data->{failure} & 0xFF;
$data->{code} = $data->{failure} >> 8;
$data->{output} = read_file(".output.txt");
$data->{error} = read_file(".error.txt");
remove(".input.txt", ".output.txt", ".error.txt");
$data->{output} = read_file(".internal_output.txt");
$data->{error} = read_file(".internal_error.txt");
remove(".internal_input.txt", ".internal_output.txt", ".internal_error.txt");
return $data;
}
......@@ -495,4 +496,7 @@ foreach my $name (sort(keys(%$test_cases))) {
}
my $min = $ENV{VPL_GRADEMIN};
my $max = $ENV{VPL_GRADEMAX};
if ($total == 0) {
error("No test defined !");
}
grade($score * $max / $total + $min);
......@@ -55,7 +55,7 @@ $(LOCAL_DIRS): %: %/vpl_id.txt %/$(TARGET)
cd $* && ./local.sh $(MODE)
$(WRONG_DIRS): %_wrong: %/vpl_id.txt %_wrong/$(TARGET)
cp -r $*/vpl_id.txt $*/ef $*/rf $*_wrong
-cp -r $*/vpl_id.txt $*/ef $*/rf $*_wrong
cd $*_wrong && ./local.sh $(MODE)
%/vpl_id.txt: %.org
......
......@@ -26,6 +26,8 @@ all: files
$(EMACS) $< --batch --funcall org-babel-execute-buffer
$(EMACS) $< --batch --funcall org-babel-tangle
$(DEFAULT_VPL_IDS): Default_%/vpl_id.txt: %/vpl_id.txt
.SECONDEXPANSION:
%/push: %/vpl_id.txt $$(wildcard %/*/*)
cd $* && ../local.sh push
......
......@@ -42,11 +42,11 @@ then
fi
done
cd local_run
if [ "$1" = "debug" ]
then
echo "set -x" > bashrc
export BASH_ENV="./bashrc"
fi
# if [ "$1" = "debug" ]
# then
# echo "set -x" > bashrc
# export BASH_ENV="./bashrc"
# fi
chmod +x ./vpl_execution.sh
exec ./vpl_execution.sh $MODE local $*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment