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

Side by Side Diff: third_party/lit/tests/Inputs/test-data/lit.cfg

Issue 1663053003: [fusl] Add llvm's lit tool to third_party (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: move down a dir Created 4 years, 10 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 import os
2 try:
3 import ConfigParser
4 except ImportError:
5 import configparser as ConfigParser
6
7 import lit.formats
8 import lit.Test
9
10 class DummyFormat(lit.formats.FileBasedTest):
11 def execute(self, test, lit_config):
12 # In this dummy format, expect that each test file is actually just a
13 # .ini format dump of the results to report.
14
15 source_path = test.getSourcePath()
16
17 cfg = ConfigParser.ConfigParser()
18 cfg.read(source_path)
19
20 # Create the basic test result.
21 result_code = cfg.get('global', 'result_code')
22 result_output = cfg.get('global', 'result_output')
23 result = lit.Test.Result(getattr(lit.Test, result_code),
24 result_output)
25
26 # Load additional metrics.
27 for key,value_str in cfg.items('results'):
28 value = eval(value_str)
29 if isinstance(value, int):
30 metric = lit.Test.IntMetricValue(value)
31 elif isinstance(value, float):
32 metric = lit.Test.RealMetricValue(value)
33 else:
34 raise RuntimeError("unsupported result type")
35 result.addMetric(key, metric)
36
37 return result
38
39 config.name = 'test-data'
40 config.suffixes = ['.ini']
41 config.test_format = DummyFormat()
42 config.test_source_root = None
43 config.test_exec_root = None
44 config.target_triple = None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698