~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/test/Unit/lit.cfg

  • 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
# -*- Python -*-
 
2
 
 
3
# Configuration file for the 'lit' test runner.
 
4
 
 
5
import os
 
6
 
 
7
# name: The name of this test suite.
 
8
config.name = 'LLVM-Unit'
 
9
 
 
10
# suffixes: A list of file extensions to treat as test files.
 
11
config.suffixes = []
 
12
 
 
13
# test_source_root: The root path where tests are located.
 
14
# test_exec_root: The root path where tests should be run.
 
15
llvm_obj_root = getattr(config, 'llvm_obj_root', None)
 
16
if llvm_obj_root is not None:
 
17
    config.test_exec_root = os.path.join(llvm_obj_root, 'unittests')
 
18
    config.test_source_root = config.test_exec_root
 
19
 
 
20
# testFormat: The test format to use to interpret tests.
 
21
llvm_build_mode = getattr(config, 'llvm_build_mode', "Debug")
 
22
config.test_format = lit.formats.GoogleTest(llvm_build_mode, 'Tests')
 
23
 
 
24
###
 
25
 
 
26
# If necessary, point the dynamic loader at libLLVM.so.
 
27
if config.enable_shared:
 
28
    libdir = os.path.join(config.llvm_obj_root, config.llvm_build_mode, 'lib')
 
29
    shlibpath = config.environment.get(config.shlibpath_var,'')
 
30
    if shlibpath:
 
31
        shlibpath = ':' + shlibpath
 
32
    shlibpath = libdir + shlibpath
 
33
    config.environment[config.shlibpath_var] = shlibpath
 
34
 
 
35
# Check that the object root is known.
 
36
if config.test_exec_root is None:
 
37
    # Otherwise, we haven't loaded the site specific configuration (the user is
 
38
    # probably trying to run on a test file directly, and either the site
 
39
    # configuration hasn't been created by the build system, or we are in an
 
40
    # out-of-tree build situation).
 
41
 
 
42
    # Check for 'llvm_unit_site_config' user parameter, and use that if available.
 
43
    site_cfg = lit.params.get('llvm_unit_site_config', None)
 
44
    if site_cfg and os.path.exists(site_cfg):
 
45
        lit.load_config(config, site_cfg)
 
46
        raise SystemExit
 
47
 
 
48
    # Try to detect the situation where we are using an out-of-tree build by
 
49
    # looking for 'llvm-config'.
 
50
    #
 
51
    # FIXME: I debated (i.e., wrote and threw away) adding logic to
 
52
    # automagically generate the lit.site.cfg if we are in some kind of fresh
 
53
    # build situation. This means knowing how to invoke the build system
 
54
    # though, and I decided it was too much magic.
 
55
 
 
56
    llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
 
57
    if not llvm_config:
 
58
        lit.fatal('No site specific configuration available!')
 
59
 
 
60
    # Get the source and object roots.
 
61
    llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
 
62
    llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
 
63
 
 
64
    # Validate that we got a tree which points to here.
 
65
    this_src_root = os.path.join(os.path.dirname(__file__),'..','..')
 
66
    if os.path.realpath(llvm_src_root) != os.path.realpath(this_src_root):
 
67
        lit.fatal('No site specific configuration available!')
 
68
 
 
69
    # Check that the site specific configuration exists.
 
70
    site_cfg = os.path.join(llvm_obj_root, 'test', 'Unit', 'lit.site.cfg')
 
71
    if not os.path.exists(site_cfg):
 
72
        lit.fatal('No site specific configuration available!')
 
73
 
 
74
    # Okay, that worked. Notify the user of the automagic, and reconfigure.
 
75
    lit.note('using out-of-tree build at %r' % llvm_obj_root)
 
76
    lit.load_config(config, site_cfg)
 
77
    raise SystemExit