Skip to content

Commit

Permalink
fixup! os: use 'assert'-proc in run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rite committed Feb 13, 2025
1 parent da3b393 commit 453afc5
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 43 deletions.
2 changes: 1 addition & 1 deletion repos/os/run/assert_nic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if {[have_cmd_arg --autopilot]} {
assert {![have_board linux] &&
![have_board zynq_qemu] &&
![have_board virt_qemu_riscv]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."
}
2 changes: 1 addition & 1 deletion repos/os/run/cpu_bench.run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if {[have_cmd_arg --autopilot]} {
assert {![have_include power_on/qemu]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."
}

assert {![have_board linux]}
Expand Down
7 changes: 3 additions & 4 deletions repos/os/run/demo.run
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
assert {[have_recipe pkg/[drivers_interactive_pkg]]} "
Recipe for 'pkg/[drivers_interactive_pkg]' not available.
"
assert {[have_recipe pkg/[drivers_interactive_pkg]]} \
"Recipe for 'pkg/[drivers_interactive_pkg]' not available."

assert {![have_board imx6q_sabrelite]}
assert {![have_board imx7d_sabre]}
assert {![have_board zynq_usrp_e31x]}

if {[have_cmd_arg --autopilot]} {
assert {![have_board linux] && ![have_include power_on/qemu]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."
}

create_boot_directory
Expand Down
9 changes: 4 additions & 5 deletions repos/os/run/fb_bench.run
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
assert {[have_recipe pkg/[drivers_interactive_pkg]]} "
Recipe for 'pkg/[drivers_interactive_pkg]' not available.
"
assert {[have_recipe pkg/[drivers_interactive_pkg]]} \
"Recipe for 'pkg/[drivers_interactive_pkg]' not available."

assert {![have_board imx7d_sabre]}
assert {![have_board imx6q_sabrelite]}
Expand All @@ -10,9 +9,9 @@ assert {![have_board zynq_usrp_e31x]}
assert {![have_board imx53_qsb_tz]}
assert {!([have_board imx53_qsb] && [have_spec foc])}

if {[get_cmd_switch --autopilot]} {
if {[have_cmd_arg --autopilot]} {
assert {![have_spec linux] && ![have_board virt_qemu_riscv]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."
}

create_boot_directory
Expand Down
10 changes: 4 additions & 6 deletions repos/os/run/framebuffer.run
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
assert {[have_recipe pkg/[drivers_interactive_pkg]]} "
Recipe for 'pkg/[drivers_interactive_pkg]' not available.
"
assert {[have_recipe pkg/[drivers_interactive_pkg]]} \
"Recipe for 'pkg/[drivers_interactive_pkg]' not available."

create_boot_directory

Expand Down Expand Up @@ -60,8 +59,7 @@ install_config {

build_boot_image [build_artifacts]

assert {![have_cmd_arg --autopilot]} {
Autopilot mode is not supported by this run script.
}
assert {![have_cmd_arg --autopilot]} \
"Autopilot mode is not supported by this run script."

run_genode_until forever
2 changes: 1 addition & 1 deletion repos/os/run/init_smp.run
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set init_ram 256
if { [have_cmd_arg --autopilot] } {

assert {![have_include power_on/qemu]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."

assert {[have_spec nova]}

Expand Down
2 changes: 1 addition & 1 deletion repos/os/run/log_core.run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ assert {![have_spec linux]}

if {[have_cmd_arg --autopilot]} {
assert {[have_include power_on/qemu]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."
}

proc log_service { } {
Expand Down
2 changes: 1 addition & 1 deletion repos/os/run/lx_fs_import.run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
assert_spec linux
assert {[have_spec linux]}

lappend depot_archives [depot_user]/src/[base_src]
lappend depot_archives [depot_user]/src/init
Expand Down
5 changes: 2 additions & 3 deletions repos/os/run/mixer.run
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ install_config {
</config>
}

assert {![have_cmd_arg --autopilot]} {
Autopilot mode is not supported by this run script.
}
assert {![have_cmd_arg --autopilot]} \
"Autopilot mode is not supported by this run script."

if {[expr ![file exists bin/client1.f32] || ![file exists bin/client2.f32]]} {
puts ""
Expand Down
10 changes: 4 additions & 6 deletions repos/os/run/ping.run
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ set on_linux_with_dst_ip ""
catch {set on_linux_with_dst_ip $::env(ON_LINUX_WITH_DST_IP)}
set on_linux [expr ![string equal $on_linux_with_dst_ip ""]]

assert {!([have_spec linux] && !$on_linux)} {
You must set 'on_linux_with_dst_ip' in the run script if you want to run on Linux.
}
assert {!([have_spec linux] && !$on_linux)} \
"You must set 'on_linux_with_dst_ip' in the run script if you want to run on Linux."

assert {!(![have_spec linux] && $on_linux)} {
You must run on Linux if 'on_linux_with_dst_ip' in the run script is set.
}
assert {!(![have_spec linux] && $on_linux)} \
"You must run on Linux if 'on_linux_with_dst_ip' in the run script is set."

set on_hardware [expr ![have_include power_on/qemu]]
set second_ping_via_udp [expr $on_hardware && !$on_linux]
Expand Down
5 changes: 2 additions & 3 deletions repos/os/run/pointer.run
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,8 @@ install_config {

build_boot_image [build_artifacts]

assert {![have_cmd_arg --autopilot]} {
Autopilot mode is not supported by this run script.
}
assert {![have_cmd_arg --autopilot]} \
"Autopilot mode is not supported by this run script."

run_genode_until forever

Expand Down
6 changes: 3 additions & 3 deletions repos/os/run/sd_card_bench.run
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
if {[have_cmd_arg --autopilot]} {
assert {![have_board virt_qemu_riscv] && ![have_board rpi]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."
}

proc buffer_size_kib {} {
Expand All @@ -12,7 +12,7 @@ proc buffer_size_kib {} {
if {[have_board imx53_qsb]} { return [expr 1024] }
if {[have_board imx53_qsb_tz]} { return [expr 1024] }
if {[have_board rpi]} { return [expr 4 * 1024] }
assert {false} Run script is not supported on this platform.
assert {false} "Run script is not supported on this platform."
}

proc sd_card {} {
Expand All @@ -21,7 +21,7 @@ proc sd_card {} {
if {[have_board imx53_qsb]} { return imx53_sd_card }
if {[have_board imx53_qsb_tz]} { return imx53_sd_card }
if {[have_board rpi]} { return rpi_sd_card }
assert {false} Run script is not supported on this platform.
assert {false} "Run script is not supported on this platform."
}

create_boot_directory
Expand Down
5 changes: 2 additions & 3 deletions repos/os/run/test.run
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@
# make run/test KERNEL=linux PKG=test-fs_report
#

assert {![have_cmd_arg --autopilot]} {
Autopilot mode is not supported by this run script.
}
assert {![have_cmd_arg --autopilot]} \
"Autopilot mode is not supported by this run script."

##
# Obtain name of the test pkg from the 'PKG' environment variable
Expand Down
5 changes: 2 additions & 3 deletions repos/os/run/uart.run
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ append qemu_args " -serial file:/tmp/serial1"
append qemu_args " -serial file:/tmp/serial2"
append qemu_args " -serial file:/tmp/serial3"

assert {![have_cmd_arg --autopilot]} {
Autopilot mode is not supported by this run script.
}
assert {![have_cmd_arg --autopilot]} \
"Autopilot mode is not supported by this run script."

run_genode_until forever

2 changes: 1 addition & 1 deletion repos/os/run/usb_block.run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ assert {[have_board pc]}

if {[have_cmd_arg --autopilot]} {
assert {[have_include "power_on/qemu"]} \
Autopilot mode is not supported on this platform.
"Autopilot mode is not supported on this platform."
}

create_boot_directory
Expand Down
2 changes: 1 addition & 1 deletion repos/os/run/vmm_x86.run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assert {[have_spec x86]}

if { [have_cmd_arg --autopilot] } {
assert {!([have_spec x86_32] && ![have_include power_on/qemu])} \
nightly x86 32bit test machine has no vmx support
"Nightly x86 32-bit test machine has no vmx support."

assert {!([have_include power_on/qemu] && [have_spec sel4])}

Expand Down

0 comments on commit 453afc5

Please sign in to comment.