mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 23:45:27 +00:00
[#3732] Meson: Report shell tests as xml in builddir by default
This commit is contained in:
@@ -37,7 +37,7 @@ main(int, char* argv[]) {
|
|||||||
// Determine some paths.
|
// Determine some paths.
|
||||||
Path const this_binary(argv[0]);
|
Path const this_binary(argv[0]);
|
||||||
string ancestor_path(this_binary.parentPath());
|
string ancestor_path(this_binary.parentPath());
|
||||||
// TODO: remove kludgy if-condition when autotools gets removed.
|
// TODO: remove kludgy if-condition when autotools are removed.
|
||||||
if (Path(ancestor_path).filename() == ".libs") {
|
if (Path(ancestor_path).filename() == ".libs") {
|
||||||
ancestor_path = Path(ancestor_path).parentPath();
|
ancestor_path = Path(ancestor_path).parentPath();
|
||||||
}
|
}
|
||||||
|
@@ -27,5 +27,5 @@ configure_file(
|
|||||||
configure_file(
|
configure_file(
|
||||||
input: 'xml_reporting_test_lib.sh.in',
|
input: 'xml_reporting_test_lib.sh.in',
|
||||||
output: 'xml_reporting_test_lib.sh',
|
output: 'xml_reporting_test_lib.sh',
|
||||||
copy: true,
|
configuration: configuration_data({'TOP_BUILD_DIR': TOP_BUILD_DIR}),
|
||||||
)
|
)
|
||||||
|
@@ -14,8 +14,8 @@ set -eu
|
|||||||
|
|
||||||
# Add an entry to the XML test report.
|
# Add an entry to the XML test report.
|
||||||
report_test_result_in_xml() {
|
report_test_result_in_xml() {
|
||||||
# If GTEST_OUTPUT is not defined...
|
# TODO: Remove this if-statemenet when autotools are removed.
|
||||||
if ! test -n "${GTEST_OUTPUT+x}"; then
|
if test ! -d "@TOP_BUILD_DIR@"; then
|
||||||
# There is nowhere to report.
|
# There is nowhere to report.
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -32,12 +32,18 @@ report_test_result_in_xml() {
|
|||||||
test_suite=$(printf '%s' "${test_name}" | cut -d '.' -f 1)
|
test_suite=$(printf '%s' "${test_name}" | cut -d '.' -f 1)
|
||||||
test_case=$(printf '%s' "${test_name}" | cut -d '.' -f 2-)
|
test_case=$(printf '%s' "${test_name}" | cut -d '.' -f 2-)
|
||||||
|
|
||||||
# Strip the 'xml:' at the start of GTEST_OUTPUT if it is there.
|
# If GTEST_OUTPUT is defined...
|
||||||
xml="${GTEST_OUTPUT}"
|
if test -n "${GTEST_OUTPUT+x}"; then
|
||||||
if test "$(printf '%s' "${xml}" | cut -c 1-4)" = 'xml:'; then
|
# Strip the 'xml:' at the start of GTEST_OUTPUT if it is there.
|
||||||
xml=$(printf '%s' "${xml}" | cut -c 5-)
|
xml="${GTEST_OUTPUT}"
|
||||||
|
if test "$(printf '%s' "${xml}" | cut -c 1-4)" = 'xml:'; then
|
||||||
|
xml=$(printf '%s' "${xml}" | cut -c 5-)
|
||||||
|
fi
|
||||||
|
xml="${xml}/${test_suite}.sh.xml"
|
||||||
|
else
|
||||||
|
# Report in the same place as the default meson test logs.
|
||||||
|
xml="@TOP_BUILD_DIR@/meson-logs/${test_suite}.sh.xml"
|
||||||
fi
|
fi
|
||||||
xml="${xml}/${test_suite}.sh.xml"
|
|
||||||
|
|
||||||
# Convert to seconds, but keep the millisecond precision.
|
# Convert to seconds, but keep the millisecond precision.
|
||||||
duration=$(_calculate "${duration} / 1000.0")
|
duration=$(_calculate "${duration} / 1000.0")
|
||||||
|
Reference in New Issue
Block a user