libports: use 'assert'-proc in run scripts

Issue #5432
This commit is contained in:
Roman Iten 2025-02-17 17:33:14 +01:00 committed by Christian Helmuth
parent 3534383ec9
commit a207a5491c
21 changed files with 72 additions and 129 deletions

View File

@ -17,15 +17,8 @@
#
# Thereby, by default serial output is disabled by this script for non Qemu.
assert_spec x86
if {
![have_spec hw] &&
![have_spec nova]
} {
puts "Platform is unsupported."
exit 0
}
assert {[have_spec x86]}
assert {[have_spec hw] || [have_spec nova]}
if {[have_spec nova]} {

View File

@ -1,11 +1,4 @@
if {
![have_spec hw] &&
![have_spec nova] &&
![have_spec sel4]
} {
puts "Platform is unsupported."
exit 0
}
assert {[have_spec hw] || [have_spec nova] || [have_spec sel4]}
set build_components {
core init timer

View File

@ -1,10 +1,10 @@
create_boot_directory
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
puts "Autopilot mode is not supported on this platform."
exit 0
if {[have_cmd_arg --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}
create_boot_directory
import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/init

View File

@ -1,7 +1,4 @@
if {[expr ![have_include "power_on/qemu"] && ![have_spec linux]]} {
puts "Test only runs in Qemu or Linux.\n";
exit 0
}
assert {[have_include power_on/qemu] || [have_spec linux]}
create_boot_directory

View File

@ -4,15 +4,16 @@
# \date 2016-06-05
#
if {[have_board rpi3] || [have_board imx53_qsb_tz] || [have_board rpi]} {
puts "Run script does not support this platform."
exit 0
}
assert {![have_board rpi3]}
assert {![have_board imx53_qsb_tz]}
assert {![have_board rpi]}
if {[get_cmd_switch --autopilot] && ([have_board linux] ||
[have_board virt_qemu_riscv])} {
puts "Autopilot mode is not supported on this platform."
exit 0
assert {[have_recipe pkg/[drivers_nic_pkg]]} \
"Recipe for 'pkg/[drivers_nic_pkg]' not available."
if {[have_cmd_arg --autopilot]} {
assert {![have_board linux] && ![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}
#

View File

@ -1,10 +1,8 @@
#
# Raspberry PI 1 needs "undef exc" handling emulation code in the kernel
# for ieee754 full-compliant support
#
if {[have_board rpi]} {
puts "Run script does not support Raspberry Pi 1"
exit 0
assert {![have_board rpi]} {
Run script is not supported on this platform.
Raspberry PI 1 needs "undef exc" handling emulation code in the kernel
for ieee754 full-compliant support
}
build { core init lib/ld test/ieee754 lib/posix lib/libc lib/libm lib/vfs }

View File

@ -1,7 +1,4 @@
if {[expr ![have_include "power_on/qemu"] && ![have_spec linux]]} {
puts "Test only supports Qemu or Linux.\n";
exit 0
}
assert {[have_include power_on/qemu] || [have_spec linux]}
create_boot_directory

View File

@ -1,7 +1,5 @@
if {[have_spec linux]} {
puts "The [run_name] scenario requires QEMU networking."
exit 1
}
assert {[have_include power_on/qemu]} \
"Run script requires QEMU networking"
create_boot_directory

View File

@ -10,17 +10,14 @@ set config_ds 1024
set run_script_timeout 500000
if { [get_cmd_switch --autopilot] } {
if {[have_cmd_arg --autopilot]} {
set current_date [clock format [clock seconds] -format %a]
if {[get_cmd_switch --autopilot] && $current_date != "Sat" && $current_date != "Sun" } {
puts "\n Run script is not supported on this platform today. \n";
exit 0
assert {$current_date == "Sat" || $current_date == "Sun"} \
"Autopilot mode is not supported on this platform today."
}
if {[have_include "power_on/qemu"]} {
puts "Run script does not support autopilot mode on Qemu"
exit 0
}
assert {![have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
set run 0
set run_script_timeout 1200
@ -38,10 +35,7 @@ if { [get_cmd_switch --autopilot] } {
set run 1
}
if {!$run} {
puts "\n Run script is not supported on this platform. \n";
exit 0
}
assert {$run} "Autopilot mode is not supported on this platform."
}
create_boot_directory

View File

@ -13,14 +13,11 @@
# \arg test_vfs_config
#
assert {[have_include power_on/qemu] || [have_spec linux]}
if {[catch { exec which $mkfs_cmd } ]} {
puts stderr "Error: $mkfs_cmd not installed, aborting test"; exit }
if {[expr ![have_include "power_on/qemu"] && ![have_spec linux]]} {
puts "Run script does not support this platform."
exit 0
}
#
# Build
#

View File

@ -1,6 +1,6 @@
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
puts "Autopilot mode is not supported on this platform."
exit 0
if {[have_cmd_arg --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}
set mkfs_cmd [installed_command mkfs.vfat]

View File

@ -17,15 +17,17 @@
# tun/tap proxy driver at os/src/driver/nic/linux)
#
if {[have_board linux] ||
[have_board imx53_qsb_tz] ||
[have_board rpi3] ||
[have_board rpi]} {
puts "\n Run script is not supported on this platform. \n"; exit 0 }
assert {![have_board linux]}
assert {![have_board imx53_qsb_tz]}
assert {![have_board rpi3]}
assert {![have_board rpi]}
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
puts "Autopilot mode is not supported on this platform."
exit 0
assert {[have_recipe pkg/[drivers_nic_pkg]]} \
"Recipe for 'pkg/[drivers_nic_pkg]' not available."
if {[have_cmd_arg --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}
set lynx [installed_command lynx]

View File

@ -20,7 +20,7 @@
# ! sudo ip tuntap delete $TAP_DEV mode tap
#
assert_spec linux
assert {[have_spec linux]}
build {
core init timer lib/ld lib/libc lib/vfs lib/vfs_lwip

View File

@ -1,8 +1,6 @@
if { [get_cmd_switch --autopilot] } {
if {[have_include "power_on/qemu"]} {
puts "\nRun script does not support Qemu.\n"
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 lib/libc lib/vfs test/memcpy }

View File

@ -1,16 +1,9 @@
if {![have_include power_on/qemu]} {
puts "Run script is only supported on Qemu"
exit 0
}
assert {[have_include power_on/qemu]}
assert {![have_board rpi3]}
if {[have_board rpi3]} {
puts "\n Run script is not supported on this platform. \n";
exit 0
}
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
puts "Autopilot mode is not supported on this platform."
exit 0
if {[have_cmd_arg --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}
create_boot_directory

View File

@ -1,6 +1,6 @@
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
puts "Autopilot mode is not supported on this platform."
exit 0
if {[have_cmd_arg --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}
set targets {

View File

@ -22,10 +22,7 @@
# ! sudo ip tuntap delete tap0 mode tap
#
if {![have_board linux]} {
puts "Run script is not supported on this platform."
exit 0
}
assert {[have_board linux]}
set nping [installed_command nping]
set setcap [installed_command setcap]

View File

@ -1,14 +1,6 @@
assert_spec x86
if {[have_board linux]} {
puts "Run script does not support Linux."
exit 0
}
if {[have_include "power_on/qemu"]} {
puts "Run script does not support Qemu"
exit 0
}
assert {[have_spec x86]}
assert {![have_board linux]}
assert {![have_include power_on/qemu]}
build {
core init timer lib/ld lib/libc lib/vfs lib/posix lib/vfs_legacy_oss

View File

@ -5,12 +5,9 @@
# configured for the application and for the USB driver.
#
if {[have_include "power_on/qemu"] || [have_spec linux]} {
puts "Run script does not support Qemu or Linux"
exit 0
}
assert_spec x86_64
assert {[have_spec x86_64]}
assert {![have_include power_on/qemu]}
assert {![have_spec linux]}
#
# Please configure your reader's vendor and product IDs here

View File

@ -1,8 +1,8 @@
if { [get_cmd_switch --autopilot] } { assert_spec x86 }
assert {![have_spec linux]}
if { [have_spec linux] } {
puts "Run script is not supported on this platform."
exit 0
if {[have_cmd_arg --autopilot]} {
assert {[have_spec x86]} \
"Autopilot mode is not supported on this platform."
}
create_boot_directory

View File

@ -1,9 +1,5 @@
assert_spec x86
if {[expr ![have_include power_on/qemu] && ![have_spec linux]]} {
puts "Test requires Qemu or Linux."
exit 0
}
assert {[have_spec x86]}
assert {[have_include power_on/qemu] || [have_spec linux]}
create_boot_directory