Skip to content

Commit b232aba

Browse files
committed
Use sorted chksum_diag for diagnostic regression
This patch uses the new timestamped chksum_diag output for sorting, so that diagnostics can be verified as order-independent. Sorting is achieved by copying the appending timestamp as a prepended timestamp, and then passed to sort. This is still a jury rigged solution, but it prevents false regressions from a reordered diagnostic.
1 parent d332ae9 commit b232aba

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

.testing/Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,10 @@ $(foreach c,$(CONFIGS),$(eval $(call CONFIG_DIM_RULE,$(c))))
503503
# Regression testing only checks for changes in existing diagnostics
504504
.PRECIOUS: $(WORK)/%/target/chksum_diag
505505
%.regression.diag: $(foreach b,symmetric target,$(WORK)/%/$(b)/chksum_diag)
506-
@! diff $^ | grep "^[<>]" | grep "^>" > /dev/null \
507-
|| ! (\
508-
mkdir -p $(WORK)/results/$*; \
509-
(diff $^ | tee $(WORK)/results/$*/chksum_diag.regression.diff | head -n 20) ; \
506+
@tools/diff_diag.sh $^ || ! (\
510507
echo -e "$(FAIL): Diagnostics $*.regression.diag have changed." \
511508
)
512-
@cmp $^ || ( \
513-
diff $^ | head -n 20; \
509+
@tools/cmp_diag.sh $^ || ( \
514510
echo -e "$(WARN): New diagnostics in $<" \
515511
)
516512
@echo -e "$(PASS): Diagnostics $*.regression.diag agree."

.testing/tools/cmp_diag.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
for chk in $1 $2; do
4+
awk '{print $(NF-2) " " $(NF-1) " " $(NF),$0}' ${chk} | sort > ${chk}.sorted
5+
done
6+
7+
cmp $1.sorted $2.sorted
8+
9+
if [ $? -eq 1 ]; then
10+
diff $1.sorted $2.sorted | head -n 100
11+
exit 1
12+
fi

.testing/tools/diff_diag.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
for chk in $1 $2; do
4+
awk '{print $(NF-2) " " $(NF-1) " " $(NF),$0}' ${chk} | sort > ${chk}.sorted
5+
done
6+
7+
diff $1.sorted $2.sorted | grep "^[<>]" | grep "^>" > /dev/null
8+
9+
if [ $? -eq 0 ]; then
10+
diff $1.sorted $2.sorted | head -n 100
11+
exit 1
12+
fi

0 commit comments

Comments
 (0)