test: add missing expectations and update diagnostics
PATCH 8/8 test: add missing expectations and update diagnostics
Signed-off-by Kris Van Hees <[email protected]>
--- test/unittest/lexer/tst.keyword-member.d | 2 ++ test/unittest/lexer/tst.keyword-member.r | 1 + test/unittest/lexer/tst.keyword-member.r.p | 22 +++++++++++++++++++ .../unittest/types/err.D_CAST_INVAL.badcast.r | 2 ++ .../unittest/types/err.D_DECL_SCOPE.badenum.d | 19 ++++++++++++++++ .../types/err.D_DECL_SCOPE.badstruct.d | 17 ++++++++++++++ test/unittest/types/err.D_SYNTAX.badenum.d | 7 +++--- test/unittest/types/err.D_SYNTAX.badenum.r | 2 +- test/unittest/types/err.D_SYNTAX.badid.d | 3 +-- test/unittest/types/err.D_SYNTAX.badstruct.d | 7 +++--- test/unittest/types/err.D_SYNTAX.badstruct.r | 2 +- test/unittest/types/err.unloaded_var.r | 2 +- 12 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 test/unittest/lexer/tst.keyword-member.r create mode 100755 test/unittest/lexer/tst.keyword-member.r.p create mode 100644 test/unittest/types/err.D_CAST_INVAL.badcast.r create mode 100644 test/unittest/types/err.D_DECL_SCOPE.badenum.d create mode 100644 test/unittest/types/err.D_DECL_SCOPE.badstruct.d
test/unittest/lexer/tst.keyword-member.d +2 -0
@@ -11,6 +11,8 @@ * after -> and after ., even with comments interjected. */ +#pragma D option quiet + BEGIN { printf("%p\n", &(*(struct cgroup_root *)&`cgrp_dfl_root).cgrp.self);
test/unittest/lexer/tst.keyword-member.r new file +1 -0
@@ -0,0 +1 @@ +All pointers are identical (as expected).
test/unittest/lexer/tst.keyword-member.r.p new file +22 -0
@@ -0,0 +1,22 @@ +#!/usr/bin/gawk -f + +NR == 1 { + val = $1; +} + +NF > 0 { + if ($1 != val) { + print "Output line " NR ": Expected " val ", got " $1; + fail++; + } +} + +END { + if (fail) { + print fail " failures"; + exit(1); + } else { + print "All pointers are identical (as expected)."; + exit(0); + } +}
test/unittest/types/err.D_CAST_INVAL.badcast.r new file +2 -0
@@ -0,0 +1,2 @@ +-- @@stderr -- +dtrace: failed to compile script test/unittest/types/err.D_CAST_INVAL.badcast.d: [D_CAST_INVAL] line 14: invalid cast expression: "void" to "struct task_struct"
test/unittest/types/err.D_DECL_SCOPE.badenum.d new file +19 -0
@@ -0,0 +1,19 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2006, 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: + * Test a bogus enum declaration using an invalid identifer. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + + +enum foo`bar +{ + +};
test/unittest/types/err.D_DECL_SCOPE.badstruct.d new file +17 -0
@@ -0,0 +1,17 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2006, 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: + * Attempt a bogus struct declaration using an invalid identifer. + * + * SECTION: Structs and Unions/Structs + */ + +struct foo`bar { + +};
test/unittest/types/err.D_SYNTAX.badenum.d +3 -4
@@ -1,19 +1,18 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2026, 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: - * Test a bogus enum declaration using an invalid identifer. + * ASSERTION: Test a bogus enum declaration using an invalid identifer. * * SECTION: Type and Constant Definitions/Enumerations */ -enum foo`bar +enum foo.bar { };
test/unittest/types/err.D_SYNTAX.badenum.r +1 -1
@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badenum.d: [D_SYNTAX] line 19: syntax error near "}" +dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badenum.d: [D_SYNTAX] line 15: syntax error near "."
test/unittest/types/err.D_SYNTAX.badid.d +1 -2
@@ -6,8 +6,7 @@ */ /* - * ASSERTION: - * Identifiers cannot begin with a digit + * ASSERTION: Identifiers cannot begin with a digit * * SECTION: Types, Operators, and Expressions/Identifier Names and Keywords */
test/unittest/types/err.D_SYNTAX.badstruct.d +3 -4
@@ -1,17 +1,16 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2026, 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: - * Attempt a bogus struct declaration using an invalid identifer. + * ASSERTION: Attempt a bogus struct declaration using an invalid identifer. * * SECTION: Structs and Unions/Structs */ -struct foo`bar { +struct foo.bar { };
test/unittest/types/err.D_SYNTAX.badstruct.r +1 -1
@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badstruct.d: [D_SYNTAX] line 17: syntax error near "}" +dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badstruct.d: [D_SYNTAX] line 14: syntax error near "."
test/unittest/types/err.unloaded_var.r +1 -1
@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.unloaded_var.d: line 21: failed to resolve gfs2`gfs2_control_wq: Module is no longer loaded +dtrace: failed to compile script test/unittest/types/err.unloaded_var.d: line 21: failed to resolve gfs2`gfs2_control_wq: Unknown module name
Signature · 1 line
2.52.0
Reviewed-by Elena Zannoni <[email protected]>
Quoted 225 lines · Kris Van Hees via DTrace-devel
Signed-off-by Kris Van Hees <[email protected]>--- test/unittest/lexer/tst.keyword-member.d | 2 ++ test/unittest/lexer/tst.keyword-member.r | 1 + test/unittest/lexer/tst.keyword-member.r.p | 22 +++++++++++++++++++ .../unittest/types/err.D_CAST_INVAL.badcast.r | 2 ++ .../unittest/types/err.D_DECL_SCOPE.badenum.d | 19 ++++++++++++++++ .../types/err.D_DECL_SCOPE.badstruct.d | 17 ++++++++++++++ test/unittest/types/err.D_SYNTAX.badenum.d | 7 +++--- test/unittest/types/err.D_SYNTAX.badenum.r | 2 +- test/unittest/types/err.D_SYNTAX.badid.d | 3 +-- test/unittest/types/err.D_SYNTAX.badstruct.d | 7 +++--- test/unittest/types/err.D_SYNTAX.badstruct.r | 2 +- test/unittest/types/err.unloaded_var.r | 2 +- 12 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 test/unittest/lexer/tst.keyword-member.r create mode 100755 test/unittest/lexer/tst.keyword-member.r.p create mode 100644 test/unittest/types/err.D_CAST_INVAL.badcast.r create mode 100644 test/unittest/types/err.D_DECL_SCOPE.badenum.d create mode 100644 test/unittest/types/err.D_DECL_SCOPE.badstruct.dtest/unittest/lexer/tst.keyword-member.d +2
-0@@ -11,6 +11,8 @@ * after -> and after ., even with comments interjected. */ +#pragma D option quiet + BEGIN { printf("%p\n", &(*(struct cgroup_root *)&`cgrp_dfl_root).cgrp.self);test/unittest/lexer/tst.keyword-member.r new file +1
-0@@ -0,0 +1 @@ +All pointers are identical (as expected).test/unittest/lexer/tst.keyword-member.r.p new file +22
-0@@ -0,0 +1,22 @@ +#!/usr/bin/gawk -f + +NR == 1 { + val = $1; +} + +NF > 0 { + if ($1 != val) { + print "Output line " NR ": Expected " val ", got " $1; + fail++; + } +} + +END { + if (fail) { + print fail " failures"; + exit(1); + } else { + print "All pointers are identical (as expected)."; + exit(0); + } +}test/unittest/types/err.D_CAST_INVAL.badcast.r new file +2
-0@@ -0,0 +1,2 @@ +-- @@stderr -- +dtrace: failed to compile script test/unittest/types/err.D_CAST_INVAL.badcast.d: [D_CAST_INVAL] line 14: invalid cast expression: "void" to "struct task_struct"test/unittest/types/err.D_DECL_SCOPE.badenum.d new file +19
-0@@ -0,0 +1,19 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2006, 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: + * Test a bogus enum declaration using an invalid identifer. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + + +enum foo`bar +{ + +};test/unittest/types/err.D_DECL_SCOPE.badstruct.d new file +17
-0@@ -0,0 +1,17 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2006, 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: + * Attempt a bogus struct declaration using an invalid identifer. + * + * SECTION: Structs and Unions/Structs + */ + +struct foo`bar { + +};test/unittest/types/err.D_SYNTAX.badenum.d +3
-4@@ -1,19 +1,18 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2026, 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: - * Test a bogus enum declaration using an invalid identifer. + * ASSERTION: Test a bogus enum declaration using an invalid identifer. * * SECTION: Type and Constant Definitions/Enumerations */ -enum foo`bar +enum foo.bar { };test/unittest/types/err.D_SYNTAX.badenum.r +1
-1@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badenum.d: [D_SYNTAX] line 19: syntax error near "}" +dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badenum.d: [D_SYNTAX] line 15: syntax error near "."test/unittest/types/err.D_SYNTAX.badid.d +1
-2@@ -6,8 +6,7 @@ */ /* - * ASSERTION: - * Identifiers cannot begin with a digit + * ASSERTION: Identifiers cannot begin with a digit * * SECTION: Types, Operators, and Expressions/Identifier Names and Keywords */test/unittest/types/err.D_SYNTAX.badstruct.d +3
-4@@ -1,17 +1,16 @@ /* * Oracle Linux DTrace. - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2026, 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: - * Attempt a bogus struct declaration using an invalid identifer. + * ASSERTION: Attempt a bogus struct declaration using an invalid identifer. * * SECTION: Structs and Unions/Structs */ -struct foo`bar { +struct foo.bar { };test/unittest/types/err.D_SYNTAX.badstruct.r +1
-1@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badstruct.d: [D_SYNTAX] line 17: syntax error near "}" +dtrace: failed to compile script test/unittest/types/err.D_SYNTAX.badstruct.d: [D_SYNTAX] line 14: syntax error near "."test/unittest/types/err.unloaded_var.r +1
-1@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.unloaded_var.d: line 21: failed to resolve gfs2`gfs2_control_wq: Module is no longer loaded +dtrace: failed to compile script test/unittest/types/err.unloaded_var.d: line 21: failed to resolve gfs2`gfs2_control_wq: Unknown module nameSignature · 7 lines
2.52.0 _______________________________________________ DTrace-devel mailing list [email protected] https://oss.oracle.com/mailman/listinfo/dtrace-devel