Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux smoke test #3005

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
Comment on lines +9 to +11
Copy link
Collaborator Author

@kennykerr kennykerr Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tyilo please uncomment this test in your PR... once I merge this PR.

}
}
10 changes: 0 additions & 10 deletions crates/tests/simple_component/src/lib.rs

This file was deleted.