-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[android] Run tests for libdispatch in x64 emulator (wip) #78762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
weliveindetail
wants to merge
32
commits into
swiftlang:main
from
weliveindetail:android-ctest-libdispatch
Closed
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e3d3571
[android] Run tests for libdispatch in x64 emulator (wip)
weliveindetail 00a6f90
fixup! [android] Run tests for libdispatch in x64 emulator (wip)
weliveindetail d025ab2
[dev] Temporarily enable Android x86_64 in CI and test only dispatch
weliveindetail e256dff
Properly spawn and shutdown both, adb and the emulator
weliveindetail 39c6b90
Switch to cross-compiled ctest driver
weliveindetail b9f18c0
For the moment install Java Runtime on the fly
weliveindetail e2a0912
Fix invalid 'zip is already extracted and up to date'
weliveindetail ff8a9fa
Add timer for FetchDependencies
weliveindetail 366071a
utils: trim whitespace in build.ps1 (NFC)
weliveindetail bbc7c01
Don't mix up release NDK with the one installed via cmdline-tools
weliveindetail 1d00e4b
Disable interactive mode in avdmanager
weliveindetail 69bb836
Fix emulator path, drop ndk package, add comments
weliveindetail f9dd2f3
Rename: NDKDir -> SDKDir
weliveindetail 37b97bb
Revert "Switch to cross-compiled ctest driver"
weliveindetail b3f8b3e
Polish script-based driver
weliveindetail caddf13
Use proposed ctest-android.sh from libdispatch
weliveindetail b23e171
[dev] Add version dumps to see what runs and what hangs
weliveindetail 06ef134
[dev] Actually log device info before we run into wait-for-device for…
weliveindetail 46c9954
[dev] Avoid exit if get-state fails and dump even more logs
weliveindetail 61e96ca
[dev] Temporarily drop stdout/stderr redirects from Start-Process
weliveindetail 4ebddee
Merge branch 'main' into android-ctest-libdispatch
weliveindetail 4d0d2c7
[dev] Temporarily drop log dumps as well
weliveindetail cc59b11
[dev] Dump virtual devices with avdmanager to confirm that swift-test…
weliveindetail d328dcb
Set Java environment again when starting the emulator
weliveindetail 26cfa08
[dev] Run and teardown the emulator with debug output and multipe att…
weliveindetail c2d9b34
Running avdmanager via Start-Process fixes the emulator crashes
weliveindetail f933288
Let's grant adb a few more attempts
weliveindetail d68524a
Merge branch 'main' into android-ctest-libdispatch
weliveindetail 984688d
Try to grant network access permission to adb
weliveindetail a3595d7
[dev] More emulator params and dump verbose outputs
weliveindetail f12cf68
[dev] Run -accel-check and dump the output
weliveindetail c63f016
Dump logs in erro case as well
weliveindetail File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/system/bin/sh | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <sub-directory>" | ||
exit 1 | ||
fi | ||
|
||
SUB_DIR=$1 | ||
if [ ! -d "$SUB_DIR" ]; then | ||
echo "Error: Directory $SUB_DIR does not exist" | ||
exit 1 | ||
fi | ||
|
||
UTILITY="$SUB_DIR/bsdtestharness" | ||
if [ ! -f "$UTILITY" ]; then | ||
echo "Utility not found: $UTILITY." | ||
exit 1 | ||
fi | ||
|
||
# FIXME: Add this script to libdispatch and let CMake inject actual test at configuration time | ||
TESTS="apply api debug queue_finalizer overcommit context_for_key after timer timer_short timer_timeout sema timer_bit31 timer_bit63 timer_set_time data io_muxed io_net io_pipe io_pipe_close select c99 plusplus" | ||
COUNT=$(echo "$TESTS" | tr ' ' '\n' | wc -l) | ||
echo "Found $COUNT test-cases in $SUB_DIR" | ||
|
||
# Tests depend on libdispatch.so and libBlocksRuntime.so | ||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SUB_DIR" | ||
|
||
TIMOUT=120 | ||
FAILURE=0 | ||
chmod +x "$UTILITY" | ||
|
||
for TEST in $TESTS; do | ||
chmod +x "$SUB_DIR/dispatch_$TEST" | ||
OUTPUT=$(timeout "${TIMOUT}s" "$UTILITY" "$SUB_DIR/dispatch_$TEST" 2>&1) | ||
EC=$? | ||
if [ $EC -eq 124 ]; then | ||
echo "Error: dispatch_$TEST timed out after $TIMOUT seconds" | ||
echo "************\nOutput:\n$OUTPUT\n************" | ||
FAILURE=1 | ||
elif [ $EC -ne 0 ]; then | ||
echo "Error: dispatch_$TEST failed" | ||
echo "************\nOutput:\n$OUTPUT\n************" | ||
FAILURE=1 | ||
else | ||
echo "dispatch_$TEST passed" | ||
fi | ||
done | ||
|
||
exit $FAILURE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the build bot hangs here in
adb wait-for-device