[DTrace-devel] [PATCH] test: Add tests for option "stdc"

eugene.loh at oracle.com eugene.loh at oracle.com
Tue Apr 4 23:00:51 UTC 2023


From: Eugene Loh <eugene.loh at oracle.com>

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 test/unittest/options/err.stdc-x.d | 13 +++++++++++++
 test/unittest/options/err.stdc-x.r |  2 ++
 test/unittest/options/tst.stdc-a.d | 17 +++++++++++++++++
 test/unittest/options/tst.stdc-a.r |  5 +++++
 test/unittest/options/tst.stdc-c.d | 17 +++++++++++++++++
 test/unittest/options/tst.stdc-c.r |  5 +++++
 test/unittest/options/tst.stdc-s.d | 17 +++++++++++++++++
 test/unittest/options/tst.stdc-s.r |  5 +++++
 test/unittest/options/tst.stdc-t.d | 17 +++++++++++++++++
 test/unittest/options/tst.stdc-t.r |  5 +++++
 10 files changed, 103 insertions(+)
 create mode 100644 test/unittest/options/err.stdc-x.d
 create mode 100644 test/unittest/options/err.stdc-x.r
 create mode 100644 test/unittest/options/tst.stdc-a.d
 create mode 100644 test/unittest/options/tst.stdc-a.r
 create mode 100644 test/unittest/options/tst.stdc-c.d
 create mode 100644 test/unittest/options/tst.stdc-c.r
 create mode 100644 test/unittest/options/tst.stdc-s.d
 create mode 100644 test/unittest/options/tst.stdc-s.r
 create mode 100644 test/unittest/options/tst.stdc-t.d
 create mode 100644 test/unittest/options/tst.stdc-t.r

diff --git a/test/unittest/options/err.stdc-x.d b/test/unittest/options/err.stdc-x.d
new file mode 100644
index 00000000..a25abc25
--- /dev/null
+++ b/test/unittest/options/err.stdc-x.d
@@ -0,0 +1,13 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2023, 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.
+ */
+
+/* @@runtest-opts: -xstdc=X */
+
+BEGIN
+{
+	exit(0);
+}
diff --git a/test/unittest/options/err.stdc-x.r b/test/unittest/options/err.stdc-x.r
new file mode 100644
index 00000000..f39d1be9
--- /dev/null
+++ b/test/unittest/options/err.stdc-x.r
@@ -0,0 +1,2 @@
+-- @@stderr --
+dtrace: failed to set -x stdc: Invalid value for specified option
diff --git a/test/unittest/options/tst.stdc-a.d b/test/unittest/options/tst.stdc-a.d
new file mode 100644
index 00000000..6b383032
--- /dev/null
+++ b/test/unittest/options/tst.stdc-a.d
@@ -0,0 +1,17 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2023, 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.
+ */
+
+/* @@runtest-opts: -C -xstdc=a */
+
+BEGIN
+{
+#ifdef __STDC__
+	exit(0);
+#else
+	exit(1);
+#endif
+}
diff --git a/test/unittest/options/tst.stdc-a.r b/test/unittest/options/tst.stdc-a.r
new file mode 100644
index 00000000..546719ec
--- /dev/null
+++ b/test/unittest/options/tst.stdc-a.r
@@ -0,0 +1,5 @@
+                   FUNCTION:NAME
+                          :BEGIN 
+
+-- @@stderr --
+dtrace: script 'test/unittest/options/tst.stdc-a.d' matched 1 probe
diff --git a/test/unittest/options/tst.stdc-c.d b/test/unittest/options/tst.stdc-c.d
new file mode 100644
index 00000000..a896a3b6
--- /dev/null
+++ b/test/unittest/options/tst.stdc-c.d
@@ -0,0 +1,17 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2023, 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.
+ */
+
+/* @@runtest-opts: -C -xstdc=c */
+
+BEGIN
+{
+#ifdef __STDC__
+	exit(0);
+#else
+	exit(1);
+#endif
+}
diff --git a/test/unittest/options/tst.stdc-c.r b/test/unittest/options/tst.stdc-c.r
new file mode 100644
index 00000000..27a01584
--- /dev/null
+++ b/test/unittest/options/tst.stdc-c.r
@@ -0,0 +1,5 @@
+                   FUNCTION:NAME
+                          :BEGIN 
+
+-- @@stderr --
+dtrace: script 'test/unittest/options/tst.stdc-c.d' matched 1 probe
diff --git a/test/unittest/options/tst.stdc-s.d b/test/unittest/options/tst.stdc-s.d
new file mode 100644
index 00000000..87d45778
--- /dev/null
+++ b/test/unittest/options/tst.stdc-s.d
@@ -0,0 +1,17 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2023, 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.
+ */
+
+/* @@runtest-opts: -C -xstdc=s */
+
+BEGIN
+{
+#ifdef __STDC__
+	exit(1);
+#else
+	exit(0);
+#endif
+}
diff --git a/test/unittest/options/tst.stdc-s.r b/test/unittest/options/tst.stdc-s.r
new file mode 100644
index 00000000..e31b1018
--- /dev/null
+++ b/test/unittest/options/tst.stdc-s.r
@@ -0,0 +1,5 @@
+                   FUNCTION:NAME
+                          :BEGIN 
+
+-- @@stderr --
+dtrace: script 'test/unittest/options/tst.stdc-s.d' matched 1 probe
diff --git a/test/unittest/options/tst.stdc-t.d b/test/unittest/options/tst.stdc-t.d
new file mode 100644
index 00000000..244d2f01
--- /dev/null
+++ b/test/unittest/options/tst.stdc-t.d
@@ -0,0 +1,17 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2023, 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.
+ */
+
+/* @@runtest-opts: -C -xstdc=t */
+
+BEGIN
+{
+#ifdef __STDC__
+	exit(0);
+#else
+	exit(1);
+#endif
+}
diff --git a/test/unittest/options/tst.stdc-t.r b/test/unittest/options/tst.stdc-t.r
new file mode 100644
index 00000000..58366ad9
--- /dev/null
+++ b/test/unittest/options/tst.stdc-t.r
@@ -0,0 +1,5 @@
+                   FUNCTION:NAME
+                          :BEGIN 
+
+-- @@stderr --
+dtrace: script 'test/unittest/options/tst.stdc-t.d' matched 1 probe
-- 
2.18.4




More information about the DTrace-devel mailing list