Skip to content

test(macos): make the test suite pass on macOS - #817

Merged
benjweaver merged 7 commits into
Nonary:canaryfrom
benjweaver:test/macos-test-suite
Dec 3, 2026
Merged

benjweaver merged 7 commits into
Nonary:canaryfrom
benjweaver:test/macos-test-suite

Conversation

@benjweaver

Copy link
Copy Markdown
Collaborator

Summary

A Release build of canary with -DBUILD_WERROR=ON -DBUILD_TESTS=ON and ctest -j8 on macOS 27 / Xcode 27 failed to build one test and failed 8 tests. Every cause was in the test harnesses, none in host code. This fixes each cause rather than skipping tests on macOS; Linux and Windows behavior is unchanged.

  • Python-driven harnesses (regression_remote_input_reconnect, regression_selected_output_fallback, regression_amf_output_first_retry)
    • The remote input harness gets OpenSSL's include directory from CMake along with JSON's (crypto.h needs openssl/evp.h, and Homebrew's OpenSSL is not on the default search path). The --json-include flag still works as an alias of the new --include-dirs.
    • The selected-output harness defined _WIN32 on the command line, which sends Apple's libc++ down its Windows <__locale> path (_SPACE undeclared). It now defines it in the generated program after the standard headers.
    • The AMF harness called std::max(size_t, uint64_t), which only deduces where both are unsigned long.
  • test_component_discovery_shutdown: the harness simulates Windows by undefining __linux__; it now also undefines __APPLE__, so the extracted probe code no longer calls the macOS-only platf::is_screen_capture_allowed().
  • test_component_log_export_reader (TruncationDuringReadIsReportedWithoutUnsignedUnderflow): macOS stdio fills its buffer during fseeko, so libc++'s filebuf returns the requested 100 bytes from before the truncation; libstdc++ returns 0. The test now checks the property in its name, that bytes_read stays within the request, along with truncated, changed, and empty data.
  • test_component_windows_steam_discovery: the death-test regex is terminat, matching both libstdc++'s "terminate called" and libc++abi's "terminating".
  • test_component_pyrowave_udp_probe (HandshakeIpv4): macOS assigns only 127.0.0.1 to lo0, so binding the wrong-IP sender to 127.0.0.2 failed with EADDRNOTAVAIL. Only that sub-check is skipped, with a note, when the address is unavailable.
  • test_component_paused_app_monitor: libc++ marks std::future::get [[nodiscard]], which failed the -Werror build. The test now asserts the observer's result (the pre-replacement snapshot, 1).
  • regression_web_build_makefiles: /usr/bin/make on macOS is GNU Make 3.81, which ignores sub-second timestamps. change_dependency now waits until the dependency's mtime is in a later whole second than the outputs.

Testing

  • macOS 27.2 (M1 Pro), Xcode 27.2, Release, -DBUILD_WERROR=ON -DBUILD_TESTS=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3, Ninja: build clean, ctest -j8 216/216 passed (twice). regression_web_build_makefiles failed 4 of 4 runs before its change and passed 3 of 3 after.
  • Linux (gcc:14 container): the four changed Python harnesses pass, and libstdc++ still reads 0 bytes in the truncation case and prints "terminate called…". The full Linux and Windows suites were not run locally; CI covers them.

AI assistance

This work was done with Claude Code using Claude Opus 5.5 at medium effort. I reviewed and tested the changes per the contributing guidelines.

The remote input harness now gets OpenSSL's include directory from CMake
along with JSON's, since crypto.h needs it and Homebrew's OpenSSL is not
on the default search path. The selected-output harness defines _WIN32
after the standard headers instead of on the command line, where it sent
Apple's libc++ down its Windows locale path. The AMF harness names the
std::max type, because uint64_t and size_t are distinct types on macOS.
The harness simulates Windows by undefining __linux__ and defining
_WIN32. On macOS the extracted probe code also took its __APPLE__
branch and called platf::is_screen_capture_allowed(), which the stubs
do not provide.
The truncation test now checks that bytes_read stays within the request
rather than expecting zero. macOS stdio fills its buffer while seeking,
so libc++'s filebuf can return the requested range from before the
truncation; libstdc++ reads nothing.

The Steam restoration death test matches "terminat", which covers both
libstdc++'s "terminate called" and libc++abi's "terminating".

The UDP handshake test skips only its wrong-IP sender when 127.0.0.2 is
unavailable. macOS assigns only 127.0.0.1 to lo0 unless an alias is
added, so the bind failed with EADDRNOTAVAIL.
libc++ marks std::future::get [[nodiscard]], so the discarded result
failed the build with -Werror. The observer returns the snapshot taken
before the replacement, so assert that it is 1.
GNU Make 3.81, which is /usr/bin/make on macOS, ignores sub-second
timestamps. A dependency rewritten within the same second as the last
build output looked unchanged, so npm did not rerun and the Makefiles
web build test failed.
benjweaver added a commit to benjweaver/Vibepollo that referenced this pull request Dec 3, 2026
@benjweaver
benjweaver merged commit 6fee743 into Nonary:canary Dec 3, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant