参考所有分组,完成尽量多的内容:收紧 CMake 源列表缺失守卫,结论测试通过
This commit is contained in:
@@ -18,6 +18,7 @@ relative_prefix=${3:-}
|
|||||||
|
|
||||||
awk -v set_name="$set_name" -v append_name="$append_name" -v relative_prefix="$relative_prefix" '
|
awk -v set_name="$set_name" -v append_name="$append_name" -v relative_prefix="$relative_prefix" '
|
||||||
$0 ~ "^[[:space:]]*set\\(" set_name "([[:space:]]|$)" {
|
$0 ~ "^[[:space:]]*set\\(" set_name "([[:space:]]|$)" {
|
||||||
|
found_set = 1
|
||||||
in_set = 1
|
in_set = 1
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
@@ -26,6 +27,7 @@ awk -v set_name="$set_name" -v append_name="$append_name" -v relative_prefix="$r
|
|||||||
next
|
next
|
||||||
}
|
}
|
||||||
$0 ~ "^[[:space:]]*list\\(APPEND " append_name "([[:space:]]|$)" {
|
$0 ~ "^[[:space:]]*list\\(APPEND " append_name "([[:space:]]|$)" {
|
||||||
|
found_append = 1
|
||||||
in_append = 1
|
in_append = 1
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
@@ -46,4 +48,14 @@ awk -v set_name="$set_name" -v append_name="$append_name" -v relative_prefix="$r
|
|||||||
}
|
}
|
||||||
print line
|
print line
|
||||||
}
|
}
|
||||||
|
END {
|
||||||
|
if (!found_set) {
|
||||||
|
print "missing CMake source set: " set_name > "/dev/stderr"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
if (!found_append) {
|
||||||
|
print "missing CMake append source set: " append_name > "/dev/stderr"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
' core/CMakeLists.txt
|
' core/CMakeLists.txt
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ relative_prefix=${2:-}
|
|||||||
|
|
||||||
awk -v set_name="$set_name" -v relative_prefix="$relative_prefix" '
|
awk -v set_name="$set_name" -v relative_prefix="$relative_prefix" '
|
||||||
$0 ~ "^[[:space:]]*set\\(" set_name "([[:space:]]|$)" {
|
$0 ~ "^[[:space:]]*set\\(" set_name "([[:space:]]|$)" {
|
||||||
|
found_set = 1
|
||||||
in_list = 1
|
in_list = 1
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
@@ -36,4 +37,10 @@ awk -v set_name="$set_name" -v relative_prefix="$relative_prefix" '
|
|||||||
}
|
}
|
||||||
print line
|
print line
|
||||||
}
|
}
|
||||||
|
END {
|
||||||
|
if (!found_set) {
|
||||||
|
print "missing CMake source set: " set_name > "/dev/stderr"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
' core/CMakeLists.txt
|
' core/CMakeLists.txt
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ missing_api_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_rs274_api_proje
|
|||||||
missing_core_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_core_source.XXXXXX.log")
|
missing_core_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_core_source.XXXXXX.log")
|
||||||
missing_bridge_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_bridge_smoke_project_source.XXXXXX.log")
|
missing_bridge_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_bridge_smoke_project_source.XXXXXX.log")
|
||||||
escaped_project_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_escaped_project_source.XXXXXX.log")
|
escaped_project_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_escaped_project_source.XXXXXX.log")
|
||||||
|
missing_cmake_set_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_cmake_set.XXXXXX.log")
|
||||||
|
missing_cmake_append_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_cmake_append.XXXXXX.log")
|
||||||
missing_support_object_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_linuxcnc_support_object.XXXXXX.log")
|
missing_support_object_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_linuxcnc_support_object.XXXXXX.log")
|
||||||
missing_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source_manifest.XXXXXX.txt")
|
missing_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source_manifest.XXXXXX.txt")
|
||||||
missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source.XXXXXX.log")
|
missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source.XXXXXX.log")
|
||||||
@@ -59,6 +61,8 @@ cleanup_native_test_temps() {
|
|||||||
"$missing_core_source_log" \
|
"$missing_core_source_log" \
|
||||||
"$missing_bridge_source_log" \
|
"$missing_bridge_source_log" \
|
||||||
"$escaped_project_source_log" \
|
"$escaped_project_source_log" \
|
||||||
|
"$missing_cmake_set_log" \
|
||||||
|
"$missing_cmake_append_log" \
|
||||||
"$missing_support_object_log" \
|
"$missing_support_object_log" \
|
||||||
"$missing_source_manifest" \
|
"$missing_source_manifest" \
|
||||||
"$missing_source_log" \
|
"$missing_source_log" \
|
||||||
@@ -174,6 +178,8 @@ for forbidden_manual_cleanup in \
|
|||||||
'rm -f "$missing_core_source_log"' \
|
'rm -f "$missing_core_source_log"' \
|
||||||
'rm -f "$missing_bridge_source_log"' \
|
'rm -f "$missing_bridge_source_log"' \
|
||||||
'rm -f "$escaped_project_source_log"' \
|
'rm -f "$escaped_project_source_log"' \
|
||||||
|
'rm -f "$missing_cmake_set_log"' \
|
||||||
|
'rm -f "$missing_cmake_append_log"' \
|
||||||
'rm -f "$missing_support_object_log"' \
|
'rm -f "$missing_support_object_log"' \
|
||||||
'rm -f "$missing_source_manifest" "$missing_source_log"' \
|
'rm -f "$missing_source_manifest" "$missing_source_log"' \
|
||||||
'rm -f "$kinematics_unknown_filter_log"' \
|
'rm -f "$kinematics_unknown_filter_log"' \
|
||||||
@@ -214,9 +220,31 @@ fi
|
|||||||
grep -F 'exec 9>"${TMPDIR:-/tmp}/cnc_sim_rs274_source_link.lock"' test-linuxcnc-source-link.sh >/dev/null
|
grep -F 'exec 9>"${TMPDIR:-/tmp}/cnc_sim_rs274_source_link.lock"' test-linuxcnc-source-link.sh >/dev/null
|
||||||
grep -F "flock 9" test-linuxcnc-source-link.sh >/dev/null
|
grep -F "flock 9" test-linuxcnc-source-link.sh >/dev/null
|
||||||
grep -F "missing LinuxCNC support object" list-linuxcnc-source-support-objects.sh >/dev/null
|
grep -F "missing LinuxCNC support object" list-linuxcnc-source-support-objects.sh >/dev/null
|
||||||
|
grep -F 'missing CMake source set: " set_name' list-cmake-set-sources.sh >/dev/null
|
||||||
|
grep -F 'missing CMake append source set: " append_name' list-cmake-set-plus-append-sources.sh >/dev/null
|
||||||
grep -F 'echo "$missing_path_message: $path"' list-filtered-existing-paths.sh >/dev/null
|
grep -F 'echo "$missing_path_message: $path"' list-filtered-existing-paths.sh >/dev/null
|
||||||
grep -F 'project source path must stay project-relative: $path' list-filtered-existing-paths.sh >/dev/null
|
grep -F 'project source path must stay project-relative: $path' list-filtered-existing-paths.sh >/dev/null
|
||||||
grep -F "build LinuxCNC first or set LINUXCNC_ROOT to a built tree" list-linuxcnc-source-support-objects.sh >/dev/null
|
grep -F "build LinuxCNC first or set LINUXCNC_ROOT to a built tree" list-linuxcnc-source-support-objects.sh >/dev/null
|
||||||
|
if ./list-cmake-set-sources.sh does_not_exist_cmake_set >"$missing_cmake_set_log" 2>&1; then
|
||||||
|
echo "CMake source-set lister accepted a missing set" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! grep -F "missing CMake source set: does_not_exist_cmake_set" "$missing_cmake_set_log" >/dev/null; then
|
||||||
|
echo "CMake source-set lister did not report missing sets clearly" >&2
|
||||||
|
sed -n '1,20p' "$missing_cmake_set_log" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ./list-cmake-set-plus-append-sources.sh \
|
||||||
|
cnc_sim_core_sources \
|
||||||
|
does_not_exist_append_set >"$missing_cmake_append_log" 2>&1; then
|
||||||
|
echo "combined CMake source-set lister accepted a missing append set" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! grep -F "missing CMake append source set: does_not_exist_append_set" "$missing_cmake_append_log" >/dev/null; then
|
||||||
|
echo "combined CMake source-set lister did not report missing append sets clearly" >&2
|
||||||
|
sed -n '1,20p' "$missing_cmake_append_log" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if printf '../core/src/canon_event_sink.cpp\n' | ./list-filtered-existing-paths.sh \
|
if printf '../core/src/canon_event_sink.cpp\n' | ./list-filtered-existing-paths.sh \
|
||||||
--project-relative \
|
--project-relative \
|
||||||
"" \
|
"" \
|
||||||
|
|||||||
Reference in New Issue
Block a user