File tree Expand file tree Collapse file tree 4 files changed +43
-6
lines changed Expand file tree Collapse file tree 4 files changed +43
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Marlin CI
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - master
8
+
9
+ env :
10
+ CARGO_TERM_COLOR : always
11
+ CARGO_INCREMENTAL : 1 # since we cache
12
+
13
+ jobs :
14
+ test_veryl :
15
+ strategy :
16
+ matrix :
17
+ os : [ubuntu-latest, macos-15]
18
+ runs-on : ${{ matrix.os }}
19
+ steps :
20
+ - uses : actions/checkout@v4
21
+ - uses : dtolnay/rust-toolchain@stable
22
+ - uses : Swatinem/rust-cache@v2
23
+ - name : Install Verilator
24
+ run : |
25
+ if [[ "$(uname)" == "Darwin" ]]; then
26
+ brew install verilator
27
+ else
28
+ sudo apt-get install -y verilator
29
+ fi
30
+ - name : Install Veryl
31
+ uses : veryl-lang/setup-veryl@v1
32
+ - name : Test
33
+ run : veryl build && cargo test
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ edition = "2024"
6
6
[dependencies ]
7
7
8
8
[dev-dependencies ]
9
- marlin = { version = " 0.5.0 " , features = [" veryl" ] }
9
+ marlin = { version = " 0.6.1 " , features = [" veryl" ] }
10
10
snafu = " 0.8.5"
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ fn test_alu() -> Result<(), Whatever> {
92
92
To run tests and capture the output:
93
93
94
94
``` shell
95
+ veryl build
95
96
cargo test -- --nocapture
96
97
```
97
98
Original file line number Diff line number Diff line change 1
- // file: tests/simple_test.rs
1
+ use std:: env;
2
+
2
3
use marlin:: veryl:: prelude:: * ;
3
4
use snafu:: Whatever ;
4
5
@@ -12,8 +13,9 @@ pub struct Alu32;
12
13
#[ snafu:: report]
13
14
fn test_full_adder ( ) -> Result < ( ) , Whatever > {
14
15
let runtime = VerylRuntime :: new ( VerylRuntimeOptions {
15
- call_veryl_build : true , /* warning: not thread safe! don't use if you
16
- * have multiple tests */
16
+ call_veryl_build : env:: var ( "RUNNING_TESTS_INDEPENDENTLY" )
17
+ . map ( |value| & value == "1" )
18
+ . unwrap_or ( false ) ,
17
19
..Default :: default ( )
18
20
} ) ?;
19
21
@@ -68,8 +70,9 @@ fn test_alu() -> Result<(), Whatever> {
68
70
}
69
71
70
72
let runtime = VerylRuntime :: new ( VerylRuntimeOptions {
71
- call_veryl_build : true , /* warning: not thread safe! don't use if you
72
- * have multiple tests */
73
+ call_veryl_build : env:: var ( "RUNNING_TESTS_INDEPENDENTLY" )
74
+ . map ( |value| & value == "1" )
75
+ . unwrap_or ( false ) ,
73
76
..Default :: default ( )
74
77
} ) ?;
75
78
You can’t perform that action at this time.
0 commit comments