From b97ac5df12410a6cbb7f1ab4bb176a7c756ceb7c Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Tue, 25 Apr 2017 04:20:50 +0200 Subject: [PATCH] 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. --- tests/gen_tests.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 -- 2.50.1