Skip to content

Commit

Permalink
Add Linux smoke test (#3005)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Apr 19, 2024
1 parent a729410 commit 0a74479
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ jobs:
run: cargo clippy -p test_interop
- name: Clippy test_lib
run: cargo clippy -p test_lib
- name: Clippy test_linux
run: cargo clippy -p test_linux
- name: Clippy test_literals
run: cargo clippy -p test_literals
- name: Clippy test_match
Expand Down Expand Up @@ -216,8 +218,6 @@ jobs:
run: cargo clippy -p test_return_struct
- name: Clippy test_riddle
run: cargo clippy -p test_riddle
- name: Clippy test_simple_component
run: cargo clippy -p test_simple_component
- name: Clippy test_standalone
run: cargo clippy -p test_standalone
- name: Clippy test_string_param
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
uses: actions/checkout@v4
- name: Update toolchain
run: rustup update --no-self-update stable && rustup default stable
- name: Run cargo build
run: cargo build -p test_simple_component --target x86_64-unknown-linux-gnu
- name: Run cargo test
run: cargo test -p test_linux --target x86_64-unknown-linux-gnu
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ jobs:
run: cargo test -p test_interop --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_lib
run: cargo test -p test_lib --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_linux
run: cargo test -p test_linux --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_literals
run: cargo test -p test_literals --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_match
Expand Down Expand Up @@ -242,8 +244,6 @@ jobs:
run: cargo test -p test_return_struct --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_riddle
run: cargo test -p test_riddle --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_simple_component
run: cargo test -p test_simple_component --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_standalone
run: cargo test -p test_standalone --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_string_param
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
[package]
name = "test_simple_component"
name = "test_linux"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]

[dependencies.windows]
path = "../../libs/windows"
features = [
"Foundation",
"Win32_Foundation",
]
1 change: 1 addition & 0 deletions crates/tests/linux/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

13 changes: 13 additions & 0 deletions crates/tests/linux/tests/strings.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use windows::core::*;

#[test]
fn test() {
unsafe {
let s: PCSTR = s!("hello world");
assert_eq!(s.to_string().unwrap(), "hello world");

// TODO: https://github.com/microsoft/windows-rs/pull/3004 should enable the following test.
// let w: PCWSTR = w!("wide world");
// assert_eq!(w.to_string().unwrap(), "wide world");
}
}
10 changes: 0 additions & 10 deletions crates/tests/simple_component/src/lib.rs

This file was deleted.

0 comments on commit 0a74479

Please sign in to comment.