~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/utils/lit/lit/Test.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
 
 
3
# Test results.
 
4
 
 
5
class TestResult:
 
6
    def __init__(self, name, isFailure):
 
7
        self.name = name
 
8
        self.isFailure = isFailure
 
9
 
 
10
PASS        = TestResult('PASS', False)
 
11
XFAIL       = TestResult('XFAIL', False)
 
12
FAIL        = TestResult('FAIL', True)
 
13
XPASS       = TestResult('XPASS', True)
 
14
UNRESOLVED  = TestResult('UNRESOLVED', True)
 
15
UNSUPPORTED = TestResult('UNSUPPORTED', False)
 
16
 
 
17
# Test classes.
 
18
 
 
19
class TestFormat:
 
20
    """TestFormat - Test information provider."""
 
21
 
 
22
    def __init__(self, name):
 
23
        self.name = name
 
24
 
 
25
class TestSuite:
 
26
    """TestSuite - Information on a group of tests.
 
27
 
 
28
    A test suite groups together a set of logically related tests.
 
29
    """
 
30
 
 
31
    def __init__(self, name, source_root, exec_root, config):
 
32
        self.name = name
 
33
        self.source_root = source_root
 
34
        self.exec_root = exec_root
 
35
        # The test suite configuration.
 
36
        self.config = config
 
37
 
 
38
    def getSourcePath(self, components):
 
39
        return os.path.join(self.source_root, *components)
 
40
 
 
41
    def getExecPath(self, components):
 
42
        return os.path.join(self.exec_root, *components)
 
43
 
 
44
class Test:
 
45
    """Test - Information on a single test instance."""
 
46
 
 
47
    def __init__(self, suite, path_in_suite, config):
 
48
        self.suite = suite
 
49
        self.path_in_suite = path_in_suite
 
50
        self.config = config
 
51
        # The test result code, once complete.
 
52
        self.result = None
 
53
        # Any additional output from the test, once complete.
 
54
        self.output = None
 
55
        # The wall time to execute this test, if timing and once complete.
 
56
        self.elapsed = None
 
57
        # The repeat index of this test, or None.
 
58
        self.index = None
 
59
 
 
60
    def copyWithIndex(self, index):
 
61
        import copy
 
62
        res = copy.copy(self)
 
63
        res.index = index
 
64
        return res
 
65
 
 
66
    def setResult(self, result, output, elapsed):
 
67
        assert self.result is None, "Test result already set!"
 
68
        self.result = result
 
69
        self.output = output
 
70
        self.elapsed = elapsed
 
71
 
 
72
    def getFullName(self):
 
73
        return self.suite.config.name + ' :: ' + '/'.join(self.path_in_suite)
 
74
 
 
75
    def getSourcePath(self):
 
76
        return self.suite.getSourcePath(self.path_in_suite)
 
77
 
 
78
    def getExecPath(self):
 
79
        return self.suite.getExecPath(self.path_in_suite)