Skip to contentSkip to conversation

rvgen/tests: cover an invalid monitor type

PATCH Superseded Chaosheng Qu 1 participant 1 message Nov 12

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 rvgen/tests: cover an invalid monitor type

From 0c12bf144a7267be93a9e45d872eaaf0c8a2d841 Mon Sep 17 00:00:00 2001
From: Chaosheng Qu <[email protected]>
Date: Thu, 12 Nov 2026 14:26:11 +0800
Subject: [PATCH 2/2] rvgen/tests: cover an invalid monitor type

Add a rejection test next to the other ones, so the new check is exercised. Without it the command exits 0 and leaves a generated tree behind, so the test fails on both the exit code and the message.

Assisted-by LLM
---
 tools/verification/rvgen/tests/rvgen_monitor.t | 4 ++++
 1 file changed, 4 insertions(+)
tools/verification/rvgen/tests/rvgen_monitor.t +4 -0
index 5f2562600..2a48a7b54 100644
@@ -64,6 +64,10 @@ check "invalid monitor class" \
 	"$RVGEN monitor -c invalid -s tests/specs/test_da.dot -t per_cpu" 1 \
 	"Unknown monitor class" "Traceback (most recent call last)"
 
+check "invalid monitor type" \
+	"$RVGEN monitor -c da -s tests/specs/test_da.dot -t invalid" 2 \
+	"invalid choice: 'invalid'" "Traceback (most recent call last)"
+
 check "missing dot file" \
 	"$RVGEN monitor -c da -s tests/specs/nonexistent.dot -t per_cpu" 1 \
 	"No such file or directory" "Traceback (most recent call last)"
Signature · 1 line
2.43.0