-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.test.py
65 lines (49 loc) · 1.84 KB
/
.travis.test.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from __future__ import print_function
import logging
import os
from dmoj import judgeenv
from dmoj.citest import ci_test, get_dirs, make_override
EXECUTORS = ['ADA', 'AWK', 'BF', 'C', 'CBL', 'D', 'DART', 'CPP03', 'CPP11', 'CLANG', 'CLANGX',
'F95', 'GO', 'GROOVY', 'HASK', 'JAVA8', 'OCAML', 'SCALA', 'MONOCS', 'MONOVB',
'PAS', 'PRO', 'GAS32', 'GAS64', 'LUA', 'NASM', 'NASM64',
'PERL', 'PHP', 'PY2', 'PY3', 'PYPY', 'PYPY3',
'RUBY2', 'RUST', 'SED', 'SWIFT', 'TCL', 'TEXT']
RVM_DIR = os.path.expanduser('~/.rvm/rubies/')
PYENV_DIR = '/opt/python/'
JVM_DIR = '/usr/lib/jvm/'
OVERRIDES = {
'PY2': make_override('py2_home', PYENV_DIR, r'2\.'),
'PY3': make_override('py3_home', PYENV_DIR, r'3\.'),
'RUBY2': make_override('ruby2_home', RVM_DIR, r'ruby-2\.'),
'PYPY': {'pypy_home': os.path.abspath('pypy2')},
'PYPY3': {'pypy3_home': os.path.abspath('pypy3')},
'PHP': {'php': '/usr/bin/php'},
}
def main():
logging.basicConfig(level=logging.INFO)
judgeenv.env['runtime'] = {}
judgeenv.env['extra_fs'] = {
'PHP': ['/etc/php5/', '/etc/terminfo/', '/etc/protocols$'],
'SWIFT': [os.path.abspath(os.path.join(os.path.dirname(__file__), 'swift'))],
'RUBY2': ['/home/travis/.gem/'],
}
print('Available JVMs:')
for jvm in get_dirs(JVM_DIR):
print(' -', jvm)
print()
print('Available Pythons:')
for python in get_dirs(PYENV_DIR):
print(' -', python)
print()
print('Available Rubies:')
for ruby in get_dirs(RVM_DIR):
print(' -', ruby)
print()
print('Using extra allowed filesystems:')
for lang, fs in judgeenv.env['extra_fs'].iteritems():
print('%-6s: %s' % (lang, '|'.join(fs)))
print()
print('Testing executors...')
ci_test(EXECUTORS, OVERRIDES)
if __name__ == '__main__':
main()