tool: have_cmd_arg -> have_cmd_switch (run, autopilot, dts)

Issue #5432
This commit is contained in:
Christian Helmuth 2025-02-26 13:44:46 +01:00
parent 62b44f2fbf
commit cd40a5be96
50 changed files with 83 additions and 82 deletions

View File

@ -5,7 +5,7 @@ if {[have_include power_on/qemu]} {
set check_pat 0
}
if {[have_cmd_arg --autopilot] && [have_spec x86_32]} {
if {[have_cmd_switch --autopilot] && [have_spec x86_32]} {
# Disable test for our outdated nighly test machine for 32bit
set check_pat 0
}

View File

@ -5,7 +5,7 @@
# \author Alexander Boettcher
#
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -30,7 +30,7 @@ build_boot_image [build_artifacts]
append qemu_args " -nographic"
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --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

View File

@ -1,4 +1,4 @@
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -11,7 +11,7 @@ assert {![have_board rpi]}
assert {[have_recipe pkg/[drivers_nic_pkg]]} \
"Recipe for 'pkg/[drivers_nic_pkg]' not available."
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board linux] && ![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -10,7 +10,7 @@ set config_ds 1024
set run_script_timeout 500000
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
set current_date [clock format [clock seconds] -format %a]
assert {$current_date == "Sat" || $current_date == "Sun"} \
"Autopilot mode is not supported on this platform today."

View File

@ -1,4 +1,4 @@
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -25,7 +25,7 @@ assert {![have_board rpi]}
assert {[have_recipe pkg/[drivers_nic_pkg]]} \
"Recipe for 'pkg/[drivers_nic_pkg]' not available."
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -1,4 +1,4 @@
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -1,7 +1,7 @@
assert {[have_include power_on/qemu]}
assert {![have_board rpi3]}
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -1,4 +1,4 @@
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -1,6 +1,6 @@
assert {![have_spec linux]}
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {[have_spec x86]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -7,7 +7,7 @@ assert {![have_board imx53_qsb_tz]}
#
# these targets would require extra setup on the autopilot which is not desired
#
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board linux] &&
![have_board zynq_qemu] &&
![have_board virt_qemu_riscv]} \

View File

@ -1,4 +1,4 @@
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -1,7 +1,7 @@
assert {[have_recipe pkg/[drivers_interactive_pkg]]} \
"Recipe for 'pkg/[drivers_interactive_pkg]' not available."
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board linux] && ![have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
}
@ -205,7 +205,7 @@ close $launchpad_config_fd
build_boot_image [list {*}[build_artifacts] launchpad.config]
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
run_genode_until {\[init -> scout\] png is.*\n} 40
grep_output {(requests resources: )|(Error)}

View File

