From 6c1e269ed233311a17e7cd0313a1f7b8b3139f08 Mon Sep 17 00:00:00 2001 From: Roman Iten Date: Mon, 17 Feb 2025 11:10:01 +0100 Subject: [PATCH] base: use 'assert'-proc in run scripts Issue #5432 --- repos/base/run/migrate.run | 19 +++++++------------ repos/base/run/smp.run | 6 +++--- repos/base/run/timer_accuracy.run | 15 ++++++++------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/repos/base/run/migrate.run b/repos/base/run/migrate.run index 4fbbeac53d..b24908951f 100644 --- a/repos/base/run/migrate.run +++ b/repos/base/run/migrate.run @@ -1,17 +1,12 @@ build { core init lib/ld test/migrate timer } -if {![have_include "power_on/qemu"]} { - puts "Run script is not supported on this platform" - exit 0 -} -if {[have_spec foc] && ([have_board pbxa9] || [have_board rpi3])} { - # foc kernel does detect solely 1 CPU */ - puts "Run script is not supported on this platform" - exit 0 -} -if {![have_spec nova] && ![have_spec foc] && ![have_spec sel4]} { - puts "Run script is not supported on this platform" - exit 0 +assert {[have_include power_on/qemu]} + +assert {[have_spec nova] || [have_spec foc] || [have_spec sel4]} + +if {[have_spec foc]} { + assert {![have_board pbxa9] && ![have_board rpi3]} \ + "foc kernel does detect solely 1 CPU" } create_boot_directory diff --git a/repos/base/run/smp.run b/repos/base/run/smp.run index b434f8a9b2..9073619555 100644 --- a/repos/base/run/smp.run +++ b/repos/base/run/smp.run @@ -5,9 +5,9 @@ # \author Alexander Boettcher # -if { [get_cmd_switch --autopilot] && [have_include "power_on/qemu"] } { - puts "Run script does not support autopilot mode on Qemu" - exit 0 +if {[have_cmd_arg --autopilot]} { + assert {![have_include power_on/qemu]} \ + "Autopilot mode is not supported on this platform." } build { core init lib/ld test/smp } diff --git a/repos/base/run/timer_accuracy.run b/repos/base/run/timer_accuracy.run index 4ce5b19927..51096e3fd7 100644 --- a/repos/base/run/timer_accuracy.run +++ b/repos/base/run/timer_accuracy.run @@ -30,15 +30,16 @@ build_boot_image [build_artifacts] append qemu_args " -nographic" -if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"] && [have_spec nova]} { - # NOVA requires a CPU with invariant TSC support, which is by default not - # supported. KVM has support by explicitly enabling this feature, but by - # now the nightly test machines is not permitted to use KVM +if {[have_cmd_arg --autopilot]} { + assert {![have_spec nova] && ![have_include power_on/qemu]} { + NOVA requires a CPU with invariant TSC support, which is by default not + supported. KVM has support by explicitly enabling this feature, but by + now the nightly test machines is not permitted to use KVM - # append qemu_args " -accel kvm -cpu host,migratable=no,+invtsc" + append qemu_args " -accel kvm -cpu host,migratable=no,+invtsc" - puts "Run script does not support autopilot mode on Qemu" - exit 0 + Autopilot mode is not supported on this platform. + } } set err_cnt 0