forked from openwsn-berkeley/coap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
79 lines (60 loc) · 1.77 KB
/
SConstruct
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import os
import subprocess
import SCons
#============================ banner ==========================================
banner = [""]
banner += [" ___ _ _ _ ___ _ _ "]
banner += ["| . | ___ ___ ._ _ | | | |/ __>| \ |"]
banner += ["| | || . \/ ._>| ' || | | |\__ \| |"]
banner += ["`___'| _/\___.|_|_||__/_/ <___/|_\_|"]
banner += [" |_| openwsn.org"]
banner += [""]
print '\n'.join(banner)
#============================ SCons environment ===============================
env = Environment(
ENV = {'PATH' : os.environ['PATH']},
)
#===== help text
Help('''
Usage:
scons unittests
scons functests
''')
def default(env,target,source): print SCons.Script.help_text
Default(env.Command('default', None, default))
#============================ SCons targets ===================================
#===== pylint_all
pylint_all = env.Command(
'pylint_all.log', [],
'pylint --output-format=parseable coap > $TARGET.file',
)
env.AlwaysBuild(pylint_all)
env.Alias('pylint_all', pylint_all)
#===== pylint_error
pylint_error = env.Command(
'pylint_error.log', [],
'pylint --output-format=parseable -E coap > $TARGET.file',
)
env.AlwaysBuild(pylint_error)
env.Alias('pylint_error', pylint_error)
#===== unittests
unittests = env.Command(
'test_report.xml', [],
'py.test tests/unit/ --junitxml $TARGET.file',
)
env.AlwaysBuild(unittests)
env.Alias('unittests', unittests)
#===== functests
functests = env.Command(
'test_report.xml', [],
'py.test tests/func/ --junitxml $TARGET.file',
)
env.AlwaysBuild(functests)
env.Alias('functests', functests)
#===== alltests
alltests = env.Command(
'test_report.xml', [],
'py.test tests --junitxml $TARGET.file',
)
env.AlwaysBuild(alltests)
env.Alias('alltests', alltests)