From: Eugene Syromyatnikov Date: Tue, 25 Apr 2017 02:20:50 +0000 (+0200) Subject: tests: move generated common header comment into a variable X-Git-Tag: v4.17~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b97ac5df12410a6cbb7f1ab4bb176a7c756ceb7c;p=strace tests: move generated common header comment into a variable * tests/gen_tests.sh: Move generated file header comment into a variable, use it in all cases. --- diff --git a/tests/gen_tests.sh b/tests/gen_tests.sh index 89108e8a..ac3b7e15 100755 --- a/tests/gen_tests.sh +++ b/tests/gen_tests.sh @@ -63,19 +63,21 @@ while read -r name args; do { [ "$match" = "$name" ] || continue fi + hdr="\ +#!/bin/sh -efu +# Generated by $0 from $input; do not edit." + case "$args" in +*) cat <<-EOF - #!/bin/sh -efu - # Generated by $0 from $input; do not edit. + $hdr . "\${srcdir=.}/${args#+}" EOF ;; ''|-*) cat <<-EOF - #!/bin/sh -efu - # Generated by $0 from $input; do not edit. + $hdr . "\${srcdir=.}/init.sh" run_strace_match_diff $args EOF @@ -83,8 +85,7 @@ while read -r name args; do { *) cat <<-EOF - #!/bin/sh -efu - # Generated by $0 from $input; do not edit. + $hdr . "\${srcdir=.}/init.sh" $args EOF