Skip to content

Commit

Permalink
test: Add test for option "version"
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 69d78b0 commit 990ec8c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unittest/options/err.version.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.
*/

/*
* ASSERTION: The -xversion option works.
*
* SECTION: Options and Tunables/Consumer Options
*/

/* @@runtest-opts: -xversion=99.1 */
BEGIN {
exit(0);
}
2 changes: 2 additions & 0 deletions test/unittest/options/err.version.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- @@stderr --
dtrace: failed to set -x version: Requested version is not supported by compiler
2 changes: 2 additions & 0 deletions test/unittest/options/tst.version.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version is 2.0

15 changes: 15 additions & 0 deletions test/unittest/options/tst.version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/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

myversion=`$dtrace $dt_flags -V | awk '{ print $NF }'`
echo version is $myversion

$dtrace $dt_flags -xversion=$myversion -qn 'BEGIN { exit(0) }'
exit $?

0 comments on commit 990ec8c

Please sign in to comment.