From 03b638408d25a7b485608281fcd19df961a3aa11 Mon Sep 17 00:00:00 2001 From: CismonX Date: Sat, 22 Mar 2025 11:38:59 +0800 Subject: [PATCH] test: more comments and log output --- tests/check_lib.c | 1 + tests/testsuite.at | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/check_lib.c b/tests/check_lib.c index cd571b1..28c0b64 100644 --- a/tests/check_lib.c +++ b/tests/check_lib.c @@ -48,6 +48,7 @@ dispatch_subcmds ( char *argv[] ) { if (--argc < 1) { + log_puts("subcmd not given"); return -1; } char const *cmd = *(++argv); diff --git a/tests/testsuite.at b/tests/testsuite.at index 1786d73..3ed5605 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -9,6 +9,11 @@ dnl AT_INIT +dnl +dnl Fail or skip the current test. +dnl +dnl The status codes are defined by Autotest. +dnl m4_define([ATX_FAIL], [exit 99]) m4_define([ATX_SKIP], [exit 77]) @@ -72,10 +77,16 @@ m4_define([ATX_RUN], [ m4_map([ATX_RUN_ONE], m4_split([$1], m4_newline([+]))) ]) +dnl +dnl ATX_CHECK_SIMPLE(script) +dnl m4_define([ATX_CHECK_SIMPLE], [ AT_CHECK([$1], , [ignore], [ignore]) ]) +dnl +dnl ATX_CHECK_LIB(script) +dnl m4_define([ATX_CHECK_LIB], [ ATX_CHECK_SIMPLE([ ATX_FEAT_PREREQ([bookmarkfs-util]) @@ -83,6 +94,8 @@ m4_define([ATX_CHECK_LIB], [ ]) ]) +dnl -- Helper functions -- + AT_TEST_HELPER_FN([rand_u64_hex], , , [ echo $(od -vAn -N8 -tx8 /dev/urandom | tr -d ' ') ]) @@ -102,6 +115,8 @@ AT_TEST_HELPER_FN([prng_seed], , , [ echo $seed_1$seed_2$seed_3$seed_4 ]) +dnl -- Test groups -- + AT_BANNER([The Utility Library]) m4_include([lib_hash.at]) m4_include([lib_prng.at])