[DTrace-devel] [PATCH] test: Add tests for option "pspec"
Kris Van Hees
kris.van.hees at oracle.com
Sat Apr 29 00:17:38 UTC 2023
On Mon, Mar 13, 2023 at 07:49:49PM -0400, 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.pspec-default.d | 14 ++++++++++++++
> test/unittest/options/err.pspec-default.r | 2 ++
> test/unittest/options/err.pspec-on.d | 16 ++++++++++++++++
> test/unittest/options/err.pspec-on.r | 2 ++
> 4 files changed, 34 insertions(+)
> create mode 100644 test/unittest/options/err.pspec-default.d
> create mode 100644 test/unittest/options/err.pspec-default.r
> create mode 100644 test/unittest/options/err.pspec-on.d
> create mode 100644 test/unittest/options/err.pspec-on.r
>
> diff --git a/test/unittest/options/err.pspec-default.d b/test/unittest/options/err.pspec-default.d
> new file mode 100644
> index 00000000..7fcaa827
> --- /dev/null
> +++ b/test/unittest/options/err.pspec-default.d
> @@ -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
> diff --git a/test/unittest/options/err.pspec-default.r b/test/unittest/options/err.pspec-default.r
> new file mode 100644
> index 00000000..d2e0535b
> --- /dev/null
> +++ b/test/unittest/options/err.pspec-default.r
> @@ -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
> diff --git a/test/unittest/options/err.pspec-on.d b/test/unittest/options/err.pspec-on.d
> new file mode 100644
> index 00000000..303a7a50
> --- /dev/null
> +++ b/test/unittest/options/err.pspec-on.d
> @@ -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
> diff --git a/test/unittest/options/err.pspec-on.r b/test/unittest/options/err.pspec-on.r
> new file mode 100644
> index 00000000..49999851
> --- /dev/null
> +++ b/test/unittest/options/err.pspec-on.r
> @@ -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
> --
> 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