[c#] Enable running the C# tests on linux (#1200) · bytecodealliance/wit-bindgen@86e8ae2 (original) (raw)

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -60,6 +60,10 @@ jobs:
60 60 os: [ubuntu-latest, macos-latest, windows-latest]
61 61 # moonbit removed from language matrix for now - causing CI failures
62 62 lang: [c, rust, teavm-java, go, csharp]
63 +exclude:
64 +# For now csharp doesn't work on macos, so exclude it from testing.
65 + - os: macos-latest
66 +lang: csharp
63 67 runs-on: ${{ matrix.os }}
64 68 steps:
65 69 - uses: actions/checkout@v4
@@ -73,7 +77,7 @@ jobs:
73 77 if: matrix.lang == 'rust'
74 78
75 79 - uses: ./.github/actions/install-wasi-sdk
76 -if: matrix.lang == 'c' |
80 +if: matrix.lang == 'c' |
77 81
78 82 - name: Setup .NET
79 83 uses: actions/setup-dotnet@v4
Original file line number Diff line number Diff line change
@@ -91,13 +91,20 @@ impl CSProjectLLVMBuilder {
91 91 );
92 92
93 93 if self.aot {
94 +let os = match std::env::consts::OS {
95 +"windows" => "win",
96 +"linux" => std::env::consts::OS,
97 + other => todo!("OS {} not supported", other),
98 +};
99 +
94 100 csproj.push_str(
95 -r#"
101 +&format!(
102 +r#"
96 103
97 104
98 -
105 +
99 106
100 - "#,
107 + "#),
101 108 );
102 109
103 110 fs::write(
Original file line number Diff line number Diff line change
@@ -659,7 +659,7 @@ fn tests(name: &str, dir_name: &str) -> Result<Vec> {
659 659 }
660 660
661 661 #[cfg(feature = "csharp")]
662 -if cfg!(windows) && !c_sharp.is_empty() {
662 +if !c_sharp.is_empty() {
663 663 let (resolve, world) = resolve_wit_dir(&dir);
664 664 for path in c_sharp.iter() {
665 665 let world_name = &resolve.worlds[world].name;