Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
sv2v
Commits
e94c0346
Commit
e94c0346
authored
Jan 20, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add optional error message patterns to error test suite
parent
5891a0eb
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
25 additions
and
1 deletions
+25
-1
test/error/default_nettype_invalid.sv
+1
-0
test/error/default_nettype_none.sv
+1
-0
test/error/enum_conflict.sv
+1
-0
test/error/highz0_highz1.sv
+1
-0
test/error/lhs_expr.sv
+1
-0
test/error/lhs_pattern.sv
+1
-0
test/error/missing_include.sv
+1
-0
test/error/run.sh
+16
-1
test/error/undefined_macro.sv
+1
-0
test/error/unmatched_endif.sv
+1
-0
No files found.
test/error/default_nettype_invalid.sv
View file @
e94c0346
// pattern: bad default_nettype: "invalid"
`default_nettype
invalid
module
top
;
assign
foo
=
0
;
...
...
test/error/default_nettype_none.sv
View file @
e94c0346
// pattern: implicit declaration of "foo" but default_nettype is none
`default_nettype
none
module
top
;
assign
foo
=
0
;
...
...
test/error/enum_conflict.sv
View file @
e94c0346
// pattern: enum conversion has duplicate vals
module
top
;
typedef
enum
{
A
=
0
,
...
...
test/error/highz0_highz1.sv
View file @
e94c0346
// pattern: unexpected token 'highz1'
module
top
;
wire
(
highz0
,
highz1
)
x
;
endmodule
test/error/lhs_expr.sv
View file @
e94c0346
// pattern: cannot convert expression to LHS
module
top
;
logic
x
;
assign
{<<
{
x
,
2'b00
}}
=
3'b101
;
...
...
test/error/lhs_pattern.sv
View file @
e94c0346
// pattern: cannot convert expression to LHS
module
top
;
logic
x
,
y
,
z
;
assign
{<<
{
x
,
'
{
y
:
y
,
z
:
z
}}}
=
3'b101
;
...
...
test/error/missing_include.sv
View file @
e94c0346
// pattern: Could not find file "does_not_exist\.sv", included from "missing_include\.sv"
`include
"does_not_exist.sv"
test/error/run.sh
View file @
e94c0346
#!/bin/bash
validateOutput
()
{
stdout_len
=
`
wc
-l
<
$SHUNIT_TMPDIR
/stdout
`
assertEquals
"stdout should be empty"
0
$stdout_len
stderr
=
`
cat
$SHUNIT_TMPDIR
/stderr
`
assertNotNull
"stderr should not be empty"
"
$stderr
"
line
=
`
head
-n1
$1
`
if
[[
"
$line
"
=
~
\/\/\
pattern:
\
.
*
]]
;
then
pattern
=
${
line
:12
}
if
[[
!
"
$stderr
"
=
~
$pattern
]]
;
then
fail
"error message doesn't match
\n
expected:
$pattern
\n
actual:
$stderr
"
fi
fi
}
addTest
()
{
test
=
$1
eval
"test_
$test
() {
\
$SV2V
$test
.sv 2>
/dev/null > /dev/null
;
\
$SV2V
$test
.sv 2>
$SHUNIT_TMPDIR
/stderr >
$SHUNIT_TMPDIR
/stdout
;
\
assertFalse
\"
conversion should have failed
\"
\$
?;
\
validateOutput
$test
.sv;
\
}"
suite_addTest test_
$test
}
...
...
test/error/undefined_macro.sv
View file @
e94c0346
// pattern: Undefined macro: SOMETHING
`SOMETHING
module
top
;
endmodule
test/error/unmatched_endif.sv
View file @
e94c0346
// pattern: `endif directive outside of an `if/`endif block
`endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment