mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-22 07:58:02 +00:00
* core, ui: plan name alert tests against core fixtures * core: write name lookup responses to app fixtures in name tests * android, desktop: name alerts tested against core fixtures * core, ios: plan Swift fixtures and iOS unit tests of name alerts * core: write name lookup responses in the Swift form to iOS fixtures * ios: name alerts tested against core fixtures * core: write both app fixtures of a name test in one run * ui: add name lookup responses written by the core tests as fixtures * core: keep the fixture writer of name tests to the forms it receives * desktop: run name alert tests in the US locale * ios: one switch for the title and effect of name alert actions * docs: name alert tests in the app specs, CI guide and plan * docs: known gaps of the name alert tests in the plan * ui: restore the name alert code and the iOS project of master * core: record name lookup responses and name parses for app tests * android, desktop: test name alerts of planAndConnect on recorded responses * ci: run the app tests for a change of the name fixtures * core: name lookup responses and name parses recorded by the core tests * docs: plan of app views tested on core responses * ios: test name alerts of planAndConnect on recorded responses * ci: iOS unit tests in the iOS job, the app launched on stub migrations * android, desktop: core hooks below the externals, in the specs * ios: name alert tests compile with the converter at file scope * ui: the moved name test expects the alert to open a chat with the new address * core, ui: app test fixtures under tests/fixtures/api * core: record the responses of the name lookup flows that the apps test * core: record URI parses, and normalize the random values of fixtures * android, desktop: URI parse hook and event processing for tests * ios: URI parse hook for tests * desktop: full failure messages of tests * core: domain errors view compiles with GHC 8.10.7 * core: normalize parses and profile send times in fixtures * core: record the parses of the chat list search * core: recorded responses of the name flows and the contact address * android, desktop: test name alerts, buttons, search and name view * ios: test name alerts, buttons, search and the moved event * docs: plan, specs and CI guide of the app tests
41 lines
1.4 KiB
Bash
Executable File
41 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Creates stub static libraries in apps/ios/Libraries/sim so that the iOS app
|
|
# links for the simulator without the Haskell core.
|
|
# Run from repo root on macOS.
|
|
|
|
set -eu
|
|
|
|
IOS_DIR=apps/ios
|
|
PBXPROJ=$IOS_DIR/SimpleX.xcodeproj/project.pbxproj
|
|
OUT_DIR=$IOS_DIR/Libraries/sim
|
|
ARCH=arm64
|
|
MIN_IOS=15.0
|
|
|
|
tmp=$(mktemp -d)
|
|
trap 'rm -rf "$tmp"' EXIT
|
|
|
|
# The linker resolves symbols by name only, so the stub signatures are not checked.
|
|
sed -n 's/^extern [^(]*[ *]\([a-z_]*\)(.*/\1/p' "$IOS_DIR/SimpleXChat/SimpleX.h" "$IOS_DIR/SimpleXChat/hs_init.c" \
|
|
| sort -u | sed -E -e 's/^(chat_migrate_init|chat_migrate_init_key)$/void *calloc(unsigned long, unsigned long); char *\1(void) { return calloc(1, 1); }/' -e t -e 's/.*/void &(void) {}/' > "$tmp/stubs.c"
|
|
|
|
if [ ! -s "$tmp/stubs.c" ]; then
|
|
echo "Error: no extern functions found in SimpleX.h and hs_init.c" >&2
|
|
exit 1
|
|
fi
|
|
|
|
xcrun --sdk iphonesimulator clang -arch "$ARCH" -mios-simulator-version-min="$MIN_IOS" -c "$tmp/stubs.c" -o "$tmp/stubs.o"
|
|
xcrun ar rcs "$tmp/libstubs.a" "$tmp/stubs.o"
|
|
|
|
libs=$(sed -n 's/.*isa = PBXFileReference; lastKnownFileType = archive\.ar; path = "\{0,1\}\(lib[^";]*\.a\)"\{0,1\};.*/\1/p' "$PBXPROJ")
|
|
if [ -z "$libs" ]; then
|
|
echo "Error: no static library references found in $PBXPROJ" >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$OUT_DIR"
|
|
echo "$libs" | while IFS= read -r lib; do
|
|
cp "$tmp/libstubs.a" "$OUT_DIR/$lib"
|
|
echo "$OUT_DIR/$lib"
|
|
done
|