tools: support --no-make-first option in "run-nm-test.sh"

Why? Because I often use a command line like

  $ ./tools/run-nm-test.sh -m src/libnm-client-impl/tests/test-nm-client -p /libnm/device-connection-compatibility

or even alias it to a one character command `x`.
Usually I want to do the rebuild, and as `make` is so slow, it
adds noticeable time running the command. Thus, sometimes I want
to modify the command, for which I have to edit the command from the
history, or toggle two separate commands.

Add a `-M` flag that can reverse the effect of an earlier `-m`.

An "enable" flag in general should just also have a "disable" flag.
This commit is contained in:
Thomas Haller
2022-01-17 17:39:39 +01:00
parent cb9ca67901
commit eda2c5ac48

View File

@@ -37,6 +37,7 @@ usage() {
echo " --no-libtool: when running with valgrind, the script tries automatically to"
echo " use libtool as necessary. This disables libtool usage"
echo " --make-first|-m: before running the test, make it (only works with autotools build)"
echo " --no-make-first|-M: disable --make-first option"
echo " --valgrind|-v: run under valgrind"
echo " --no-valgrind|-V: disable running under valgrind (overrides NMTST_USE_VALGRIND=1)"
echo " -d: set NMTST_DEBUG=d"
@@ -165,6 +166,10 @@ else
NMTST_MAKE_FIRST=1
shift
;;
--no-make-first|-M)
NMTST_MAKE_FIRST=0
shift
;;
"--valgrind"|-v)
NMTST_USE_VALGRIND=1
shift;