aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/npcm7xx_watchdog_timer-test.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2024-01-15 08:02:23 +0100
committerThomas Huth <thuth@redhat.com>2024-01-16 07:24:08 +0100
commitd9e2da0ccc5b636afc632ba9cb95d83885e2d8dc (patch)
treee2ef15f59fe244cfc0caf3dd86c2043fd42f1fbd /tests/qtest/npcm7xx_watchdog_timer-test.c
parentcfae0537049d10e84a01cf9ce3e2d3833fd8e92d (diff)
downloadqemu-d9e2da0ccc5b636afc632ba9cb95d83885e2d8dc.zip
qemu-d9e2da0ccc5b636afc632ba9cb95d83885e2d8dc.tar.gz
qemu-d9e2da0ccc5b636afc632ba9cb95d83885e2d8dc.tar.bz2
tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default
The test_prescaler() part in the npcm7xx_watchdog_timer test is quite repetitive, testing all possible combinations of the WTCLK and WTIS bitfields. Since each test spins up a new instance of QEMU, this is rather an expensive test, especially on loaded host systems. For the normal quick test mode, it should be sufficient to test the corner settings of these fields (i.e. 0 and 3), so we can speed up this test in the default mode quite a bit. Message-ID: <20240115070223.30178-1-thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/npcm7xx_watchdog_timer-test.c')
-rw-r--r--tests/qtest/npcm7xx_watchdog_timer-test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/qtest/npcm7xx_watchdog_timer-test.c b/tests/qtest/npcm7xx_watchdog_timer-test.c
index 4773a67..981b853 100644
--- a/tests/qtest/npcm7xx_watchdog_timer-test.c
+++ b/tests/qtest/npcm7xx_watchdog_timer-test.c
@@ -172,9 +172,10 @@ static void test_reset_action(gconstpointer watchdog)
static void test_prescaler(gconstpointer watchdog)
{
const Watchdog *wd = watchdog;
+ int inc = g_test_quick() ? 3 : 1;
- for (int wtclk = 0; wtclk < 4; ++wtclk) {
- for (int wtis = 0; wtis < 4; ++wtis) {
+ for (int wtclk = 0; wtclk < 4; wtclk += inc) {
+ for (int wtis = 0; wtis < 4; wtis += inc) {
QTestState *qts = qtest_init("-machine quanta-gsj");
qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic");