blob: a402f38da7d45893dba77d32adc83eacb312d073 [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.
9
10"""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 = [
20 'video_capture_tests',
21 'webrtc_nonparallel_tests',
22 'video_engine_tests',
23 'tools_unittests',
24 'test_support_unittests',
25 'system_wrappers_unittests',
26 'rtc_unittests',
27 'rtc_stats_unittests',
28 'rtc_pc_unittests',
29 'rtc_media_unittests',
30 'peerconnection_unittests',
31 'ortc_unittests',
32 'modules_unittests',
33 'modules_tests',
34 'low_bandwidth_audio_test',
35 'common_video_unittests',
36 'common_audio_unittests',
37 'audio_decoder_unittests'
38]
39
40def main():
41 cmd = ([sys.executable, 'tools/code_coverage/coverage.py'] + TESTS +
42 ['-b out/coverage', '-o out/report'] +
Artem Titarenkoea5b76f2018-09-11 16:27:34 +020043 ['-i=\'.*/out/.*|.*/third_party/.*|.*test.*\''] +
Patrik Höglund317c1b82018-05-28 11:35:14 +020044 ['-c \'out/coverage/%s\'' % t for t in TESTS])
45
46 def WithXvfb(binary):
47 return '-c \'%s testing/xvfb.py %s\'' % (sys.executable, binary)
48 modules_unittests = 'out/coverage/modules_unittests'
49 cmd[cmd.index('-c \'%s\'' % modules_unittests)] = WithXvfb(modules_unittests)
50
51 print ' '.join(cmd)
52 return 0
53
54if __name__ == '__main__':
55 sys.exit(main())