Skip to content

Commit

Permalink
test: Add tests for option "pspec"
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed May 24, 2023
1 parent 2ff4682 commit d3da4b1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/unittest/options/err.pspec-default.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* 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.
*/

/*
* In the absence of "pspec", this ambiguous expression would seem to have
* a syntax error near the end -- that is, after what is thought to be a
* declaration.
*/

int*x
2 changes: 2 additions & 0 deletions test/unittest/options/err.pspec-default.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- @@stderr --
dtrace: failed to compile script test/unittest/options/err.pspec-default.d: line 14: syntax error near end-of-input
16 changes: 16 additions & 0 deletions test/unittest/options/err.pspec-on.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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.
*/

/*
* In the presence of "pspec", this ambiguous expression would seem to be
* missing a predicate or action after what is interpreted as a probe
* description.
*/

#pragma D option pspec

int*x
2 changes: 2 additions & 0 deletions test/unittest/options/err.pspec-on.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- @@stderr --
dtrace: failed to compile script test/unittest/options/err.pspec-on.d: line 16: expected predicate and/or actions following probe description

0 comments on commit d3da4b1

Please sign in to comment.