Skip to content

Commit a85a120

Browse files
committed
fix false positive oob test
Resolves: COMPMID-8680 Signed-off-by: Walid BEN ROMDHANE <[email protected]>
1 parent e3ad029 commit a85a120

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

scripts/build_android_ndk_guide.sh

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ function BuildStandaloneDynamicBackend {
401401
# push sources to board
402402
function PushBuildSourcesToBoard {
403403
cd $WORKING_DIR/armnn/build
404-
adb start-server
405404
adb shell rm -rf /data/local/tmp/*
406405
echo "+++ Pushing sources to board"
407406
adb root
@@ -451,10 +450,31 @@ function PushBuildSourcesToBoard {
451450
adb push -p ${WORKING_DIR}/armnn/src/dynamic/sample/build/libArm_SampleDynamic_backend.so /data/local/tmp/dynamic/sample/
452451
fi
453452
echo "+++ Running UnitTests"
454-
adb shell LD_LIBRARY_PATH=/data/local/tmp:/vendor/lib64:/vendor/lib64/egl /data/local/tmp/UnitTests ; printf $?
453+
adb shell LD_LIBRARY_PATH=/data/local/tmp:/vendor/lib64:/vendor/lib64/egl /data/local/tmp/UnitTests
454+
TEST_RESULT=$?
455+
printf '%s\n' "$TEST_RESULT"
456+
if [[ $TEST_RESULT -ne 0 ]]; then
457+
echo "Tests failed"
458+
exit 1
459+
fi
455460
if [[ $DELEGATE == 1 ]]; then
456-
adb shell LD_LIBRARY_PATH=/data/local/tmp:/vendor/lib64:/vendor/lib64/egl /data/local/tmp/DelegateUnitTests ; printf $?
461+
adb shell LD_LIBRARY_PATH=/data/local/tmp:/vendor/lib64:/vendor/lib64/egl /data/local/tmp/DelegateUnitTests
462+
TEST_RESULT=$?
463+
printf '%s\n' "$TEST_RESULT"
464+
if [[ $TEST_RESULT -ne 0 ]]; then
465+
echo "DelegateTests failed"
466+
exit 1
467+
fi
468+
fi
469+
}
470+
471+
verifyAdbConnection() {
472+
adb devices | grep -w "device" > /dev/null
473+
if [[ $? != 0 ]]; then
474+
echo "No connected Android device found. Please connect a device and enable ADB."
475+
return 1
457476
fi
477+
return 0
458478
}
459479

460480
# Cleanup any previous runs, setup clean directories
@@ -506,6 +526,7 @@ fi
506526
if [[ $DYNAMIC_SAMPLE == 1 ]]; then
507527
BuildStandaloneDynamicBackend
508528
fi
529+
verifyAdbConnection
509530
if [[ $PUSH_TO_BOARD == 1 ]]; then
510531
PushBuildSourcesToBoard
511532
fi

0 commit comments

Comments
 (0)