Skip to content

Commit 0a74479

Browse files
authored
Add Linux smoke test (#3005)
1 parent a729410 commit 0a74479

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

.github/workflows/clippy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ jobs:
184184
run: cargo clippy -p test_interop
185185
- name: Clippy test_lib
186186
run: cargo clippy -p test_lib
187+
- name: Clippy test_linux
188+
run: cargo clippy -p test_linux
187189
- name: Clippy test_literals
188190
run: cargo clippy -p test_literals
189191
- name: Clippy test_match
@@ -216,8 +218,6 @@ jobs:
216218
run: cargo clippy -p test_return_struct
217219
- name: Clippy test_riddle
218220
run: cargo clippy -p test_riddle
219-
- name: Clippy test_simple_component
220-
run: cargo clippy -p test_simple_component
221221
- name: Clippy test_standalone
222222
run: cargo clippy -p test_standalone
223223
- name: Clippy test_string_param

.github/workflows/linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ jobs:
1919
uses: actions/checkout@v4
2020
- name: Update toolchain
2121
run: rustup update --no-self-update stable && rustup default stable
22-
- name: Run cargo build
23-
run: cargo build -p test_simple_component --target x86_64-unknown-linux-gnu
22+
- name: Run cargo test
23+
run: cargo test -p test_linux --target x86_64-unknown-linux-gnu

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ jobs:
210210
run: cargo test -p test_interop --target ${{ matrix.target }} ${{ matrix.etc }}
211211
- name: Test test_lib
212212
run: cargo test -p test_lib --target ${{ matrix.target }} ${{ matrix.etc }}
213+
- name: Test test_linux
214+
run: cargo test -p test_linux --target ${{ matrix.target }} ${{ matrix.etc }}
213215
- name: Test test_literals
214216
run: cargo test -p test_literals --target ${{ matrix.target }} ${{ matrix.etc }}
215217
- name: Test test_match
@@ -242,8 +244,6 @@ jobs:
242244
run: cargo test -p test_return_struct --target ${{ matrix.target }} ${{ matrix.etc }}
243245
- name: Test test_riddle
244246
run: cargo test -p test_riddle --target ${{ matrix.target }} ${{ matrix.etc }}
245-
- name: Test test_simple_component
246-
run: cargo test -p test_simple_component --target ${{ matrix.target }} ${{ matrix.etc }}
247247
- name: Test test_standalone
248248
run: cargo test -p test_standalone --target ${{ matrix.target }} ${{ matrix.etc }}
249249
- name: Test test_string_param
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
[package]
2-
name = "test_simple_component"
2+
name = "test_linux"
33
version = "0.0.0"
44
edition = "2021"
55
publish = false
66

7-
[lib]
8-
crate-type = ["cdylib"]
9-
107
[dependencies.windows]
118
path = "../../libs/windows"
129
features = [
10+
"Foundation",
1311
"Win32_Foundation",
1412
]

crates/tests/linux/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use windows::core::*;
2+
3+
#[test]
4+
fn test() {
5+
unsafe {
6+
let s: PCSTR = s!("hello world");
7+
assert_eq!(s.to_string().unwrap(), "hello world");
8+
9+
// TODO: https://github.com/microsoft/windows-rs/pull/3004 should enable the following test.
10+
// let w: PCWSTR = w!("wide world");
11+
// assert_eq!(w.to_string().unwrap(), "wide world");
12+
}
13+
}

crates/tests/simple_component/src/lib.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)