@ -1,7 +1,7 @@
assert {[have_recipe pkg/[drivers_interactive_pkg]]} \
"Recipe for 'pkg/[drivers_interactive_pkg]' not available."
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_spec linux] && ![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -10,7 +10,7 @@ set demand [expr 1*1024*1024]
set cpus 4
set init_ram 256
if { [have_cmd_arg --autopilot] } {
if { [have_cmd_switch --autopilot] } {
assert {![have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
@ -102,7 +102,7 @@ build_boot_image [build_artifacts]
append qemu_args " -m [expr 128 + $init_ram*$cpus]M -nographic -smp $cpus"
if { [have_cmd_arg --autopilot] } {
if { [have_cmd_switch --autopilot] } {
run_genode_until {bomb started} 20

View File

@ -11,7 +11,7 @@ rename exit run_tool_exit
proc exit {{code 0}} {
global lx_fs_dir
global input_file
if {[have_cmd_arg --autopilot]} { exec rm -rf $input_file $lx_fs_dir }
if {[have_cmd_switch --autopilot]} { exec rm -rf $input_file $lx_fs_dir }
run_tool_exit $code
}
build { core init lib/ld lib/vfs test/internet_checksum server/lx_fs }

View File

@ -1,12 +1,12 @@
assert {![have_spec linux]}
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {[have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
}
proc log_service { } {
if { [have_cmd_arg --autopilot] } { return log }
if { [have_cmd_switch --autopilot] } { return log }
return ram
}
@ -105,7 +105,7 @@ build_boot_image [build_artifacts]
append qemu_args " -nographic "
if { [have_cmd_arg --autopilot] } {
if { [have_cmd_switch --autopilot] } {
run_genode_until {.*\[log_core -> log] \[.*\n} 20
} else {
run_genode_until forever

View File

@ -7,7 +7,7 @@ lappend depot_archives [depot_user]/src/vfs_import
set build_components { }
if { [have_cmd_arg --autopilot] } {
if { [have_cmd_switch --autopilot] } {
lappend depot_archives [depot_user]/src/lx_fs
} else {
lappend build_components server/lx_fs

View File

@ -1,7 +1,7 @@
#
# Check for platform support
#
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board virt_qemu_riscv] && ![have_board rpi]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -39,7 +39,7 @@
# make run/test KERNEL=linux PKG=test-fs_report
#
assert {![have_cmd_arg --autopilot]}
assert {![have_cmd_switch --autopilot]}
##
# Obtain name of the test pkg from the 'PKG' environment variable

View File

@ -1,6 +1,6 @@
assert {[have_board pc]}
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {[have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
}

View File

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

View File

@ -1,6 +1,6 @@
assert {[have_spec x86_64]}
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_include power_on/qemu] &&
![have_board linux]} \
"Autopilot mode is not supported on this platform."
@ -368,7 +368,7 @@ install_config $config
build_boot_image [build_artifacts]
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
run_genode_until {\[init -\> init_dynamic -\> intel_fb\].*connector connected="true" name="HDMI-A-3"} 30
run_genode_until {\</connectors\>} 20 [output_spawn_id]
run_genode_until {green} 30 [output_spawn_id]

View File

@ -3,7 +3,7 @@ assert {[have_spec x86]}
set path_microcode "[exec [genode_dir]/tool/ports/current --no-print-directory microcode_intel]/src/app/intel/intel-ucode"
set microcode_files [glob -nocomplain -dir $path_microcode *-*-*]
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_include power_on/qemu]} \
"Autopilot mode is not supported on this platform."
@ -61,7 +61,7 @@ append qemu_args "-smp 4 "
run_genode_until "microcode check done" 30
# cleanup
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
file delete -force bin/micro.code
foreach file $microcode_files {
file delete bin/$file

View File

@ -9,7 +9,7 @@ assert {[have_spec x86]}
assert {![have_include power_on/qemu]}
assert {![have_include power_on/linux]}
if {[have_cmd_arg --autopilot] && [have_spec x86_32]} {
if {[have_cmd_switch --autopilot] && [have_spec x86_32]} {
assert {[have_spec foc] || [have_spec nova]} {
Autopilot mode is not supported on this platform.

View File

@ -9,7 +9,7 @@ assert {[have_spec x86]}
assert {![have_include power_on/qemu]}
assert {![have_include power_on/linux]}
if {[have_cmd_arg --autopilot] && [have_spec x86_32]} {
if {[have_cmd_switch --autopilot] && [have_spec x86_32]} {
assert {[have_spec foc] || [have_spec nova]} {
Autopilot mode is not supported on this platform.

View File

@ -1,4 +1,4 @@
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_include power_on/qemu]} \
"Running tool-chain auto test in autopilot on Qemu is not recommended."
}

View File

@ -19,7 +19,7 @@ set use_overlay_from_disk 1
set use_serial 1
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 1

View File

@ -19,7 +19,7 @@ set use_overlay_from_disk 1
set use_serial 1
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 1

View File

@ -19,7 +19,7 @@ set use_overlay_from_disk 1
set use_serial 0
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 1

View File

@ -19,7 +19,7 @@ set use_overlay_from_disk 1
set use_serial 0
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 1

View File

@ -19,7 +19,7 @@ set use_overlay_from_disk 1
set use_serial 0
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 1

View File

@ -30,7 +30,7 @@ set use_overlay_from_disk 1
set use_serial 0
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 6

View File

@ -18,7 +18,7 @@ set use_overlay_from_disk 0
set use_serial 0
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 1

View File

@ -16,7 +16,7 @@ set use_rumpfs 1
set use_serial 0
set use_check_result 1
set use_usb [expr ![have_cmd_arg --autopilot]]
set use_usb [expr ![have_cmd_switch --autopilot]]
set use_ps2 1
set use_vms 1

View File

@ -183,7 +183,7 @@ global specs
global repositories
set depot_auto_update ""
if {[have_cmd_arg --depot-auto-update]} {
if {[have_cmd_switch --depot-auto-update]} {
set depot_auto_update "--depot-auto-update"
}
@ -211,7 +211,7 @@ append boot_components { usb_hid_raw.iso vbox6_genode_usb_hid_raw.vbox }
build_boot_image $boot_components
if { ![have_cmd_arg --autopilot] } { run_genode_until forever }
if { ![have_cmd_switch --autopilot] } { run_genode_until forever }
# autopilot test

View File

@ -1,4 +1,4 @@
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_board virt_qemu_riscv]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -3,7 +3,7 @@ assert {[have_spec nova] || [have_spec foc]}
assert {![have_include power_on/qemu]}
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
assert {![have_spec x86_32]} \
"Autopilot mode is not supported on this platform."
}

View File

@ -1,6 +1,6 @@
#!/usr/bin/expect
if {[have_cmd_arg --autopilot]} {
if {[have_cmd_switch --autopilot]} {
set current_date [clock format [clock seconds] -format %a]
assert {$current_date == "Sat" || $current_date == "Sun"} \
"Autopilot mode is not supported on this platform today."

View File

@ -91,7 +91,7 @@ proc help { } {
##
# Return true if command-line switch was specified
#
proc have_cmd_arg { arg_name } {
proc have_cmd_switch { arg_name } {
global argv
return [expr [lsearch $argv $arg_name] >= 0]
}
@ -110,7 +110,7 @@ proc wipe_test_dir { } {
# Remove build artifacts if commanded via the '--cleanup' argument
#
proc cleanup { } {
if {[have_cmd_arg --cleanup]} {
if {[have_cmd_switch --cleanup]} {
puts "cleaning up $test_dir"
wipe_test_dir
}
@ -165,7 +165,7 @@ proc log_file { arch board kernel run_script } {
proc log_fd { arch board kernel run_script } {
# if '--stdout' was specified, don't write log output to files
if {[have_cmd_arg --stdout]} { return stdout }
if {[have_cmd_switch --stdout]} { return stdout }
# create file descriptor of log file on demand
global _log_fds
@ -200,7 +200,7 @@ proc execute_run_script { arch board kernel run_script } {
set fd [log_fd $arch $board $kernel $run_script]
if {[catch {
if {[have_cmd_arg --time-stamp]} {
if {[have_cmd_switch --time-stamp]} {
exec make -C [build_dir $arch] [file join run $run_script] BOARD=$board KERNEL=$kernel \
|& ts "\[%F %H:%M:%S\]" >&@ $fd
} else {
@ -257,7 +257,7 @@ proc build_dir_remainings { arch } {
proc build_failed_because_of_missing_run_script { arch board kernel run_script } {
# we cannot inspect any logfile when --stdout was used
if {[have_cmd_arg --stdout]} { return 0 }
if {[have_cmd_switch --stdout]} { return 0 }
# grep log output for the respective error message of the build system
if {[catch {
@ -270,7 +270,7 @@ 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 {[have_cmd_arg --stdout]} { return 0 }
if {[have_cmd_switch --stdout]} { return 0 }
# grep log output for the respective error message
if {[catch {
@ -297,7 +297,7 @@ set make_jobs 2
foreach_cmdline_arg j { global make_jobs; set make_jobs $j }
# present help if explicitly requested
if {[have_cmd_arg --help]} { help; exit 0 }
if {[have_cmd_switch --help]} { help; exit 0 }
#
# Handle platform-kernel combinations by adding to targets
@ -357,14 +357,14 @@ puts "make -j : $make_jobs"
# command-line arguments.
#
if {[file exists $test_dir] && ![have_cmd_arg --force] &&
![have_cmd_arg --keep]} {
if {[file exists $test_dir] && ![have_cmd_switch --force] &&
![have_cmd_switch --keep]} {
puts stderr "Error: test directory $test_dir already exists"
exit -3
}
if {[have_cmd_arg --force]} { wipe_test_dir }
if {[have_cmd_switch --force]} { wipe_test_dir }
proc append_run_opt { build_conf } {
@ -391,7 +391,7 @@ foreach arch $architectures {
set build_dir [build_dir $arch]
set build_conf [file join $build_dir etc build.conf]
if {[have_cmd_arg --keep] && [file exists $build_dir]} {
if {[have_cmd_switch --keep] && [file exists $build_dir]} {
append_run_opt $build_conf
continue
}
@ -416,7 +416,7 @@ foreach arch $architectures {
exec echo "MAKE += -j$make_jobs" >> $build_conf
# optionally enable ccache
if {[have_cmd_arg --enable-ccache]} {
if {[have_cmd_switch --enable-ccache]} {
set tools_conf [file join $build_dir etc tools.conf]
exec echo "CUSTOM_CC = ccache \$(CROSS_DEV_PREFIX)gcc" >> $tools_conf
exec echo "CUSTOM_CXX = ccache \$(CROSS_DEV_PREFIX)g++" >> $tools_conf
@ -507,7 +507,7 @@ foreach arch $architectures {
}
}
if {[have_cmd_arg --skip-clean-rules]} continue
if {[have_cmd_switch --skip-clean-rules]} continue
# execute and validate cleanall rule
foreach target $targets {

View File

@ -9,7 +9,7 @@
##
# Return true if command-line switch was specified
#
proc have_cmd_arg { arg_name } {
proc have_cmd_switch { arg_name } {
global argv
return [expr [lsearch $argv $arg_name] >= 0]
}
@ -405,22 +405,22 @@ foreach path [array names selected] {
}
if {[have_cmd_arg --labels]} {
if {[have_cmd_switch --labels]} {
foreach n [lsort [array names labels]] {
puts "$n\t$labels($n)" } }
if {[have_cmd_arg --nodes]} {
if {[have_cmd_switch --nodes]} {
foreach n [lsort [array names selected]] {
puts "$n" } }
if {[have_cmd_arg --references]} {
if {[have_cmd_switch --references]} {
foreach n [lsort [array names references]] {
puts "$n\t$references($n)" } }
if {[have_cmd_arg --dot-graph]} {
if {[have_cmd_switch --dot-graph]} {
puts "digraph {"
puts { rankdir=LR; nodesep=0.01;}
puts { node[shape=polygon, height=0, color=gray, fontsize=12, margin="0.1,0.01"];}

View File

@ -224,7 +224,7 @@ proc _depot_auto_update { archives } {
append cmd "DEPOT_DIR=[depot_dir] "
append cmd "UPDATE_VERSIONS=1 FORCE=1 REBUILD= "
if {[have_cmd_arg --ccache]} {
if {[have_cmd_switch --ccache]} {
append cmd "CCACHE=1 " }
set make_j_arg ""
@ -252,7 +252,7 @@ proc _collect_from_depot { archives } {
incr _collect_from_depot_nesting_level
# fill depot with up-to-date content if --depot-auto-update is enabled
if {[have_cmd_arg --depot-auto-update]} {
if {[have_cmd_switch --depot-auto-update]} {
if {$_collect_from_depot_nesting_level == 1} {
_depot_auto_update $archives } }

View File

@ -9,9 +9,9 @@
##
# Check if the uImage should be gzipped
#
proc image_uboot_use_no_gzip { } { return [have_cmd_arg --image-uboot-no-gzip] }
proc image_uboot_use_no_gzip { } { return [have_cmd_switch --image-uboot-no-gzip] }
proc image_uboot_use_fit { } { return [have_cmd_arg --image-uboot-fit] }
proc image_uboot_use_fit { } { return [have_cmd_switch --image-uboot-fit] }
##
@ -24,7 +24,7 @@ proc image_uboot_use_fit { } { return [have_cmd_arg --image-uboot-fit] }
# it disabled.
#
proc image_uboot_gzip_opt { } {
if {[have_cmd_arg --image-uboot-gzip-best]} {
if {[have_cmd_switch --image-uboot-gzip-best]} {
return "--best"
} else {
return "--fast"

View File

@ -27,7 +27,7 @@ proc load_ipxe_base_dir { } { return [cmd_arg --load-ipxe-base-dir ""] }
proc load_ipxe_boot_dir { } { return [cmd_arg --load-ipxe-boot-dir ""] }
proc load_ipxe_lighttpd { } { return [have_cmd_arg --load-ipxe-lighttpd] }
proc load_ipxe_lighttpd { } { return [have_cmd_switch --load-ipxe-lighttpd] }
proc load_ipxe_lighttpd_port { } { return [cmd_arg --load-ipxe-lighttpd-port 8080] }

View File

@ -29,10 +29,10 @@ proc load_tftp_base_dir { } { return [cmd_arg --load-tftp-base-dir ""] }
proc load_tftp_offset_dir { } { return [cmd_arg --load-tftp-offset-dir ""] }
proc load_tftp_use_absolute { } { return [have_cmd_arg --load-tftp-absolute] }
proc load_tftp_use_absolute { } { return [have_cmd_switch --load-tftp-absolute] }
proc load_tftp_copy_files { } { return [have_cmd_arg --load-tftp-copy-files] }
proc load_tftp_copy_files { } { return [have_cmd_switch --load-tftp-copy-files] }
##

View File

@ -29,7 +29,7 @@ proc log_amt_timeout { } {
}
proc log_amt_skip_test { } {
return [have_cmd_arg --log-amt-skip-test]
return [have_cmd_switch --log-amt-skip-test]
}
@ -87,7 +87,7 @@ proc run_log { wait_for_re timeout_value } {
set amt_log ".*session authentication"
}
if {[have_cmd_arg --log-amt-filter]} {
if {[have_cmd_switch --log-amt-filter]} {
set amt_cmd "$amt_cmd | [log_amt_filter]"
}

View File

@ -43,7 +43,7 @@ proc run_log { wait_for_re timeout_value } {
# i.e., lets only ASCII characters through.
#
set serial_cmd_chain [log_serial_cmd]
if {[have_cmd_arg --log-serial-filter]} {
if {[have_cmd_switch --log-serial-filter]} {
set serial_cmd_chain "$serial_cmd_chain | [log_serial_filter]"
}

View File

@ -71,7 +71,7 @@ proc build {targets} {
if {[llength $targets] == 0} return
if {[have_cmd_arg --skip-build]} return
if {[have_cmd_switch --skip-build]} return
regsub -all {\s\s+} $targets " " targets
puts "building targets: $targets"
@ -384,7 +384,7 @@ match_max -d 40000
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
if {$wait_for_re == "forever"} {
assert {![have_cmd_arg --autopilot]}
assert {![have_cmd_switch --autopilot]}
}
#
@ -593,16 +593,17 @@ proc compare_output_to { good } {
##
# Return true if command-line switch was specified
#
proc have_cmd_arg { arg_name } {
proc have_cmd_switch { arg_name } {
global argv
return [expr [lsearch $argv $arg_name] >= 0]
}
##
# Return true if command-line switch was specified
#
proc get_cmd_switch { arg_name } {
return [have_cmd_arg $arg_name]
return [have_cmd_switch $arg_name]
}
@ -890,7 +891,7 @@ proc wait_for_output { wait_for_re timeout_value running_spawn_id } {
proc remove_genode_dir { } {
global env
if {![have_cmd_arg --preserve-genode-dir]} {
if {![have_cmd_switch --preserve-genode-dir]} {
exec rm -rf [run_dir]/genode
}
}