Skip to content

Leave the engine self-tests out of the APK - #269

Open
xroche wants to merge 1 commit into
masterfrom
drop-engine-selftests
Open

xroche wants to merge 1 commit into
masterfrom
drop-engine-selftests

Conversation

@xroche

@xroche xroche commented Oct 31, 2026

Copy link
Copy Markdown
Owner

The engine's self-tests were about 40% of libhttrack's compiled code, and nothing in the app can reach -#test. So the build now defines HTS_NO_SELFTEST and drops the 24 self-test sources. On a release build the unsigned APK falls from 24430732 to 22612108 bytes, and libhttrack.so loses about 10% on both ABIs.

There is no test here because the build already refuses each half alone. A self-test source compiled under the macro fails on the #error in htsselftest_int.h. Removing the macro while the sources are gone gives ld.lld: error: undefined symbol: hts_selftest.

The self-test sources were about 40% of libhttrack's compiled code, and
nothing in the app can reach -#test, which is the only entry point that
runs them. Engine #2036 added the HTS_NO_SELFTEST guard around that call
site, so define it here and drop the 24 self-test sources from the
libhttrack source list.

Both halves are needed. A self-test source compiled under the macro
fails on the #error in htsselftest_int.h, and defining nothing while the
sources are gone leaves hts_selftest undefined at link time.

Measured on a release build at pin b0972289: the unsigned APK falls from
24430732 to 22612108 bytes, libhttrack.so from 8619880 to 7732952 on
arm64-v8a and from 8943032 to 8015128 on x86_64.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
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