Skip to content

Commit

Permalink
Test samples (#1456)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Jan 25, 2022
1 parent e06c6bf commit 904f4f8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,23 @@ jobs:
cargo test --target ${{ matrix.other }} -p test_implement_no_use
cargo test --target ${{ matrix.other }} -p test_implement_null_result
cargo test --target ${{ matrix.other }} -p test_implement_winrt
cargo test --target ${{ matrix.other }} -p com_uri
cargo test --target ${{ matrix.other }} -p core_app
cargo test --target ${{ matrix.other }} -p create_window
cargo test --target ${{ matrix.other }} -p create_window_sys
cargo test --target ${{ matrix.other }} -p direct2d
cargo test --target ${{ matrix.other }} -p direct3d12
cargo test --target ${{ matrix.other }} -p enum_windows
cargo test --target ${{ matrix.other }} -p enum_windows_sys
cargo test --target ${{ matrix.other }} -p kernel_event
cargo test --target ${{ matrix.other }} -p memory_buffer
cargo test --target ${{ matrix.other }} -p message_box
cargo test --target ${{ matrix.other }} -p ocr
cargo test --target ${{ matrix.other }} -p overlapped
cargo test --target ${{ matrix.other }} -p rss
cargo test --target ${{ matrix.other }} -p simple
cargo test --target ${{ matrix.other }} -p spellchecker
cargo test --target ${{ matrix.other }} -p uiautomation
cargo test --target ${{ matrix.other }} -p xaml_app
cargo test --target ${{ matrix.other }} -p xml
if: contains(matrix.rust, 'nightly')
11 changes: 11 additions & 0 deletions crates/tools/yml/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ jobs:
}
}

if let Ok(files) = std::fs::read_dir(root.join("crates/samples")) {
for file in files.filter_map(|file| file.ok()) {
if let Ok(file_type) = file.file_type() {
if file_type.is_dir() {
let name = file.file_name().to_str().unwrap().to_string();
yml.write_all(format!(" cargo test --target ${{{{ matrix.other }}}} -p {}\n", name).as_bytes()).unwrap();
}
}
}
}

yml.write_all(
r#" if: contains(matrix.rust, 'nightly')
"#
Expand Down

0 comments on commit 904f4f8

Please sign in to comment.