[DTrace-devel] [PATCH 1/4] Tweak testsuite to account for libctf / libdtrace-ctf differences

Kris Van Hees kris.van.hees at oracle.com
Fri Oct 29 22:40:53 PDT 2021


Some error messages changed in libctf while libdrace-ctf is still using
the old messages.  The most common change is the addition of a trailing
period for error messages.  One instance is slightly more involved by
mislabeling a struct as a union.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 test/unittest/enum/err.D_UNKNOWN.RepeatIdentifiers.r.p | 1 +
 test/unittest/funcs/err.inet_ntoabadaddr.d             | 3 ++-
 test/unittest/funcs/err.inet_ntopbadaddr.d             | 3 ++-
 test/unittest/funcs/err.inet_ntopbadarg.d              | 3 ++-
 test/unittest/offsetof/err.D_UNKNOWN.OffsetofNULL.r.p  | 1 +
 test/unittest/types/err.D_UNKNOWN.dupenum.r.p          | 1 +
 test/unittest/types/err.D_UNKNOWN.dupstruct.r.p        | 1 +
 test/unittest/union/err.D_DECL_INCOMPLETE.circular.r.p | 1 +
 test/unittest/union/err.D_DECL_INCOMPLETE.order.r.p    | 1 +
 test/unittest/union/err.D_DECL_INCOMPLETE.simple.r.p   | 1 +
 test/utils/Build                                       | 3 ++-
 test/utils/libctf.r.p                                  | 7 +++++++
 12 files changed, 22 insertions(+), 4 deletions(-)
 create mode 120000 test/unittest/enum/err.D_UNKNOWN.RepeatIdentifiers.r.p
 create mode 120000 test/unittest/offsetof/err.D_UNKNOWN.OffsetofNULL.r.p
 create mode 120000 test/unittest/types/err.D_UNKNOWN.dupenum.r.p
 create mode 120000 test/unittest/types/err.D_UNKNOWN.dupstruct.r.p
 create mode 120000 test/unittest/union/err.D_DECL_INCOMPLETE.circular.r.p
 create mode 120000 test/unittest/union/err.D_DECL_INCOMPLETE.order.r.p
 create mode 120000 test/unittest/union/err.D_DECL_INCOMPLETE.simple.r.p
 create mode 100755 test/utils/libctf.r.p

diff --git a/test/unittest/enum/err.D_UNKNOWN.RepeatIdentifiers.r.p b/test/unittest/enum/err.D_UNKNOWN.RepeatIdentifiers.r.p
new file mode 120000
index 00000000..694659bc
--- /dev/null
+++ b/test/unittest/enum/err.D_UNKNOWN.RepeatIdentifiers.r.p
@@ -0,0 +1 @@
+../../utils/libctf.r.p
\ No newline at end of file
diff --git a/test/unittest/funcs/err.inet_ntoabadaddr.d b/test/unittest/funcs/err.inet_ntoabadaddr.d
index 58e5a33d..40beaebf 100644
--- a/test/unittest/funcs/err.inet_ntoabadaddr.d
+++ b/test/unittest/funcs/err.inet_ntoabadaddr.d
@@ -1,9 +1,10 @@
 /*
  * Oracle Linux DTrace.
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
  * Licensed under the Universal Permissive License v 1.0 as shown at
  * http://oss.oracle.com/licenses/upl.
  */
+/* @@skip: libctf bug */
 
 #pragma D option quiet
 
diff --git a/test/unittest/funcs/err.inet_ntopbadaddr.d b/test/unittest/funcs/err.inet_ntopbadaddr.d
index 0d800699..79c15e4c 100644
--- a/test/unittest/funcs/err.inet_ntopbadaddr.d
+++ b/test/unittest/funcs/err.inet_ntopbadaddr.d
@@ -1,9 +1,10 @@
 /*
  * Oracle Linux DTrace.
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
  * Licensed under the Universal Permissive License v 1.0 as shown at
  * http://oss.oracle.com/licenses/upl.
  */
+/* @@skip: libctf bug */
 
 #pragma D option quiet
 
diff --git a/test/unittest/funcs/err.inet_ntopbadarg.d b/test/unittest/funcs/err.inet_ntopbadarg.d
index 5677b579..60f33714 100644
--- a/test/unittest/funcs/err.inet_ntopbadarg.d
+++ b/test/unittest/funcs/err.inet_ntopbadarg.d
@@ -1,9 +1,10 @@
 /*
  * Oracle Linux DTrace.
- * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
  * Licensed under the Universal Permissive License v 1.0 as shown at
  * http://oss.oracle.com/licenses/upl.
  */
