From: Nick Bowler Date: Wed, 9 Feb 2022 04:34:17 +0000 (-0500) Subject: Simplify and improve randomdecl sanity test. X-Git-Tag: v1.2~9 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/d99c70ac3b5768430d0b9f295ebbba1a94e2a6f2 Simplify and improve randomdecl sanity test. We don't need to do any weird shell variable stuff here, we can just directly compute the expected output and verify against that. As a bonus, when the test fails this gives a much better description of which expected forms are missing in the testsuite log. --- diff --git a/tests/stress.at b/tests/stress.at index 77c0d20..991ce99 100644 --- a/tests/stress.at +++ b/tests/stress.at @@ -59,24 +59,14 @@ m4_define([sanity_tests], [dnl ]) m4_define([sanity_sed], [/$1/i\ -AS_TR_SH([$2])=:]) -AT_DATA([sanity.sed], [#n +FOUND $2])AT_DATA([sanity.sed], [#n m4_map_sep([sanity_sed], [m4_newline], [sanity_tests]) ]) +sed -n '/^FOUND/p' sanity.sed | LC_ALL=C sort -u >expout printf 'Using seed %d\n' "$random_seed" >&AS_MESSAGE_LOG_FD -AT_CHECK([randomdecl -En 10000 -s "$random_seed" >decls], [0], [ignore-nolog]) -AT_CHECK([sed -f sanity.sed decls], [0], [stdout-nolog]) -sort -u stdout >decls.chk - -exec 3decls], [0]) +AT_CHECK([sed -f sanity.sed decls | LC_ALL=C sort -u], [0], [expout]) AT_CLEANUP