linux/tools/verification/rvgen/tests/rvgen_container.t
Gabriele Monaco 36c1af42e7 verification/rvgen: Add selftests
The rvgen code generator needs validation to ensure it produces correct
monitor implementations from input specifications.

Add selftests with golden reference outputs covering all monitor classes
(DA, HA, LTL) and types (global, per_cpu, per_task, per_obj), including
optional features like descriptions and parent monitors. Container
generation and error handling (missing files, invalid specifications,
missing arguments) are also validated against expected output.

Acked-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Wen Yang <wen.yang@linux.dev>
Link: https://lore.kernel.org/r/20260723074534.43521-9-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
2026-07-31 16:27:44 +02:00

21 lines
567 B
Bash

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
source ../tests/engine.sh
test_begin
set_timeout 30s
# Help tests
check "verify container subcommand help" \
"$RVGEN container -h" 0 "model_name" "class"
check_and_compare_folder "container with description" \
"$RVGEN container -n test_container -D 'Test container for grouping monitors'" \
"test_container" "Writing the monitor into the directory test_container"
# Error handling tests
check "missing required model_name" \
"$RVGEN container" 2 "the following arguments are required: -n/--model_name"
test_end