Skip to content

Commit

Permalink
test: Add tests for option "stdc"
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed May 24, 2023
1 parent d3da4b1 commit b9d79c5
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unittest/options/err.stdc-x.d
Original file line number Diff line number Diff line change
@@ -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);
}
2 changes: 2 additions & 0 deletions test/unittest/options/err.stdc-x.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- @@stderr --
dtrace: failed to set -x stdc: Invalid value for specified option
17 changes: 17 additions & 0 deletions test/unittest/options/tst.stdc-a.d
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 5 additions & 0 deletions test/unittest/options/tst.stdc-a.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FUNCTION:NAME
:BEGIN

-- @@stderr --
dtrace: script 'test/unittest/options/tst.stdc-a.d' matched 1 probe
17 changes: 17 additions & 0 deletions test/unittest/options/tst.stdc-c.d
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 5 additions & 0 deletions test/unittest/options/tst.stdc-c.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FUNCTION:NAME
:BEGIN

-- @@stderr --
dtrace: script 'test/unittest/options/tst.stdc-c.d' matched 1 probe
17 changes: 17 additions & 0 deletions test/unittest/options/tst.stdc-s.d
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 5 additions & 0 deletions test/unittest/options/tst.stdc-s.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FUNCTION:NAME
:BEGIN

-- @@stderr --
dtrace: script 'test/unittest/options/tst.stdc-s.d' matched 1 probe
17 changes: 17 additions & 0 deletions test/unittest/options/tst.stdc-t.d
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 5 additions & 0 deletions test/unittest/options/tst.stdc-t.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FUNCTION:NAME
:BEGIN

-- @@stderr --
dtrace: script 'test/unittest/options/tst.stdc-t.d' matched 1 probe

0 comments on commit b9d79c5

Please sign in to comment.