diff --git a/list-linuxcnc-manifest-sources.sh b/list-linuxcnc-manifest-sources.sh index 2771058..b45a624 100755 --- a/list-linuxcnc-manifest-sources.sh +++ b/list-linuxcnc-manifest-sources.sh @@ -44,13 +44,20 @@ case "$output_mode" in esac seen_sources=() -while IFS=: read -r group path note; do - case "$group" in +manifest_line_number=0 +while IFS= read -r manifest_line || [[ -n "$manifest_line" ]]; do + manifest_line_number=$((manifest_line_number + 1)) + case "$manifest_line" in ""|\#*) continue ;; esac + IFS=: read -r group path note extra <<<"$manifest_line" + if [[ -z "$group" || -z "$path" || -z "$note" || -n "${extra:-}" ]]; then + echo "bad manifest line $manifest_line_number: $manifest_line" >&2 + exit 1 + fi if ! contains_group "$allowed_groups" "$group"; then echo "unknown manifest group: $group" >&2 exit 1 diff --git a/test-all-native.sh b/test-all-native.sh index 3d544bb..d1963d1 100755 --- a/test-all-native.sh +++ b/test-all-native.sh @@ -1013,6 +1013,38 @@ for script in \ fi done +printf 'core:src/emc/rs274ngc/interp_arc.cc\n' >"$bad_line_manifest" +if ./list-linuxcnc-manifest-sources.sh \ + "$bad_line_manifest" \ + core \ + relative \ + core \ + core \ + "missing manifest source" >"$bad_line_log" 2>&1; then + echo "common manifest source lister accepted bad manifest line" >&2 + exit 1 +fi +if ! grep -F "bad manifest line 1: core:src/emc/rs274ngc/interp_arc.cc" "$bad_line_log" >/dev/null; then + echo "common manifest source lister did not report bad manifest line clearly" >&2 + sed -n '1,20p' "$bad_line_log" >&2 + exit 1 +fi +for script in \ + list-linuxcnc-source-manifest-sources.sh \ + test-linuxcnc-source-syntax.sh \ + test-linuxcnc-source-objects.sh \ + test-linuxcnc-source-link.sh; do + if "./$script" "$bad_line_manifest" >"$bad_line_log" 2>&1; then + echo "$script accepted bad manifest line" >&2 + exit 1 + fi + if ! grep -F "bad manifest line 1: core:src/emc/rs274ngc/interp_arc.cc" "$bad_line_log" >/dev/null; then + echo "$script did not report bad manifest line clearly" >&2 + sed -n '1,20p' "$bad_line_log" >&2 + exit 1 + fi +done + ./list-linuxcnc-source-manifest-sources.sh "$manifest" core >/dev/null native_manifest_core=$(./list-linuxcnc-source-manifest-sources.sh "$manifest" core) grep -Fx "src/emc/rs274ngc/interp_arc.cc" <<<"$native_manifest_core" >/dev/null