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

Kris Van Hees kris.van.hees at oracle.com
Fri Feb 24 07:40:58 UTC 2023


On Fri, Feb 17, 2023 at 08:10:39PM -0500, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>

> ---
>  test/unittest/options/err.version.d  | 17 +++++++++++++++++
>  test/unittest/options/err.version.r  |  2 ++
>  test/unittest/options/tst.version.r  |  2 ++
>  test/unittest/options/tst.version.sh | 15 +++++++++++++++
>  4 files changed, 36 insertions(+)
>  create mode 100644 test/unittest/options/err.version.d
>  create mode 100644 test/unittest/options/err.version.r
>  create mode 100644 test/unittest/options/tst.version.r
>  create mode 100755 test/unittest/options/tst.version.sh
> 
> diff --git a/test/unittest/options/err.version.d b/test/unittest/options/err.version.d
> new file mode 100644
> index 00000000..bd86e13f
> --- /dev/null
> +++ b/test/unittest/options/err.version.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.
> + */
> +
> +/*
> + * ASSERTION: The -xversion option works.
> + *
> + * SECTION: Options and Tunables/Consumer Options
> + */
> +
> +/* @@runtest-opts: -xversion=99.1 */
> +BEGIN {
> +	exit(0);
> +}
> diff --git a/test/unittest/options/err.version.r b/test/unittest/options/err.version.r
> new file mode 100644
> index 00000000..6cdd1f7f
> --- /dev/null
> +++ b/test/unittest/options/err.version.r
> @@ -0,0 +1,2 @@
> +-- @@stderr --
> +dtrace: failed to set -x version: Requested version is not supported by compiler
> diff --git a/test/unittest/options/tst.version.r b/test/unittest/options/tst.version.r
> new file mode 100644
> index 00000000..15010b3d
> --- /dev/null
> +++ b/test/unittest/options/tst.version.r
> @@ -0,0 +1,2 @@
> +version is 2.0
> +
> diff --git a/test/unittest/options/tst.version.sh b/test/unittest/options/tst.version.sh
> new file mode 100755
> index 00000000..cd069aa7
> --- /dev/null
> +++ b/test/unittest/options/tst.version.sh
> @@ -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 $?
> -- 
> 2.18.4
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list