From df0e7b2bd46d7b500326d6b2842532ee96e22948 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 29 Jan 2024 13:03:41 +0100 Subject: [PATCH] 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. --- test/emu/ovni/CMakeLists.txt | 3 ++- test/emu/ovni/match-doc-events.sh | 8 ++++++++ test/macros.cmake | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 test/emu/ovni/match-doc-events.sh diff --git a/test/emu/ovni/CMakeLists.txt b/test/emu/ovni/CMakeLists.txt index a77ad4e..9a5ed9f 100644 --- a/test/emu/ovni/CMakeLists.txt +++ b/test/emu/ovni/CMakeLists.txt @@ -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 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(tmpdir-metadata.c MP DRIVER "tmpdir-metadata.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") diff --git a/test/emu/ovni/match-doc-events.sh b/test/emu/ovni/match-doc-events.sh new file mode 100644 index 0000000..7824824 --- /dev/null +++ b/test/emu/ovni/match-doc-events.sh @@ -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 +) diff --git a/test/macros.cmake b/test/macros.cmake index 39e852c..507817a 100644 --- a/test/macros.cmake +++ b/test/macros.cmake @@ -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 include(CMakeParseArguments) @@ -49,6 +49,9 @@ function(ovni_test source) list(APPEND OVNI_TEST_ENV "OVNI_CONFIG_DIR=${CMAKE_SOURCE_DIR}/cfg") + list(APPEND OVNI_TEST_ENV + "OVNI_SOURCE_DIR=${CMAKE_SOURCE_DIR}") + if(OVNI_TEST_SORT) list(APPEND OVNI_TEST_ENV "OVNI_DO_SORT=1") endif()