Skip to content

Commit

Permalink
test: Run tests in ZIG_COMMAND=zig environment
Browse files Browse the repository at this point in the history
Test the new `zig dlltool` command functionality.

Update unit tests to use the new builder API.
  • Loading branch information
ravenexp committed May 15, 2022
1 parent 15ee9db commit 07b4434
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ jobs:
- uses: actions/checkout@v3
- name: Install the MinGW and LLVM toolchains
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y mingw-w64 llvm
run: sudo apt-get install -y gcc-mingw-w64 llvm
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
zigbuild:
name: Test zig dlltool
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install LLVM binutils
run: sudo apt-get install -y llvm
- uses: goto-bus-stop/setup-zig@v1
- name: Run tests with zig
run: ZIG_COMMAND=zig cargo test --verbose
fmt:
name: Check code formatting
runs-on: ubuntu-latest
Expand Down
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ mod tests {
dir.push("x86_64-pc-windows-gnu");
dir.push("python3-dll");

ImportLibraryGenerator::new("x86_64", "gnu")
.generate(&dir)
.unwrap();

for minor in 7..=11 {
ImportLibraryGenerator::new("x86_64", "gnu")
.version(Some((3, minor)))
Expand All @@ -447,7 +451,10 @@ mod tests {
dir.push("x86_64-pc-windows-msvc");
dir.push("python3-dll");

generate_implib_for_target(&dir, "x86_64", "msvc").unwrap();
ImportLibraryGenerator::new("x86_64", "msvc")
.generate(&dir)
.unwrap();

for minor in 7..=11 {
ImportLibraryGenerator::new("x86_64", "msvc")
.version(Some((3, minor)))
Expand Down

0 comments on commit 07b4434

Please sign in to comment.