-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from tudortimi/add-support-for-test-compile-de…
…pendencies-other-than-svunit Add support for test compile dependencies other than SVUnit
- Loading branch information
Showing
14 changed files
with
176 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
plugins { | ||
id 'com.verificationgentleman.gradle.hdvl.systemverilog' | ||
id 'com.verificationgentleman.gradle.hdvl.svunit' | ||
} | ||
|
||
dependencies { | ||
testCompile "org.svunit:svunit:v3.34.2" | ||
testCompile "com.verificationgentleman.gradle.hdvl.examples.svunit:test_utils" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
exec "$(dirname "$0")/../../gradlew" "$@" |
11 changes: 11 additions & 0 deletions
11
examples/svunit-with-test-compile-dependency/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
includeBuild("../..") | ||
includeBuild("test_utils") | ||
|
||
sourceControl { | ||
gitRepository("https://github.com/svunit/svunit.git") { | ||
producesModule("org.svunit:svunit") | ||
plugins { | ||
id "com.verificationgentleman.gradle.hdvl.svunit-build-injector" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/svunit-with-test-compile-dependency/src/main/sv/some_class.svh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class some_class; | ||
|
||
function bit is_working(); | ||
return 1; | ||
endfunction | ||
|
||
endclass |
5 changes: 5 additions & 0 deletions
5
examples/svunit-with-test-compile-dependency/src/main/sv/some_package.sv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package some_package; | ||
|
||
`include "some_class.svh" | ||
|
||
endpackage |
36 changes: 36 additions & 0 deletions
36
examples/svunit-with-test-compile-dependency/src/test/sv/some_unit_test.sv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module some_class_unit_test; | ||
|
||
import svunit_pkg::svunit_testcase; | ||
`include "svunit_defines.svh" | ||
|
||
string name = "some_class_unit_test"; | ||
svunit_testcase svunit_ut; | ||
|
||
|
||
import some_package::*; | ||
import test_utils::*; | ||
|
||
|
||
function void build(); | ||
svunit_ut = new(name); | ||
endfunction | ||
|
||
task setup(); | ||
svunit_ut.setup(); | ||
endtask | ||
|
||
task teardown(); | ||
svunit_ut.teardown(); | ||
endtask | ||
|
||
|
||
`SVUNIT_TESTS_BEGIN | ||
|
||
`SVTEST(is_working__returns_1) | ||
some_class obj = new(); | ||
`FAIL_UNLESS(confirm(obj.is_working())) | ||
`SVTEST_END | ||
|
||
`SVUNIT_TESTS_END | ||
|
||
endmodule |
5 changes: 5 additions & 0 deletions
5
examples/svunit-with-test-compile-dependency/test_utils/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
plugins { | ||
id 'com.verificationgentleman.gradle.hdvl.systemverilog' | ||
} | ||
|
||
group = "com.verificationgentleman.gradle.hdvl.examples.svunit" |
1 change: 1 addition & 0 deletions
1
examples/svunit-with-test-compile-dependency/test_utils/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Intentionally empty |
7 changes: 7 additions & 0 deletions
7
examples/svunit-with-test-compile-dependency/test_utils/src/main/sv/test_utils.sv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package test_utils; | ||
|
||
function bit confirm(bit val); | ||
return val; | ||
endfunction | ||
|
||
endpackage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters