From b440384004ce4cfd4f06e30c7b30e460941839c1 Mon Sep 17 00:00:00 2001 From: danny Date: Mon, 30 Dec 2024 00:13:53 +0900 Subject: [PATCH] wip --- .github/workflows/cool_tests.yml | 43 ++++++++++++++++++++++---------- src/test.rs | 5 ++++ 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cool_tests.yml b/.github/workflows/cool_tests.yml index 5b8155d1..a868ab58 100644 --- a/.github/workflows/cool_tests.yml +++ b/.github/workflows/cool_tests.yml @@ -62,21 +62,39 @@ jobs: run: just test macos: - runs-on: macos-latest + runs-on: macos-latest + + steps: + - name: Install dependencies + run: | + brew update + brew install lame libvorbis just + + - name: Debug environment + run: | + which lame + + - name: Set library path + run: | + export LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH + export LD_LIBRARY_PATH=/opt/homebrew/lib:$LD_LIBRARY_PATH - steps: - - name: install dependancies - run: brew install lame libvorbis just - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 with: - toolchain: stable - override: true + toolchain: stable + override: true + - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - key: "weresocool-windows" - - name: run tests + key: "weresocool-macos" + + - name: Run tests + env: + LIBRARY_PATH: /opt/homebrew/lib:$LIBRARY_PATH + LD_LIBRARY_PATH: /opt/homebrew/lib:$LD_LIBRARY_PATH run: just test windows: @@ -84,12 +102,11 @@ jobs: steps: - name: start audiosrv run: net start audiosrv - - name: install scream + - name: Install scream (non-admin) run: | - Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.8/Scream3.8.zip -OutFile Scream3.8.zip - Expand-Archive -Path Scream3.8.zip -DestinationPath Scream - Import-Certificate -FilePath Scream\Install\driver\x64\Scream.cat -CertStoreLocation Cert:\LocalMachine\TrustedPublisher - Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream + Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.8/Scream3.8.zip -OutFile Scream3.8.zip + Expand-Archive -Path Scream3.8.zip -DestinationPath Scream + Write-Host "Skipping certificate and driver installation due to lack of admin privileges." - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/src/test.rs b/src/test.rs index b284c68b..5168a1e8 100644 --- a/src/test.rs +++ b/src/test.rs @@ -110,6 +110,8 @@ mod cli_tests { #[cfg(target_os = "linux")] let expected_filename = "src/test_data/play_unix.mp3"; + dbg!(&expected_filename); + let written_filename = format!("{}/play.mp3", tmp_dir.path().display()); assert_same_bytes(expected_filename, &written_filename); } @@ -193,6 +195,9 @@ mod cli_tests { let expected_read = std::fs::read(expected_filename).expect("Something went wrong reading file"); + fmt::Debug::fmt(&written_read, &mut std::io::stdout()); + fmt::Debug::fmt(&expected_read, &mut std::io::stdout()); + assert!(written_read == expected_read); }