File tree Expand file tree Collapse file tree 5 files changed +77
-12
lines changed
Expand file tree Collapse file tree 5 files changed +77
-12
lines changed Original file line number Diff line number Diff line change 99jobs :
1010 tests :
1111 name : Tests
12- runs-on : ubuntu-latest
12+ runs-on : ${{ matrix.os }}
13+ strategy :
14+ matrix :
15+ os : [ ubuntu-latest, windows-latest ]
1316 steps :
1417 - uses : actions/checkout@v4
1518 - uses : dtolnay/rust-toolchain@stable
1619 - uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3
17- - uses : hrishikesh-kadam/setup-lcov@v1
20+ - uses : hrishikesh-kadam/setup-lcov@6c1aa0cc9e1c02f9f58f01ac599f1064ccc83470 # v1.1.0
1821 - uses : software-mansion/setup-scarb@v1
19- - uses : foundry-rs/setup-snfoundry@v3
22+ - uses : foundry-rs/setup-snfoundry@v4
2023 - run : cargo test --release
2124
2225 rustfmt :
Original file line number Diff line number Diff line change @@ -30,3 +30,4 @@ indoc = "2.0.5"
3030regex = " 1.11.1"
3131rayon = " 1.10.0"
3232walkdir = " 2.5.0"
33+ which = " 7.0.2"
Original file line number Diff line number Diff line change @@ -14,4 +14,5 @@ walkdir.workspace = true
1414[dev-dependencies ]
1515cairo-coverage-test-utils = { path = " ../cairo-coverage-test-utils" }
1616assert_fs.workspace = true
17- snapbox.workspace = true
17+ snapbox.workspace = true
18+ which.workspace = true
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use camino::Utf8PathBuf;
55use snapbox:: cmd:: { cargo_bin, Command as SnapboxCommand } ;
66use std:: fs;
77use std:: path:: PathBuf ;
8+ use which:: which;
89
910pub struct TestProject {
1011 dir : TempDir ,
@@ -92,7 +93,9 @@ impl TestProject {
9293 }
9394
9495 fn run_genhtml ( self ) -> Self {
95- SnapboxCommand :: new ( "genhtml" )
96+ // on windows, we need to use the full path to genhtml or otherwise this will fail
97+ let path = which ( "genhtml" ) . unwrap ( ) ;
98+ SnapboxCommand :: new ( path)
9699 . arg ( self . output_lcov_path ( ) )
97100 . arg ( "--output-directory" )
98101 . arg ( self . dir . path ( ) )
@@ -114,6 +117,16 @@ impl TestProjectOutput {
114117 "{dir}" ,
115118 & self . 0 . dir . canonicalize ( ) . unwrap ( ) . display ( ) . to_string ( ) ,
116119 ) ;
120+
121+ let expected = if cfg ! ( target_os = "windows" ) {
122+ expected
123+ . replace ( "\r \n " , "\n " ) // Normalize line endings
124+ . replace ( '/' , r"\" ) // Convert Unix-style paths to Windows
125+ . replace ( r"\\?\" , "" ) // Remove extended path prefix
126+ } else {
127+ expected
128+ } ;
129+
117130 assert_eq ! ( content, expected) ;
118131 }
119132
You can’t perform that action at this time.
0 commit comments