CodeVetter · Repo Unpack · Testing signals
Genymobile/scrcpy
Client tests are 12 assert-based C programs in app/tests, each compiled as a Meson test() executable — but only when buildtype=debug so asserts execute. They cover adb parsing, binary helpers, CLI parsing, control-message serialization, device-message deserialization, orientation parsing, string/strbuf/vecdeque/vector containers and Windows command building. Server tests are JUnit4 in server/src/test covering ControlMessageReader, DeviceMessageWriter, CodecOptions, BinarySearch, Binary, CommandParser and StringUtils. CI runs release/test_server.sh (gradle test) and release/test_client.sh (meson test) plus a build-without-gradle check; there is no end-to-end socket-protocol or UI test coverage.
- app/tests contains 12 test files (test_adb_parser, test_audiobuf, test_binary, test_cli, test_command_windows, test_control_msg_serialize, test_device_msg_deserialize, test_orientation, test_str, test_strbuf, test_vecdeque, test_vector) registered as meson test() targets.
- Tests are only built when get_option('buildtype') == 'debug', because the tests are plain assert()-based programs compiled with -DSC_TEST.
- Serialization is tested at the byte level: test_control_msg_serialize asserts exact serialized layouts (e.g. INJECT_KEYCODE == 14 bytes with specific keycode/metastate encoding).
- Server unit tests (JUnit 4.13.2) live in server/src/test/java under control/, model/, util/: ControlMessageReaderTest, DeviceMessageWriterTest, CodecOptionsTest, BinarySearchTest, BinaryTest, CommandParserTest, StringUtilsTest.
- CI job test-scrcpy-server runs release/test_server.sh on ubuntu-latest with JDK 17 (zulu) using native gradle.
- CI job test-client installs meson/ffmpeg/SDL deps (SDL3 built by app/deps/sdl.sh since it is not packaged in Ubuntu) and runs release/test_client.sh.
- A dedicated CI job builds the server without Gradle via server/build_without_gradle.sh, keeping the manual javac/d8 path tested.
- Both sides test the same protocol independently (client serializer tests vs server reader tests) but no test exercises a real socket round-trip between client and server; protocol drift would only be caught manually. (inferred)
- No tests exist for demuxer, decoder, recorder, screen, server.c, adb process management or any SDL/audio playback path — the largest files (cli.c, screen.c, recorder.c, server.c) are exercised only manually or via release scripts. (inferred)
- test_cli compiles the real cli.c+options.c, so option-table regressions (missing longopt, bad argdesc) are caught in CI.