From 6b0b5bfbbd1c43d95cbaf4a839feab2ba383a1e9 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 13 Nov 2023 10:26:32 +0100 Subject: [PATCH] Add require test for missing models --- test/emu/nosv/CMakeLists.txt | 2 ++ test/emu/nosv/require-missing.c | 23 +++++++++++++++++++ test/emu/ovni/CMakeLists.txt | 4 ++-- .../ovni/{require.c => require-bad-version.c} | 0 .../ovni/{no-require.c => require-compat.c} | 0 5 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 test/emu/nosv/require-missing.c rename test/emu/ovni/{require.c => require-bad-version.c} (100%) rename test/emu/ovni/{no-require.c => require-compat.c} (100%) diff --git a/test/emu/nosv/CMakeLists.txt b/test/emu/nosv/CMakeLists.txt index c3c46ad..4e39fca 100644 --- a/test/emu/nosv/CMakeLists.txt +++ b/test/emu/nosv/CMakeLists.txt @@ -11,3 +11,5 @@ test_emu(switch-same-type.c) test_emu(multiple-segment.c MP NPROC 4) test_emu(task-pause-from-submit.c) test_emu(same-subsystem.c) +test_emu(require-missing.c SHOULD_FAIL + REGEX "model nosv not enabled for event") diff --git a/test/emu/nosv/require-missing.c b/test/emu/nosv/require-missing.c new file mode 100644 index 0000000..f1e1e06 --- /dev/null +++ b/test/emu/nosv/require-missing.c @@ -0,0 +1,23 @@ +/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) + * SPDX-License-Identifier: GPL-3.0-or-later */ + +#include +#include "instr_nosv.h" + +/* Test the emulator aborts if a stream contains require models but they don't + * cover all the events (in this case nosv). */ + +int +main(void) +{ + instr_start(0, 1); + + /* Don't enable nosv model via instr_nosv_init() */ + + /* Emit a nosv event */ + instr_nosv_type_create(666); + + instr_end(); + + return 0; +} diff --git a/test/emu/ovni/CMakeLists.txt b/test/emu/ovni/CMakeLists.txt index a3a1cb5..f699746 100644 --- a/test/emu/ovni/CMakeLists.txt +++ b/test/emu/ovni/CMakeLists.txt @@ -18,6 +18,6 @@ test_emu(sort-cpus-by-loom.c MP) test_emu(sort-cpus-by-rank.c MP) test_emu(tracedir-subdir.c MP DRIVER "tracedir-subdir.driver.sh") test_emu(empty-stream.c SHOULD_FAIL REGEX "model_ovni_finish: thread .* is not dead") -test_emu(require.c SHOULD_FAIL REGEX "unsupported ovni model version (want 666.66.6, have .*)") -test_emu(no-require.c REGEX "loading trace in compatibility mode") +test_emu(require-bad-version.c SHOULD_FAIL REGEX "unsupported ovni model version (want 666.66.6, have .*)") +test_emu(require-compat.c REGEX "loading trace in compatibility mode") test_emu(thread-crash.c SHOULD_FAIL REGEX "incomplete stream") diff --git a/test/emu/ovni/require.c b/test/emu/ovni/require-bad-version.c similarity index 100% rename from test/emu/ovni/require.c rename to test/emu/ovni/require-bad-version.c diff --git a/test/emu/ovni/no-require.c b/test/emu/ovni/require-compat.c similarity index 100% rename from test/emu/ovni/no-require.c rename to test/emu/ovni/require-compat.c