* [PATCH] test: Improve resilience of tests to ptr widths
@ 2025-01-28 21:36 eugene.loh
2025-02-26 16:58 ` Kris Van Hees
0 siblings, 1 reply; 2+ messages in thread
From: eugene.loh @ 2025-01-28 21:36 UTC (permalink / raw)
To: dtrace, dtrace-devel
From: Eugene Loh <eugene.loh@oracle.com>
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.
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
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
diff --git a/test/unittest/ustack/tst.uaddr-pid0.r b/test/unittest/ustack/tst.uaddr-pid0.r
index a8e68f4e6..cc1cdbc3d 100644
--- a/test/unittest/ustack/tst.uaddr-pid0.r
+++ b/test/unittest/ustack/tst.uaddr-pid0.r
@@ -1 +1 @@
- {ptr}
+ {ptr}
diff --git a/test/unittest/ustack/tst.uaddr-pid0.r.p b/test/unittest/ustack/tst.uaddr-pid0.r.p
new file mode 100755
index 000000000..9203dc824
--- /dev/null
+++ b/test/unittest/ustack/tst.uaddr-pid0.r.p
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
diff --git a/test/unittest/ustack/tst.uaddr.r b/test/unittest/ustack/tst.uaddr.r
index be48a12ab..cc329e213 100644
--- a/test/unittest/ustack/tst.uaddr.r
+++ b/test/unittest/ustack/tst.uaddr.r
@@ -1 +1 @@
- ustack-tst-basic`myfunc_y+{ptr}
+ ustack-tst-basic`myfunc_y+{ptr}
diff --git a/test/unittest/ustack/tst.uaddr.r.p b/test/unittest/ustack/tst.uaddr.r.p
new file mode 100755
index 000000000..9203dc824
--- /dev/null
+++ b/test/unittest/ustack/tst.uaddr.r.p
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
diff --git a/test/unittest/ustack/tst.ufunc-pid0.r b/test/unittest/ustack/tst.ufunc-pid0.r
index a8e68f4e6..cc1cdbc3d 100644
--- a/test/unittest/ustack/tst.ufunc-pid0.r
+++ b/test/unittest/ustack/tst.ufunc-pid0.r
@@ -1 +1 @@
- {ptr}
+ {ptr}
diff --git a/test/unittest/ustack/tst.ufunc-pid0.r.p b/test/unittest/ustack/tst.ufunc-pid0.r.p
new file mode 100755
index 000000000..9203dc824
--- /dev/null
+++ b/test/unittest/ustack/tst.ufunc-pid0.r.p
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
diff --git a/test/unittest/ustack/tst.usym-pid0.r b/test/unittest/ustack/tst.usym-pid0.r
index a8e68f4e6..cc1cdbc3d 100644
--- a/test/unittest/ustack/tst.usym-pid0.r
+++ b/test/unittest/ustack/tst.usym-pid0.r
@@ -1 +1 @@
- {ptr}
+ {ptr}
diff --git a/test/unittest/ustack/tst.usym-pid0.r.p b/test/unittest/ustack/tst.usym-pid0.r.p
new file mode 100755
index 000000000..9203dc824
--- /dev/null
+++ b/test/unittest/ustack/tst.usym-pid0.r.p
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# remove trailing blanks
+{ sub(" *$", ""); print }
--
2.43.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] test: Improve resilience of tests to ptr widths
2025-01-28 21:36 [PATCH] test: Improve resilience of tests to ptr widths eugene.loh
@ 2025-02-26 16:58 ` Kris Van Hees
0 siblings, 0 replies; 2+ messages in thread
From: Kris Van Hees @ 2025-02-26 16:58 UTC (permalink / raw)
To: eugene.loh; +Cc: dtrace, dtrace-devel
On Tue, Jan 28, 2025 at 04:36:21PM -0500, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> 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.
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
> 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
>
> diff --git a/test/unittest/ustack/tst.uaddr-pid0.r b/test/unittest/ustack/tst.uaddr-pid0.r
> index a8e68f4e6..cc1cdbc3d 100644
> --- a/test/unittest/ustack/tst.uaddr-pid0.r
> +++ b/test/unittest/ustack/tst.uaddr-pid0.r
> @@ -1 +1 @@
> - {ptr}
> + {ptr}
> diff --git a/test/unittest/ustack/tst.uaddr-pid0.r.p b/test/unittest/ustack/tst.uaddr-pid0.r.p
> new file mode 100755
> index 000000000..9203dc824
> --- /dev/null
> +++ b/test/unittest/ustack/tst.uaddr-pid0.r.p
> @@ -0,0 +1,4 @@
> +#!/usr/bin/gawk -f
> +
> +# remove trailing blanks
> +{ sub(" *$", ""); print }
> diff --git a/test/unittest/ustack/tst.uaddr.r b/test/unittest/ustack/tst.uaddr.r
> index be48a12ab..cc329e213 100644
> --- a/test/unittest/ustack/tst.uaddr.r
> +++ b/test/unittest/ustack/tst.uaddr.r
> @@ -1 +1 @@
> - ustack-tst-basic`myfunc_y+{ptr}
> + ustack-tst-basic`myfunc_y+{ptr}
> diff --git a/test/unittest/ustack/tst.uaddr.r.p b/test/unittest/ustack/tst.uaddr.r.p
> new file mode 100755
> index 000000000..9203dc824
> --- /dev/null
> +++ b/test/unittest/ustack/tst.uaddr.r.p
> @@ -0,0 +1,4 @@
> +#!/usr/bin/gawk -f
> +
> +# remove trailing blanks
> +{ sub(" *$", ""); print }
> diff --git a/test/unittest/ustack/tst.ufunc-pid0.r b/test/unittest/ustack/tst.ufunc-pid0.r
> index a8e68f4e6..cc1cdbc3d 100644
> --- a/test/unittest/ustack/tst.ufunc-pid0.r
> +++ b/test/unittest/ustack/tst.ufunc-pid0.r
> @@ -1 +1 @@
> - {ptr}
> + {ptr}
> diff --git a/test/unittest/ustack/tst.ufunc-pid0.r.p b/test/unittest/ustack/tst.ufunc-pid0.r.p
> new file mode 100755
> index 000000000..9203dc824
> --- /dev/null
> +++ b/test/unittest/ustack/tst.ufunc-pid0.r.p
> @@ -0,0 +1,4 @@
> +#!/usr/bin/gawk -f
> +
> +# remove trailing blanks
> +{ sub(" *$", ""); print }
> diff --git a/test/unittest/ustack/tst.usym-pid0.r b/test/unittest/ustack/tst.usym-pid0.r
> index a8e68f4e6..cc1cdbc3d 100644
> --- a/test/unittest/ustack/tst.usym-pid0.r
> +++ b/test/unittest/ustack/tst.usym-pid0.r
> @@ -1 +1 @@
> - {ptr}
> + {ptr}
> diff --git a/test/unittest/ustack/tst.usym-pid0.r.p b/test/unittest/ustack/tst.usym-pid0.r.p
> new file mode 100755
> index 000000000..9203dc824
> --- /dev/null
> +++ b/test/unittest/ustack/tst.usym-pid0.r.p
> @@ -0,0 +1,4 @@
> +#!/usr/bin/gawk -f
> +
> +# remove trailing blanks
> +{ sub(" *$", ""); print }
> --
> 2.43.5
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-26 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-28 21:36 [PATCH] test: Improve resilience of tests to ptr widths eugene.loh
2025-02-26 16:58 ` Kris Van Hees
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox