Allows NSAutoreleasePool to deallocate even if it is not the topmost autoreleasepool for the current thread by deallocating all pools above it. This matches iOS Simulator behaviour. Change-Id: If62dec7f2160bf919cce8c094e2be879b3e4b477
Integration tests
This directory contains integration tests written in Objective-C. They're compiled to an ARMv6 Mach-O binary and packaged into a bundle (TestApp.app) so that they can be run in the emulator like a normal iPhone OS app. The code in integration.rs lets them be run by cargo test (which also runs unit tests written in Rust).
Building
Compiler Setup
Clang is required to build the TestApp binary, and should be placed (or symlinked) at tests/TestApp_build/llvm/bin/clang. While modern versions of clang may work fine, only clang 12 (listed below) is tested and used in CI.
- LLVM 12.0.1 Windows x64 release binaries (extract it with 7-zip)
- LLVM 12.0.0 macOS x64 release binaries (extract it with
tar -xf) - Other versions (though you might need to build LLVM yourself, sorry :c)
Extract LLVM to tests/llvm, so that tests/TestApp_build/llvm/bin/clang (with .exe suffix, on Windows) is the path to Clang.
Linker setup
A custom SDK with headers and a multiplatform version of Apple's ld is required to build the TestApp binary. To install it, download the latest release (or follow the instructions inside the repository to compile it), then extract/place/symlink the resultant directories as shown below. (On Windows, you may find it easier to use the precompiled binaries, since compiling requires mingw).
The overall structure of the tests directory should look like the following:
- tests
- integration.rs
- llvm
- bin
- clang
- common-3.0.sdk
- usr
- lib
- (sdk libraries)
- include
- (sdk headers)
- bin
- ld(.exe)
- lipo(.exe)
- TestApp_source
- TestApp.app
- libc_stub