blob: 650513ef1dba14530de9a310cc078b693393c551 [file] [log] [blame]
Christoffer Jansson4e8a7732022-02-08 09:01:12 +01001#!/usr/bin/env vpython3
2
Patrik Höglund317c1b82018-05-28 11:35:14 +02003# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
4#
5# Use of this source code is governed by a BSD-style license
6# that can be found in the LICENSE file in the root of the source
7# tree. An additional intellectual property rights grant can be found
8# in the file PATENTS. All contributing project authors may
9# be found in the AUTHORS file in the root of the source tree.
Patrik Höglund317c1b82018-05-28 11:35:14 +020010"""Generates a command-line for coverage.py. Useful for manual coverage runs.
11
12Before running the generated command line, do this:
13
14gn gen out/coverage --args='use_clang_coverage=true is_component_build=false'
15"""
16
17import sys
18
19TESTS = [
Mirko Bonadei8cc66952020-10-30 10:13:45 +010020 'video_capture_tests', 'webrtc_nonparallel_tests', 'video_engine_tests',
Evan Shrubsole45448e92021-11-15 17:27:44 +010021 'tools_unittests', 'test_support_unittests',
Mirko Bonadei8cc66952020-10-30 10:13:45 +010022 'system_wrappers_unittests', 'rtc_unittests', 'rtc_stats_unittests',
23 'rtc_pc_unittests', 'rtc_media_unittests', 'peerconnection_unittests',
24 'modules_unittests', 'modules_tests', 'low_bandwidth_audio_test',
25 'common_video_unittests', 'common_audio_unittests',
26 'audio_decoder_unittests'
Patrik Höglund317c1b82018-05-28 11:35:14 +020027]
28
Mirko Bonadei8cc66952020-10-30 10:13:45 +010029
Patrik Höglund317c1b82018-05-28 11:35:14 +020030def main():
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010031 cmd = ([sys.executable, 'tools/code_coverage/coverage.py'] + TESTS +
32 ['-b out/coverage', '-o out/report'] +
33 ['-i=\'.*/out/.*|.*/third_party/.*|.*test.*\''] +
34 ['-c \'out/coverage/%s\'' % t for t in TESTS])
Patrik Höglund317c1b82018-05-28 11:35:14 +020035
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010036 def WithXvfb(binary):
37 return '-c \'%s testing/xvfb.py %s\'' % (sys.executable, binary)
Patrik Höglund317c1b82018-05-28 11:35:14 +020038
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010039 modules_unittests = 'out/coverage/modules_unittests'
40 cmd[cmd.index('-c \'%s\'' % modules_unittests)] = WithXvfb(modules_unittests)
Mirko Bonadei8cc66952020-10-30 10:13:45 +010041
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010042 print(' '.join(cmd))
43 return 0
Mirko Bonadei8cc66952020-10-30 10:13:45 +010044
Patrik Höglund317c1b82018-05-28 11:35:14 +020045
46if __name__ == '__main__':
Christoffer Jansson4e8a7732022-02-08 09:01:12 +010047 sys.exit(main())