summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-08-31 11:56:34 -0700
committerScott Gasch <[email protected]>2026-08-31 11:56:34 -0700
commit5441d2a6ce12eb4169e9d1f194a333684474dc5f (patch)
tree771b0edbe7fc3cae1ae4c0f859e9606fe5664658
parente8021f3938179e38c24b995777213fd6d629192a (diff)
Update run_tests.sh
-rwxr-xr-xsrc/run_tests.sh57
1 files changed, 48 insertions, 9 deletions
diff --git a/src/run_tests.sh b/src/run_tests.sh
index aaa1ba1..d5905e4 100755
--- a/src/run_tests.sh
+++ b/src/run_tests.sh
@@ -9,9 +9,9 @@ TESTS="../tests"
/bin/rm -rf "${LOGDIR}/*"
clear
-echo -n "Launching "
+echo -n "Launching all test suites @ sn=5M and sd=10 in parallel (expect ~5-6 min)... "
+_start_time=$(date +%s)
for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do
- echo -n "$suite@sd10 "
./typhoon \
--cpus 1 \
--hash 256m \
@@ -19,7 +19,6 @@ for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do
--batch \
--command "force; book name /nonexistent.book.bin; sd 10; script $TESTS/${suite}.ep_" \
> "$LOGDIR/sd10_${suite}.out" 2>&1 &
- echo -n "$suite@sn5M "
./typhoon \
--cpus 1 \
--hash 256m \
@@ -28,17 +27,57 @@ for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do
--command "force; book name /nonexistent.book.bin; sn 5000000; script $TESTS/${suite}.ep_" \
> "$LOGDIR/sn5m_${suite}.out" 2>&1 &
done
-echo
-echo
wait
+_elapsed=$(( $(date +%s) - _start_time ))
+echo "DONE! (${_elapsed}s)"
+echo
+
+print_stats_table() {
+ # $1 = head .out file, $2 = candidate .out file
+ # Extracts the "Final statistics" block (correct solutions .. script time)
+ # from each and prints a HEAD/CANDIDATE table with a numeric diff column.
+ local headfile="$1" candfile="$2"
+ awk -F: '
+ NR==FNR {
+ n++; lbl[n]=$1; val1[n]=$2; next
+ }
+ {
+ m++; val2[m]=$2
+ }
+ END {
+ printf(" %-22s %-35s %-35s\n", "", "HEAD", "CANDIDATE")
+ for (i = 1; i <= n; i++) {
+ label = lbl[i]; gsub(/^ +| +$/, "", label)
+ v1 = val1[i]; gsub(/^ +| +$/, "", v1)
+ v2 = (i <= m ? val2[i] : ""); gsub(/^ +| +$/, "", v2)
+ if (label == "leftover") {
+ gsub(/^[0-9.]+% alpha, +/, "", v1)
+ gsub(/^[0-9.]+% alpha, +/, "", v2)
+ }
+ n1 = v1 + 0; n2 = v2 + 0
+ diff = n2 - n1
+ if (diff == 0) {
+ dstr = ""
+ } else if (diff == int(diff)) {
+ dstr = sprintf(" (%+d)", diff)
+ } else {
+ dstr = sprintf(" (%+.2f)", diff)
+ }
+ printf(" %-22s %-35s %-35s\n", label ":", v1, v2 dstr)
+ }
+ }
+ ' "$headfile" "$candfile"
+}
for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do
echo "----[ $suite sd=10 ]----"
- tail -32 $LOGDIR/sd10_${suite}.out | head -3 | prefix "CANDIDATE>"
- tail -32 $HEAD_LOGDIR/sd10_${suite}.out | head -3 | prefix " HEAD>"
+ print_stats_table \
+ <(sed -n '/correct solutions/,/script time/p' "$HEAD_LOGDIR/sd10_${suite}.out") \
+ <(sed -n '/correct solutions/,/script time/p' "$LOGDIR/sd10_${suite}.out")
echo
echo "----[ $suite sn=5M ]----"
- tail -32 $LOGDIR/sn5m_${suite}.out | head -3 | prefix "CANDIDATE>"
- tail -32 $HEAD_LOGDIR/sn5m_${suite}.out | head -3 | prefix " HEAD>"
+ print_stats_table \
+ <(sed -n '/correct solutions/,/script time/p' "$HEAD_LOGDIR/sn5m_${suite}.out") \
+ <(sed -n '/correct solutions/,/script time/p' "$LOGDIR/sn5m_${suite}.out")
echo
done