+/* @@skip: libctf bug */
 
 #pragma D option quiet
 
diff --git a/test/unittest/offsetof/err.D_UNKNOWN.OffsetofNULL.r.p b/test/unittest/offsetof/err.D_UNKNOWN.OffsetofNULL.r.p
new file mode 120000
index 00000000..694659bc
--- /dev/null
+++ b/test/unittest/offsetof/err.D_UNKNOWN.OffsetofNULL.r.p
@@ -0,0 +1 @@
+../../utils/libctf.r.p
\ No newline at end of file
diff --git a/test/unittest/types/err.D_UNKNOWN.dupenum.r.p b/test/unittest/types/err.D_UNKNOWN.dupenum.r.p
new file mode 120000
index 00000000..694659bc
--- /dev/null
+++ b/test/unittest/types/err.D_UNKNOWN.dupenum.r.p
@@ -0,0 +1 @@
+../../utils/libctf.r.p
\ No newline at end of file
diff --git a/test/unittest/types/err.D_UNKNOWN.dupstruct.r.p b/test/unittest/types/err.D_UNKNOWN.dupstruct.r.p
new file mode 120000
index 00000000..694659bc
--- /dev/null
+++ b/test/unittest/types/err.D_UNKNOWN.dupstruct.r.p
@@ -0,0 +1 @@
+../../utils/libctf.r.p
\ No newline at end of file
diff --git a/test/unittest/union/err.D_DECL_INCOMPLETE.circular.r.p b/test/unittest/union/err.D_DECL_INCOMPLETE.circular.r.p
new file mode 120000
index 00000000..694659bc
--- /dev/null
+++ b/test/unittest/union/err.D_DECL_INCOMPLETE.circular.r.p
@@ -0,0 +1 @@
+../../utils/libctf.r.p
\ No newline at end of file
diff --git a/test/unittest/union/err.D_DECL_INCOMPLETE.order.r.p b/test/unittest/union/err.D_DECL_INCOMPLETE.order.r.p
new file mode 120000
index 00000000..694659bc
--- /dev/null
+++ b/test/unittest/union/err.D_DECL_INCOMPLETE.order.r.p
@@ -0,0 +1 @@
+../../utils/libctf.r.p
\ No newline at end of file
diff --git a/test/unittest/union/err.D_DECL_INCOMPLETE.simple.r.p b/test/unittest/union/err.D_DECL_INCOMPLETE.simple.r.p
new file mode 120000
index 00000000..694659bc
--- /dev/null
+++ b/test/unittest/union/err.D_DECL_INCOMPLETE.simple.r.p
@@ -0,0 +1 @@
+../../utils/libctf.r.p
\ No newline at end of file
diff --git a/test/utils/Build b/test/utils/Build
index 3204d054..202048e8 100644
--- a/test/utils/Build
+++ b/test/utils/Build
@@ -45,7 +45,8 @@ install::
 	install -m 755 test/utils/showUSDT $(INSTDOCDIR)
 
 install-test::
-	$(call describe-install-target,$(INSTTESTDIR)/test/utils,$(TEST_UTILS) include-test.d)
+	$(call describe-install-target,$(INSTTESTDIR)/test/utils,$(TEST_UTILS) include-test.d libctf.r.p)
 	mkdir -p $(INSTTESTDIR)/test/utils
 	install -m 755 $(addprefix test/utils/,$(TEST_UTILS)) $(INSTTESTDIR)/test/utils
 	install -m 644 test/utils/include-test.d $(INSTTESTDIR)/test/utils
+	install -m 755 test/utils/libctf.r.p $(INSTTESTDIR)/test/utils
diff --git a/test/utils/libctf.r.p b/test/utils/libctf.r.p
new file mode 100755
index 00000000..a2b4602c
--- /dev/null
+++ b/test/utils/libctf.r.p
@@ -0,0 +1,7 @@
+#!/usr/bin/gawk -f
+# Licensed under the Universal Permissive License v 1.0 as shown at
+# http://oss.oracle.com/licenses/upl.
+/Duplicate member or variable name\.$/ { sub(/\.$/, ""); }
+/Member name not found\.$/ { sub(/\.$/, ""); }
+/enum union pirate:/ { sub(/enum union pirate/, "enum struct pirate"); }
+{ print; }
-- 
2.33.0




More information about the DTrace-devel mailing list