diff options
Diffstat (limited to 'infra/bots/recipe_modules/flavor')
3 files changed, 233 insertions, 1 deletions
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-Coverage.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-Coverage.json new file mode 100644 index 0000000000..3d194e9b16 --- /dev/null +++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-Coverage.json @@ -0,0 +1,214 @@ +[ + { + "cmd": [ + "python", + "-u", + "[START_DIR]/skia/bin/fetch-gn" + ], + "cwd": "[START_DIR]/skia", + "env": { + "BUILDTYPE": "Debug", + "CHROME_HEADLESS": "1", + "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" + }, + "infra_step": true, + "name": "fetch-gn" + }, + { + "cmd": [ + "[START_DIR]/skia/bin/gn", + "gen", + "[START_DIR]/out/Debug", + "--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_cflags=[\"-B[START_DIR]/clang_linux/bin\", \"-fprofile-instr-generate\", \"-fcoverage-mapping\"] extra_ldflags=[\"-B[START_DIR]/clang_linux/bin\", \"-fuse-ld=lld\", \"-fprofile-instr-generate\", \"-fcoverage-mapping\"] skia_use_system_freetype2=false" + ], + "cwd": "[START_DIR]/skia", + "env": { + "BUILDTYPE": "Debug", + "CHROME_HEADLESS": "1", + "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" + }, + "name": "gn gen" + }, + { + "cmd": [ + "ninja", + "-C", + "[START_DIR]/out/Debug" + ], + "cwd": "[START_DIR]/skia", + "env": { + "BUILDTYPE": "Debug", + "CHROME_HEADLESS": "1", + "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" + }, + "name": "ninja" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "rmtree", + "results_dir" + ], + "infra_step": true, + "name": "rmtree results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "ensure-directory", + "--mode", + "0777", + "results_dir" + ], + "infra_step": true, + "name": "makedirs results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "rmtree", + "device_results_dir" + ], + "infra_step": true, + "name": "rmtree device_results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "ensure-directory", + "--mode", + "0777", + "device_results_dir" + ], + "infra_step": true, + "name": "makedirs device_results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "[START_DIR]/skia/infra/bots/assets/skp/VERSION", + "/path/to/tmp/" + ], + "infra_step": true, + "name": "Get downloaded SKP VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "42", + "[START_DIR]/tmp/SKP_VERSION" + ], + "infra_step": true, + "name": "write SKP_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "[START_DIR]/skia/infra/bots/assets/skimage/VERSION", + "/path/to/tmp/" + ], + "infra_step": true, + "name": "Get downloaded skimage VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "42", + "[START_DIR]/tmp/SK_IMAGE_VERSION" + ], + "infra_step": true, + "name": "write SK_IMAGE_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "[START_DIR]/skia/infra/bots/assets/svg/VERSION", + "/path/to/tmp/" + ], + "infra_step": true, + "name": "Get downloaded SVG VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "42", + "[START_DIR]/tmp/SVG_VERSION" + ], + "infra_step": true, + "name": "write SVG_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[skia::flavor]/resources/symbolize_stack_trace.py", + "[START_DIR]", + "catchsegv", + "[START_DIR]/out/Debug/dm", + "--some-flag" + ], + "cwd": "[START_DIR]/skia", + "env": { + "BUILDTYPE": "Debug", + "CHROME_HEADLESS": "1", + "LLVM_PROFILE_FILE": "[CUSTOM_[SWARM_OUT_DIR]]/output.profraw", + "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" + }, + "name": "symbolized dm" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +]
\ No newline at end of file diff --git a/infra/bots/recipe_modules/flavor/examples/full.py b/infra/bots/recipe_modules/flavor/examples/full.py index c0598f9b0d..e8bf10decf 100644 --- a/infra/bots/recipe_modules/flavor/examples/full.py +++ b/infra/bots/recipe_modules/flavor/examples/full.py @@ -84,6 +84,7 @@ TEST_BUILDERS = [ 'Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-ASAN', 'Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-UBSAN_float_cast_overflow', 'Perf-Ubuntu14-GCC-GCE-CPU-AVX2-x86_64-Release-CT_BENCH_1k_SKPs', + 'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-Coverage', 'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-TSAN', 'Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release', 'Test-Ubuntu16-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-Vulkan', diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py index a88cf1f0ff..b1855de98e 100644 --- a/infra/bots/recipe_modules/flavor/gn_flavor.py +++ b/infra/bots/recipe_modules/flavor/gn_flavor.py @@ -59,7 +59,15 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): cxx = emscripten_sdk + '/emscripten/incoming/em++' extra_cflags.append('-Wno-unknown-warning-option') - if compiler != 'MSVC' and configuration == 'Debug': + if extra_config == 'Coverage': + # See https://clang.llvm.org/docs/SourceBasedCodeCoverage.html for + # more info on using llvm to gather coverage information. + extra_cflags.append('-fprofile-instr-generate') + extra_cflags.append('-fcoverage-mapping') + extra_ldflags.append('-fprofile-instr-generate') + extra_ldflags.append('-fcoverage-mapping') + + elif compiler != 'MSVC' and configuration == 'Debug': extra_cflags.append('-O1') if extra_config == 'Exceptions': @@ -126,6 +134,8 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): 'skia_use_icu': 'false', 'skia_enable_gpu': 'false', }) + if extra_config == 'Coverage': + args['skia_use_system_freetype2'] = 'false' sanitize = '' if extra_config == 'UBSAN_float_cast_overflow': @@ -228,6 +238,13 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): # If we're in a signal handler, we're already crashing... env['TSAN_OPTIONS'] = 'report_signal_unsafe=0' + if 'Coverage' == extra_config: + # This is the output file for the coverage data. Just running the binary + # will produce the output. The output_file is in the swarming_out_dir and + # thus will be an isolated output of the Test step. + env['LLVM_PROFILE_FILE'] = self.m.path.join(self.m.vars.swarming_out_dir, + 'output.profraw') + if path: env['PATH'] = '%%(PATH)s:%s' % ':'.join('%s' % p for p in path) if ld_library_path: |