t/problems/double/meta.yml
t/problems/double/tests/wa/meta.yml
t/problems/double/tests/wa/prog.c
+t/problems/errors/tests/nonexistent-runner/meta.yml
+t/problems/errors/tests/invalid-runner/meta.yml
+t/problems/errors/tests/no-runner/meta.yml
+t/problems/errors/meta.yml
t/problems/hello/1.in
t/problems/hello/1.ok
t/problems/hello/meta.yml
sub safe_can {
my ($type, $sub, $name) = @_;
- return unless $name =~ /^\w+$/s;
+ get_logger->logdie("Invalid \l$type: '$name'") unless $name =~ /^\w+$/s;
my $pkg = __PACKAGE__ . "::${type}::${name}";
eval "require $pkg" or get_logger->warn("Error while requiring $pkg: $@");
$pkg->can($sub) or get_logger->logdie("No such \l$type: '$name'");
for my $source (<$problem/tests/*>) {
SKIP: {
my $meta = LoadFile "$source/meta.yml";
- my $compiler = COMPILER->{$meta->{files}{prog}{format}};
- skip "$compiler not found in path", 3 unless $ENV{GRUNTMASTER_VM} || which $compiler;
- local $TODO = $meta->{todo} if exists $meta->{todo};
- $meta->{files}{prog}{content} = read_file "$source/$meta->{files}{prog}{name}";
+ if ($meta->{files}{prog}) {
+ my $compiler = COMPILER->{$meta->{files}{prog}{format}};
+ skip "$compiler not found in path", 3 unless $ENV{GRUNTMASTER_VM} || which $compiler;
+ local $TODO = $meta->{todo} if exists $meta->{todo};
+ $meta->{files}{prog}{content} = read_file "$source/$meta->{files}{prog}{name}";
+ }
$meta = merge $meta, $pbmeta;
note "Running $meta->{test_name} ($meta->{test_description})...";
my $savedcwd = getcwd;
--- /dev/null
+---
+name: Errors
+description: A 'problem' that produces various errors
+generator: Undef
+judge: Absolute
+testcnt: 1
--- /dev/null
+test_name: Invalid Runner
+test_description: A job with an invalid Runner
+runner: this_is_invalid!
+expected_result: -1
+expected_result_text: "Invalid runner: 'this_is_invalid!'"
\ No newline at end of file
--- /dev/null
+test_name: No Runner
+test_description: A job with no Runner
+expected_result: -1
+expected_result_text: "Required parameter missing: runner"
\ No newline at end of file
--- /dev/null
+test_name: Nonexistent Runner
+test_description: A job with a non-existent Runner
+runner: FakeRunner
+expected_result: -1
+expected_result_text: "No such runner: 'FakeRunner'"
\ No newline at end of file