diff --git a/repos/libports/run/acpi_suspend.run b/repos/libports/run/acpi_suspend.run index ee644a4e94..923d90c298 100644 --- a/repos/libports/run/acpi_suspend.run +++ b/repos/libports/run/acpi_suspend.run @@ -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]} { diff --git a/repos/libports/run/acpica.run b/repos/libports/run/acpica.run index 2997dcbc05..01b5efe4d8 100644 --- a/repos/libports/run/acpica.run +++ b/repos/libports/run/acpica.run @@ -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 diff --git a/repos/libports/run/extract.run b/repos/libports/run/extract.run index 761955c307..254150196d 100644 --- a/repos/libports/run/extract.run +++ b/repos/libports/run/extract.run @@ -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 diff --git a/repos/libports/run/fatfs_blkio.run b/repos/libports/run/fatfs_blkio.run index 98cd95d734..01a6c47c02 100644 --- a/repos/libports/run/fatfs_blkio.run +++ b/repos/libports/run/fatfs_blkio.run @@ -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 diff --git a/repos/libports/run/fetchurl.inc b/repos/libports/run/fetchurl.inc index a94606727c..476fe27df2 100644 --- a/repos/libports/run/fetchurl.inc +++ b/repos/libports/run/fetchurl.inc @@ -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." } # diff --git a/repos/libports/run/ieee754.run b/repos/libports/run/ieee754.run index 2a4bdfb5c2..08d33a0f6f 100644 --- a/repos/libports/run/ieee754.run +++ b/repos/libports/run/ieee754.run @@ -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 } diff --git a/repos/libports/run/libc_block.run b/repos/libports/run/libc_block.run index 83f04119e0..934bb8d36e 100644 --- a/repos/libports/run/libc_block.run +++ b/repos/libports/run/libc_block.run @@ -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 diff --git a/repos/libports/run/libc_getaddrinfo.run b/repos/libports/run/libc_getaddrinfo.run index 9ae9acca3d..e41e28c9d5 100644 --- a/repos/libports/run/libc_getaddrinfo.run +++ b/repos/libports/run/libc_getaddrinfo.run @@ -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 diff --git a/repos/libports/run/libc_integration.run b/repos/libports/run/libc_integration.run index 547bc02b39..2f15504ca3 100644 --- a/repos/libports/run/libc_integration.run +++ b/repos/libports/run/libc_integration.run @@ -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 diff --git a/repos/libports/run/libc_vfs_filesystem_test.inc b/repos/libports/run/libc_vfs_filesystem_test.inc index 89c90cff02..9432627002 100644 --- a/repos/libports/run/libc_vfs_filesystem_test.inc +++ b/repos/libports/run/libc_vfs_filesystem_test.inc @@ -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 # diff --git a/repos/libports/run/libc_vfs_fs_fat.run b/repos/libports/run/libc_vfs_fs_fat.run index aedd59744b..17dfc3a5f0 100644 --- a/repos/libports/run/libc_vfs_fs_fat.run +++ b/repos/libports/run/libc_vfs_fs_fat.run @@ -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] diff --git a/repos/libports/run/lwip.run b/repos/libports/run/lwip.run index e65c485608..45a0b1e15b 100644 --- a/repos/libports/run/lwip.run +++ b/repos/libports/run/lwip.run @@ -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] diff --git a/repos/libports/run/lwip_lx.run b/repos/libports/run/lwip_lx.run index 45010c86a1..18ec1d3e8e 100644 --- a/repos/libports/run/lwip_lx.run +++ b/repos/libports/run/lwip_lx.run @@ -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 diff --git a/repos/libports/run/memcpy.run b/repos/libports/run/memcpy.run index 92549772b6..2a96f689c7 100644 --- a/repos/libports/run/memcpy.run +++ b/repos/libports/run/memcpy.run @@ -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 } diff --git a/repos/libports/run/nic_bridge.run b/repos/libports/run/nic_bridge.run index d1cf388eb6..a754cdef7d 100644 --- a/repos/libports/run/nic_bridge.run +++ b/repos/libports/run/nic_bridge.run @@ -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 diff --git a/repos/libports/run/nic_router.inc b/repos/libports/run/nic_router.inc index cb66ff18c5..def6b3097e 100644 --- a/repos/libports/run/nic_router.inc +++ b/repos/libports/run/nic_router.inc @@ -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 { diff --git a/repos/libports/run/nic_router_ipv4_fragm.run b/repos/libports/run/nic_router_ipv4_fragm.run index 25c1070213..59d4406c63 100644 --- a/repos/libports/run/nic_router_ipv4_fragm.run +++ b/repos/libports/run/nic_router_ipv4_fragm.run @@ -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] diff --git a/repos/libports/run/oss.run b/repos/libports/run/oss.run index 0cd4571d58..2e8064abf5 100644 --- a/repos/libports/run/oss.run +++ b/repos/libports/run/oss.run @@ -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 diff --git a/repos/libports/run/smartcard.run b/repos/libports/run/smartcard.run index bc7da73361..a3edaba3d0 100644 --- a/repos/libports/run/smartcard.run +++ b/repos/libports/run/smartcard.run @@ -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 diff --git a/repos/libports/run/sntp_client.run b/repos/libports/run/sntp_client.run index ff0b8b0771..46275f3d2a 100644 --- a/repos/libports/run/sntp_client.run +++ b/repos/libports/run/sntp_client.run @@ -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 diff --git a/repos/libports/run/system_rtc.run b/repos/libports/run/system_rtc.run index 3531217540..037216b155 100644 --- a/repos/libports/run/system_rtc.run +++ b/repos/libports/run/system_rtc.run @@ -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