mutter/clutter/tests/interactive/meson/gen-test-unit-names.sh
Ting-Wei Lan 319500e4f3 tests: Fix warnings reported by shellcheck
This commit includes following fixes for a few shell scripts:

1. Follow the best practice of quoting variables everywhere unless they
   are used in places where word-splitting and globbing can never happen.

2. Replace `command` with $(command) because the latter is easier to use
   and read.

3. Don't use "$@" in places expecting a string because it is an array
   of strings instead of a single string.
2018-12-01 13:07:29 +00:00

15 lines
360 B
Bash
Executable File

#!/bin/sh
outputfile=$1
shift
echo '/* ** This file is autogenerated. Do not edit. ** */' > "$outputfile"
echo '' >> "$outputfile"
echo 'const char *test_unit_names[] = {' >> "$outputfile"
for test_source_file in "$@"; do
echo " \"$(echo "$test_source_file" | sed 's/.*\(test-[a-z0-9\-]\+\)\.c/\1/')\"," >> "$outputfile"
done
echo '};' >> "$outputfile"