transcribe.cpp icon indicating copy to clipboard operation
transcribe.cpp copied to clipboard

fix(tests): make unit tests build on Windows

Open raykuo998 opened this issue 4 months ago • 1 comments

Summary

This PR fixes several Windows compatibility issues in the unit tests that prevented the project from building with llvm-mingw on Windows ARM64.

The production targets (transcribe and transcribe-cli) already built successfully, but the test suite used a few POSIX-specific APIs that are unavailable on Windows.

Changes

  • Replace the POSIX-only mkstemps usage with a cross-platform implementation.
  • Replace setenv with the appropriate Windows implementation where necessary.
  • Fix std::filesystem::path handling so Windows wide-character paths are passed correctly.

Verification

Built successfully on:

  • Windows 11 ARM64 (Snapdragon X2 Plus)
  • llvm-mingw 20260616 (ucrt-aarch64)
  • CMake 4.4.0
  • Ninja

Both the library and the complete test suite now build successfully.

raykuo998 avatar Jul 19 '26 20:07 raykuo998

Thanks for this. I'll take a look when I can and try to pull it in. I don't have a Windows ARM machine to test on other than CI, so I'll try to push this through CI and just make sure it works.

cjpais avatar Jul 19 '26 23:07 cjpais

@raykuo998 I believe ccfe885 has fixed this, let me know

cjpais avatar Jul 30 '26 10:07 cjpais