Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx> --- scripts/mkstandalone.sh | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index 6ced8e5970ef..764c42d12e3b 100755 --- a/scripts/mkstandalone.sh +++ b/scripts/mkstandalone.sh @@ -7,19 +7,6 @@ fi source config.mak source scripts/functions.bash -one_kernel="$1" -[ "$one_kernel" ] && one_kernel_base=$(basename $one_kernel) -one_testname="$2" -if [ -n "$one_kernel" ] && [ ! -f $one_kernel ]; then - echo "$one_kernel doesn't exist" - exit 1 -elif [ -n "$one_kernel" ] && [ -z "$one_testname" ]; then - one_testname="${one_kernel_base%.*}" -fi - -unittests=$TEST_DIR/unittests.cfg -mkdir -p tests - escape () { for arg in "${@}"; do @@ -90,11 +77,21 @@ function mkstandalone() return 0 } -trap 'rm -f $cfg; exit 1' HUP INT TERM trap 'rm -f $cfg' EXIT cfg=$(mktemp) -if [ -n "$one_testname" ]; then +unittests=$TEST_DIR/unittests.cfg +one_kernel="$1" + +if [ "$one_kernel" ]; then + [ ! -f $one_kernel ] && { + echo "$one_kernel doesn't exist" + exit 1 + } + + one_kernel_base=$(basename $one_kernel) + one_testname="${2:-${one_kernel_base%.*}}" + if grep -q "\[$one_testname\]" $unittests; then sed -n "/\\[$one_testname\\]/,/^\\[/p" $unittests \ | awk '!/^\[/ || NR == 1' > $cfg @@ -106,4 +103,6 @@ else cp -f $unittests $cfg fi +mkdir -p tests + for_each_unittest $cfg mkstandalone -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html