Example #1
0
from bfg9000.iterutils import listify
from bfg9000.path import InstallRoot, Path, Root

this_dir = os.path.abspath(os.path.dirname(__file__))
examples_dir = os.path.join(this_dir, '..', '..', 'examples')
test_data_dir = os.path.join(this_dir, '..', 'data')
test_stage_dir = os.path.join(this_dir, '..', 'stage')

default_env = env = make_env()

Target = namedtuple('Target', ['name', 'path'])

if os.getenv('BACKENDS', '').strip():
    backends = os.getenv('BACKENDS').split(' ')
else:
    backends = [k for k, v in list_backends().items() if v.priority > 0]
    # Only test with MSBuild by default on Windows.
    if env.host_platform.family != 'windows' and 'msbuild' in backends:
        backends.remove('msbuild')

# Also supported: 'gcj', 'mingw-cross'
test_features = {'fortran', 'java', 'objc', 'scala'}
for i in os.getenv('BFG_EXTRA_TESTS', '').split(' '):
    if i:
        test_features.add(i)
for i in os.getenv('BFG_SKIPPED_TESTS', '').split(' '):
    if i:
        test_features.remove(i)

_unset = object()
Example #2
0
from bfg9000.environment import Environment
from bfg9000.path import InstallRoot, makedirs, Path, Root

this_dir = os.path.abspath(os.path.dirname(__file__))
examples_dir = os.path.join(this_dir, '..', '..', 'examples')
test_data_dir = os.path.join(this_dir, '..', 'data')
test_stage_dir = os.path.join(this_dir, '..', 'stage')

env = make_env()

Target = namedtuple('Target', ['name', 'path'])

if os.getenv('BACKENDS', '').strip():
    backends = os.getenv('BACKENDS').split(' ')
else:
    backends = [k for k, v in iteritems(list_backends()) if v.priority > 0]
    # Only test with MSBuild by default on Windows.
    if env.host_platform.name != 'windows' and 'msbuild' in backends:
        backends.remove('msbuild')

extra_tests = os.getenv('BFG_EXTRA_TESTS', '').split(' ')
skipped_tests = os.getenv('BFG_SKIPPED_TESTS', '').split(' ')

_unset = object()


def cleandir(path, recreate=True):
    if os.path.exists(path):
        # Windows seems to keep an executable file open a little bit after the
        # process returns from wait(), so try a few times, sleeping a bit in
        # between.