mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
scripts: Support custom arguments to the test binary with dev_cli.sh
The dev container interface script (e.g. 'dev_cli.sh') now supports the following arguments syntax for running tests: `tests [--unit|--cargo|--all] [--libc musl|gnu] [-- [<test scripts args>] [-- [<test binary args>]]] ` In this way, we can pass custom arguments to the test binary (either "cargo test" or "performance-metrics") with our dev container script. For example: `$ ./dev_cli.sh tests --metrics -- -- --report-file /tmp/metrics.json --test-filter latency` `$ ./dev_cli.sh tests --integration -- --test-filter "test_serial" -- --nocapture --test-threads=1` Fixes: #3739 Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
hypervisor="kvm"
|
||||
test_filter=""
|
||||
test_binary_args=()
|
||||
|
||||
cmd_help() {
|
||||
echo ""
|
||||
@@ -28,12 +29,20 @@ process_common_args() {
|
||||
shift
|
||||
test_filter="$1"
|
||||
;;
|
||||
"--") {
|
||||
shift
|
||||
break
|
||||
} ;;
|
||||
*)
|
||||
;;
|
||||
echo "Unknown test scripts argument: $1. Please use '-- --help' for help."
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if [[ ! ("$hypervisor" = "kvm" || "$hypervisor" = "mshv") ]]; then
|
||||
die "Hypervisor value must be kvm or mshv"
|
||||
fi
|
||||
|
||||
test_binary_args="$@"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user