Skip to content

Commit

Permalink
Merge branch 'master' into fix_xcframeworks_plists
Browse files Browse the repository at this point in the history
  • Loading branch information
zavsby authored Sep 12, 2024
2 parents a9aa138 + 421d428 commit 7aeca56
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
19 changes: 16 additions & 3 deletions apple/testing/default_runner/ios_xctestrun_runner.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,25 @@ if [[ -e "$main_thread_checker" ]]; then
main_thread_checker_dyld_env="$main_thread_checker"
fi

xctestrun_libraries="__PLATFORMS__/$test_execution_platform/Developer/usr/lib/libXCTestBundleInject.dylib"
xctestrun_libraries=""
if [[ "$test_type" != "XCUITEST" ]]; then
xctestrun_libraries="__PLATFORMS__/$test_execution_platform/Developer/usr/lib/libXCTestBundleInject.dylib"
fi

if [[ -n "$sanitizer_dyld_env" ]]; then
xctestrun_libraries="${xctestrun_libraries}:${sanitizer_dyld_env}"
if [[ -n "$xctestrun_libraries" ]]; then
xctestrun_libraries="${xctestrun_libraries}:${sanitizer_dyld_env}"
else
xctestrun_libraries="${sanitizer_dyld_env}"
fi
fi

if [[ -n "$main_thread_checker_dyld_env" ]]; then
xctestrun_libraries="${xctestrun_libraries}:${main_thread_checker_dyld_env}"
if [[ -n "$xctestrun_libraries" ]]; then
xctestrun_libraries="${xctestrun_libraries}:${main_thread_checker_dyld_env}"
else
xctestrun_libraries="${main_thread_checker_dyld_env}"
fi
fi

TEST_FILTER="%(test_filter)s"
Expand Down
14 changes: 7 additions & 7 deletions test/ios_coverage_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,26 +246,26 @@ EOF

function test_standalone_unit_test_coverage() {
create_common_files
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap //app:standalone_test || fail "Should build"
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap --zip_undeclared_test_outputs //app:standalone_test || fail "Should build"
assert_contains "SharedLogic.m:-\[SharedLogic doSomething\]" "test-testlogs/app/standalone_test/coverage.dat"
}

function test_standalone_unit_test_coverage_new_runner() {
create_common_files
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap //app:standalone_test_new_runner || fail "Should build"
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap --zip_undeclared_test_outputs //app:standalone_test_new_runner || fail "Should build"
assert_contains "SharedLogic.m:-\[SharedLogic doSomething\]" "test-testlogs/app/standalone_test/coverage.dat"
}

function test_standalone_unit_test_coverage_json() {
create_common_files
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap --test_env=COVERAGE_PRODUCE_JSON=1 //app:standalone_test || fail "Should build"
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap --zip_undeclared_test_outputs --test_env=COVERAGE_PRODUCE_JSON=1 //app:standalone_test || fail "Should build"
unzip_single_file "test-testlogs/app/standalone_test/test.outputs/outputs.zip" coverage.json \
grep -q '"name":"SharedLogic.m:-\[SharedLogic doSomething\]"'
}

function test_standalone_unit_test_coverage_coverage_manifest() {
create_common_files
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap //app:coverage_manifest_test || fail "Should build"
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap --zip_undeclared_test_outputs //app:coverage_manifest_test || fail "Should build"
assert_contains "SharedLogic.m:-\[SharedLogic doSomething\]" "test-testlogs/app/coverage_manifest_test/coverage.dat"
assert_contains "SF:app/SharedLogic.m" "test-testlogs/app/coverage_manifest_test/coverage.dat"
cat "test-testlogs/app/coverage_manifest_test/coverage.dat"
Expand All @@ -274,7 +274,7 @@ function test_standalone_unit_test_coverage_coverage_manifest() {

function test_standalone_unit_test_coverage_coverage_manifest_new_runner() {
create_common_files
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap //app:coverage_manifest_test_new_runner || fail "Should build"
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap --zip_undeclared_test_outputs //app:coverage_manifest_test_new_runner || fail "Should build"
assert_contains "SharedLogic.m:-\[SharedLogic doSomething\]" "test-testlogs/app/coverage_manifest_test_new_runner/coverage.dat"
assert_contains "SF:app/SharedLogic.m" "test-testlogs/app/coverage_manifest_test_new_runner/coverage.dat"
cat test-testlogs/app/coverage_manifest_test_new_runner/coverage.dat
Expand All @@ -283,7 +283,7 @@ function test_standalone_unit_test_coverage_coverage_manifest_new_runner() {

function test_hosted_unit_test_coverage() {
create_common_files
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap //app:hosted_test || fail "Should build"
do_coverage ios --test_output=errors --ios_minimum_os=9.0 --experimental_use_llvm_covmap --zip_undeclared_test_outputs //app:hosted_test || fail "Should build"

# Validate normal coverage is included
assert_contains "SharedLogic.m:-\[SharedLogic doSomething\]" "test-testlogs/app/hosted_test/coverage.dat"
Expand All @@ -306,7 +306,7 @@ function test_hosted_unit_test_coverage() {

function test_ui_test_coverage_new_runner() {
create_common_files
do_coverage ios --test_output=errors --ios_minimum_os=15.0 --experimental_use_llvm_covmap //app:test_coverage_ui_test_new_runner || fail "Should build"
do_coverage ios --test_output=errors --ios_minimum_os=15.0 --experimental_use_llvm_covmap --zip_undeclared_test_outputs //app:test_coverage_ui_test_new_runner || fail "Should build"
assert_contains "DA:5,1" "test-testlogs/app/test_coverage_ui_test_new_runner/coverage.dat"
}

Expand Down

0 comments on commit 7aeca56

Please sign in to comment.