Name Description Size
generate_coverage_command.py Generates a command-line for coverage.py. Useful for manual coverage runs. Before running the generated command line, do this: gn gen out/coverage --args='use_clang_coverage=true is_component_build=false' 1616
generate_ios_coverage_command.py Generates command-line instructions to produce one-time iOS coverage using coverage.py. This script is usable for both real devices and simulator. But for real devices actual execution should be done manually from Xcode and coverage.profraw files should be also copied manually from the device. Additional prerequisites: 1. Xcode 10+ with iPhone Simulator SDK. Can be installed by command: $ mac_toolchain install -kind ios -xcode-version 10l232m \ -output-dir build/mac_files/Xcode.app 2. For computing coverage on real device you probably also need to apply following patch to code_coverage/coverage.py script: ========== BEGINNING OF PATCH ========== --- a/code_coverage/coverage.py +++ b/code_coverage/coverage.py @@ -693,8 +693,7 @@ def _AddArchArgumentForIOSIfNeeded(cmd_list, num_archs): to use, and one architecture needs to be specified for each binary. "" " if _IsIOS(): - cmd_list.extend(['-arch=x86_64'] * num_archs) + cmd_list.extend(['-arch=arm64'] * num_archs) def _GetBinaryPath(command): @@ -836,8 +835,8 @@ def _GetBinaryPathsFromTargets(targets, build_dir): binary_path = os.path.join(build_dir, target) if coverage_utils.GetHostPlatform() == 'win': binary_path += '.exe' + elif coverage_utils.GetHostPlatform() == 'mac': + binary_path += '.app/%s' % target if os.path.exists(binary_path): binary_paths.append(binary_path) ========== ENDING OF PATCH ========== 5678