#!/usr/bin/env 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"
