blob: 7c701f8b55a60df58aa55853fb04deea023d4547 [file] [log] [blame]
Patrik Höglund317c1b82018-05-28 11:35:14 +02001#!/usr/bin/env python
2# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3#
4# Use of this source code is governed by a BSD-style license
5# that can be found in the LICENSE file in the root of the source
6# tree. An additional intellectual property rights grant can be found
7# in the file PATENTS. All contributing project authors may
8# be found in the AUTHORS file in the root of the source tree.
Patrik Höglund317c1b82018-05-28 11:35:14 +02009"""Generates a command-line for coverage.py. Useful for manual coverage runs.
10
11Before running the generated command line, do this:
12
13gn gen out/coverage --args='use_clang_coverage=true is_component_build=false'
14"""
15
16import sys
17
18TESTS = [
Mirko Bonadei8cc66952020-10-30 10:13:45 +010019 'video_capture_tests', 'webrtc_nonparallel_tests', 'video_engine_tests',
Evan Shrubsole45448e92021-11-15 17:27:44 +010020 'tools_unittests', 'test_support_unittests',
Mirko Bonadei8cc66952020-10-30 10:13:45 +010021 'system_wrappers_unittests', 'rtc_unittests', 'rtc_stats_unittests',
22 'rtc_pc_unittests', 'rtc_media_unittests', 'peerconnection_unittests',
23 'modules_unittests', 'modules_tests', 'low_bandwidth_audio_test',
24 'common_video_unittests', 'common_audio_unittests',
25 'audio_decoder_unittests'
Patrik Höglund317c1b82018-05-28 11:35:14 +020026]
27
Mirko Bonadei8cc66952020-10-30 10:13:45 +010028
Patrik Höglund317c1b82018-05-28 11:35:14 +020029def main():
Mirko Bonadei8cc66952020-10-30 10:13:45 +010030 cmd = ([sys.executable, 'tools/code_coverage/coverage.py'] + TESTS +
31 ['-b out/coverage', '-o out/report'] +
32 ['-i=\'.*/out/.*|.*/third_party/.*|.*test.*\''] +
33 ['-c \'out/coverage/%s\'' % t for t in TESTS])
Patrik Höglund317c1b82018-05-28 11:35:14 +020034
Mirko Bonadei8cc66952020-10-30 10:13:45 +010035 def WithXvfb(binary):
36 return '-c \'%s testing/xvfb.py %s\'' % (sys.executable, binary)
Patrik Höglund317c1b82018-05-28 11:35:14 +020037
Mirko Bonadei8cc66952020-10-30 10:13:45 +010038 modules_unittests = 'out/coverage/modules_unittests'
39 cmd[cmd.index('-c \'%s\'' %
40 modules_unittests)] = WithXvfb(modules_unittests)
41
42 print ' '.join(cmd)
43 return 0
44
Patrik Höglund317c1b82018-05-28 11:35:14 +020045
46if __name__ == '__main__':
Mirko Bonadei8cc66952020-10-30 10:13:45 +010047 sys.exit(main())