forked from openwsn-berkeley/coap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
81 lines (62 loc) · 1.85 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
80
81
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
scons pylint_all
scons pylint_error
''')
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', [],
'python3 -m pytest tests/unit/ --junitxml $TARGET.file',
)
env.AlwaysBuild(unittests)
env.Alias('unittests', unittests)
#===== functests
functests = env.Command(
'test_report.xml', [],
'python3 -m pytest tests/func/ --junitxml $TARGET.file',
)
env.AlwaysBuild(functests)
env.Alias('functests', functests)
#===== alltests
alltests = env.Command(
'test_report.xml', [],
'python3 -m pytest tests --junitxml $TARGET.file',
)
env.AlwaysBuild(alltests)
env.Alias('alltests', alltests)