test: more comments and log output

This commit is contained in:
CismonX 2025-03-22 11:38:59 +08:00
parent 2024008373
commit 03b638408d
No known key found for this signature in database
GPG key ID: 3094873E29A482FB
2 changed files with 16 additions and 0 deletions

View file

@ -48,6 +48,7 @@ dispatch_subcmds (
char *argv[]
) {
if (--argc < 1) {
log_puts("subcmd not given");
return -1;
}
char const *cmd = *(++argv);

View file

@ -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])