Skip to contentSkip to conversation

test: Improve resilience of tests to ptr widths

PATCH In review [email protected] 2 participants 2 messages Jan 28, 2025 – Feb 26, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: Improve resilience of tests to ptr widths

From: Eugene Loh <[email protected]>

When tests are run, runtest.sh runs postprocess(), which among other things turns irreproducible hex strings (presumably offsets and pointers) into fixed strings (like "ptr") for correctness checking. In a few cases, however, there are trailing blanks to justify the right margin, meaning that the width of the hex string can cause the number of trailing blanks to vary.

Improve the resilience of these tests by stripping out such trailing blanks.

---
 test/unittest/ustack/tst.uaddr-pid0.r   | 2 +-
 test/unittest/ustack/tst.uaddr-pid0.r.p | 4 ++++
 test/unittest/ustack/tst.uaddr.r        | 2 +-
 test/unittest/ustack/tst.uaddr.r.p      | 4 ++++
 test/unittest/ustack/tst.ufunc-pid0.r   | 2 +-
 test/unittest/ustack/tst.ufunc-pid0.r.p | 4 ++++
 test/unittest/ustack/tst.usym-pid0.r    | 2 +-
 test/unittest/ustack/tst.usym-pid0.r.p  | 4 ++++
 8 files changed, 20 insertions(+), 4 deletions(-)
 create mode 100755 test/unittest/ustack/tst.uaddr-pid0.r.p
 create mode 100755 test/unittest/ustack/tst.uaddr.r.p
 create mode 100755 test/unittest/ustack/tst.ufunc-pid0.r.p
 create mode 100755 test/unittest/ustack/tst.usym-pid0.r.p
test/unittest/ustack/tst.uaddr-pid0.r +1 -1
index a8e68f4e6..cc1cdbc3d 100644
@@ -1 +1 @@
-  {ptr}                                               
+  {ptr}
test/unittest/ustack/tst.uaddr-pid0.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
test/unittest/ustack/tst.uaddr.r +1 -1
index be48a12ab..cc329e213 100644
@@ -1 +1 @@
-  ustack-tst-basic`myfunc_y+{ptr}                     
+  ustack-tst-basic`myfunc_y+{ptr}
test/unittest/ustack/tst.uaddr.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
test/unittest/ustack/tst.ufunc-pid0.r +1 -1
index a8e68f4e6..cc1cdbc3d 100644
@@ -1 +1 @@
-  {ptr}                                               
+  {ptr}
test/unittest/ustack/tst.ufunc-pid0.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
test/unittest/ustack/tst.usym-pid0.r +1 -1
index a8e68f4e6..cc1cdbc3d 100644
@@ -1 +1 @@
-  {ptr}                                               
+  {ptr}
test/unittest/ustack/tst.usym-pid0.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Tue, Jan 28, 2025 at 04:36:21PM -0500, [email protected] wrote:

From: Eugene Loh <[email protected]>

When tests are run, runtest.sh runs postprocess(), which among other things turns irreproducible hex strings (presumably offsets and pointers) into fixed strings (like "ptr") for correctness checking. In a few cases, however, there are trailing blanks to justify the right margin, meaning that the width of the hex string can cause the number of trailing blanks to vary.

Quoted 4 lines

Improve the resilience of these tests by stripping out such trailing blanks.

Quoted 86 lines
---
 test/unittest/ustack/tst.uaddr-pid0.r   | 2 +-
 test/unittest/ustack/tst.uaddr-pid0.r.p | 4 ++++
 test/unittest/ustack/tst.uaddr.r        | 2 +-
 test/unittest/ustack/tst.uaddr.r.p      | 4 ++++
 test/unittest/ustack/tst.ufunc-pid0.r   | 2 +-
 test/unittest/ustack/tst.ufunc-pid0.r.p | 4 ++++
 test/unittest/ustack/tst.usym-pid0.r    | 2 +-
 test/unittest/ustack/tst.usym-pid0.r.p  | 4 ++++
 8 files changed, 20 insertions(+), 4 deletions(-)
 create mode 100755 test/unittest/ustack/tst.uaddr-pid0.r.p
 create mode 100755 test/unittest/ustack/tst.uaddr.r.p
 create mode 100755 test/unittest/ustack/tst.ufunc-pid0.r.p
 create mode 100755 test/unittest/ustack/tst.usym-pid0.r.p
test/unittest/ustack/tst.uaddr-pid0.r +1 -1
index a8e68f4e6..cc1cdbc3d 100644
@@ -1 +1 @@
-  {ptr}                                               
+  {ptr}
test/unittest/ustack/tst.uaddr-pid0.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
test/unittest/ustack/tst.uaddr.r +1 -1
index be48a12ab..cc329e213 100644
@@ -1 +1 @@
-  ustack-tst-basic`myfunc_y+{ptr}                     
+  ustack-tst-basic`myfunc_y+{ptr}
test/unittest/ustack/tst.uaddr.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
test/unittest/ustack/tst.ufunc-pid0.r +1 -1
index a8e68f4e6..cc1cdbc3d 100644
@@ -1 +1 @@
-  {ptr}                                               
+  {ptr}
test/unittest/ustack/tst.ufunc-pid0.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
test/unittest/ustack/tst.usym-pid0.r +1 -1
index a8e68f4e6..cc1cdbc3d 100644
@@ -1 +1 @@
-  {ptr}                                               
+  {ptr}
test/unittest/ustack/tst.usym-pid0.r.p new file +4 -0
new file mode 100755
index 000000000..9203dc824
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
Signature · 1 line
2.43.5