Test generated events match documentation

The test ensures that the generated documentation of emulation events is
kept up to date. To locate the events.md file, the source root path is
now exported to tests in OVNI_SOURCE_DIR.

The "Built on ..." message with the date of the build is removed as
otherwise it will always make the comparison fail.
This commit is contained in:
Rodrigo Arias 2024-01-29 13:03:41 +01:00
parent 402ea82847
commit df0e7b2bd4
3 changed files with 14 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC) # Copyright (c) 2022-2024 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
test_emu(flush-overhead.c DISABLED) test_emu(flush-overhead.c DISABLED)
@ -26,3 +26,4 @@ test_emu(thread-free-isready.c)
test_emu(flush-tmpdir.c MP DRIVER "flush-tmpdir.driver.sh") test_emu(flush-tmpdir.c MP DRIVER "flush-tmpdir.driver.sh")
test_emu(tmpdir-metadata.c MP DRIVER "tmpdir-metadata.driver.sh") test_emu(tmpdir-metadata.c MP DRIVER "tmpdir-metadata.driver.sh")
test_emu(dummy.c NAME "ovniver" DRIVER "ovniver.driver.sh") test_emu(dummy.c NAME "ovniver" DRIVER "ovniver.driver.sh")
test_emu(dummy.c NAME "match-doc-events" DRIVER "match-doc-events.sh")

View File

@ -0,0 +1,8 @@
docs="$OVNI_SOURCE_DIR/doc/user/emulation/events.md"
(
cat "$docs" | grep -v '^Built on' > old.md
ovnievents | grep -v '^Built on' > new.md
diff -up old.md new.md
)

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC) # Copyright (c) 2022-2024 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
include(CMakeParseArguments) include(CMakeParseArguments)
@ -49,6 +49,9 @@ function(ovni_test source)
list(APPEND OVNI_TEST_ENV list(APPEND OVNI_TEST_ENV
"OVNI_CONFIG_DIR=${CMAKE_SOURCE_DIR}/cfg") "OVNI_CONFIG_DIR=${CMAKE_SOURCE_DIR}/cfg")
list(APPEND OVNI_TEST_ENV
"OVNI_SOURCE_DIR=${CMAKE_SOURCE_DIR}")
if(OVNI_TEST_SORT) if(OVNI_TEST_SORT)
list(APPEND OVNI_TEST_ENV "OVNI_DO_SORT=1") list(APPEND OVNI_TEST_ENV "OVNI_DO_SORT=1")
endif() endif()