Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: tools/sanitizers/sancov_merger_test.py

Issue 1737263003: [coverage] Enable sanitizer coverage. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Documentation Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 the V8 project authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6
7 import sancov_merger
8
9
10 # Files on disk after test runner completes. The files are mapped by
11 # executable name -> file list.
12 FILE_MAP = {
13 'd8': [
14 'd8.test.1.sancov',
15 'd8.test.2.sancov',
16 'd8.test.3.sancov',
17 'd8.test.4.sancov',
18 'd8.test.5.sancov',
19 'd8.test.6.sancov',
20 'd8.test.7.sancov',
21 ],
22 'cctest': [
23 'cctest.test.1.sancov',
24 'cctest.test.2.sancov',
25 'cctest.test.3.sancov',
26 'cctest.test.4.sancov',
27 ],
28 }
29
30
31 # Inputs for merge process with 2 cpus. The tuples contain:
32 # (flag, path, executable name, intermediate result index, file list).
33 EXPECTED_INPUTS_2 = [
34 (False, '/some/path', 'cctest', 0, [
35 'cctest.test.1.sancov',
36 'cctest.test.2.sancov']),
37 (False, '/some/path', 'cctest', 1, [
38 'cctest.test.3.sancov',
39 'cctest.test.4.sancov']),
40 (False, '/some/path', 'd8', 0, [
41 'd8.test.1.sancov',
42 'd8.test.2.sancov',
43 'd8.test.3.sancov',
44 'd8.test.4.sancov']),
45 (False, '/some/path', 'd8', 1, [
46 'd8.test.5.sancov',
47 'd8.test.6.sancov',
48 'd8.test.7.sancov']),
49 ]
50
51 # The same for 4 cpus.
52 EXPECTED_INPUTS_4 = [
53 (True, '/some/path', 'cctest', 0, [
54 'cctest.test.1.sancov',
55 'cctest.test.2.sancov']),
56 (True, '/some/path', 'cctest', 1, [
57 'cctest.test.3.sancov',
58 'cctest.test.4.sancov']),
59 (True, '/some/path', 'd8', 0, [
60 'd8.test.1.sancov',
61 'd8.test.2.sancov']),
62 (True, '/some/path', 'd8', 1, [
63 'd8.test.3.sancov',
64 'd8.test.4.sancov']),
65 (True, '/some/path', 'd8', 2, [
66 'd8.test.5.sancov',
67 'd8.test.6.sancov']),
68 (True, '/some/path', 'd8', 3, [
69 'd8.test.7.sancov'])]
70
71
72 class FormatterTests(unittest.TestCase):
73 def test_generate_inputs_2_cpu(self):
74 inputs = sancov_merger.generate_inputs(
75 False, '/some/path', FILE_MAP, 2)
76 self.assertEquals(EXPECTED_INPUTS_2, inputs)
77
78 def test_generate_inputs_4_cpu(self):
79 inputs = sancov_merger.generate_inputs(
80 True, '/some/path', FILE_MAP, 4)
81 self.assertEquals(EXPECTED_INPUTS_4, inputs)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698