mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
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>
21 lines
567 B
Bash
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
|