forked from idaholab/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests
executable file
·27 lines (23 loc) · 1.2 KB
/
run_tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
import sys, os
# Determine MOOSE_DIR
WORKING_DIR = os.path.abspath(os.path.dirname(__file__))
MOOSE_DIR = os.getenv('MOOSE_DIR', os.path.join(WORKING_DIR, 'moose'))
if not os.path.exists(os.path.join(MOOSE_DIR, 'framework', 'Makefile')):
MOOSE_DIR = os.path.abspath(os.path.join(WORKING_DIR, '..', 'moose'))
if not os.path.exists(os.path.join(MOOSE_DIR, 'framework', 'Makefile')):
msg = "Unable to locate MOOSE, there are three options:\n" \
" (1) Initialize the submodule with: 'git submodule update --init moose'\n" \
" (2) Clone MOOSE in a sister directory to MASTODON\n" \
" (3) Clone MOOSE in an arbitrary directory and set the MOOSE_DIR environment variable."
raise EnvironmentError(msg)
# Add python directories
sys.path.append(os.path.join(MOOSE_DIR, 'python'))
sys.path.append(os.path.join(os.getcwd(), 'python'))
os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', '') + \
':' + os.path.join(MOOSE_DIR, 'python') + \
':' + os.path.join(os.getcwd(), 'python')
# Import TestHarness
from TestHarness import TestHarness
# Run the tests!
TestHarness.buildAndRun(sys.argv, None, MOOSE_DIR)