Skip to content

Commit

Permalink
tool/autopilot: mark incompletely executed tests
Browse files Browse the repository at this point in the history
...with "ABORT", in case of an unmet 'assert_spec' in the run scenario.

Issue genodelabs#5432
  • Loading branch information
rite committed Jan 22, 2025
1 parent cd6701c commit d631b42
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tool/autopilot
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,19 @@ proc build_failed_because_of_missing_run_script { arch board kernel run_script }
}


proc build_failed_because_of_unsatisfied_requirement { arch board kernel run_script } {

# we cannot inspect any logfile when --stdout was used
if {[get_cmd_switch --stdout]} { return 0 }

# grep log output for the respective error message
if {[catch {
exec grep {^\(\[....-..-.. ..:..:..] \)*Test requires} [log_file $arch $board $kernel $run_script]
}]} { return 0 }
return 1
}


#
# Collect command-line arguments
#
Expand Down Expand Up @@ -484,6 +497,8 @@ foreach arch $architectures {

if {[build_failed_because_of_missing_run_script $arch $board $kernel $run_script]} {
puts stderr "-> UNAVAILABLE"
} elseif {[build_failed_because_of_unsatisfied_requirement $arch $board $kernel $run_script]} {
puts stderr "-> ABORT ($elapsed): unsatisfied requirement"
} else {
puts stderr "-> ERROR ($elapsed)"
set exit_value -1
Expand Down
2 changes: 1 addition & 1 deletion tool/run/run
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ proc assert_spec {spec} {
global specs
if {[lsearch $specs $spec] == -1} {
puts stderr "Test requires '$spec'"
exit 0
exit 1
}
}

Expand Down

0 comments on commit d631b42

Please sign in to comment.