Skip to content

Commit

Permalink
test: Add test for option "tregs"
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 Feb 26, 2023
1 parent 990ec8c commit 372c882
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unittest/options/tst.tregs.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tregs 3 gives 1
tregs 5 gives 1

1 2 3 4 5 6 7 1
tregs 9 gives 0

1 2 3 4 5 6 7 1
tregs 11 gives 0
-- @@stderr --
dtrace: invalid probe specifier BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }: Insufficient tuple registers to generate code
dtrace: invalid probe specifier BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }: Insufficient tuple registers to generate code
14 changes: 14 additions & 0 deletions test/unittest/options/tst.tregs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
#
# 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.
#

dtrace=$1

for x in 3 5 9 11; do
$dtrace -xtregs=$x -qn 'BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }'
echo "tregs $x gives $?"
done

0 comments on commit 372c882

Please sign in to comment.