forked from RoboJackets/robocup-software
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConscript
44 lines (33 loc) · 1.29 KB
/
SConscript
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
Import('*')
e = env.Clone()
# build gtest
gtest_main_a = '#/test/gtest/make/gtest_main.a'
build_gtest = e.Command(gtest_main_a, '', 'cd test/gtest/make; make')
rename_gtest = e.Command('#/test/gtest/make/libgtest.a', gtest_main_a, 'cd test/gtest/make; ln -s gtest_main.a libgtest.a')
# add all test .cpp files here
test_srcs = [
'../soccer/planning/Path.cpp',
'../soccer/motion/TrapezoidalMotion.cpp',
'../soccer/Configuration.cpp',
]
test_srcs += Glob('../soccer/tests/*.cpp')
e.Append(LIBS=['gtest'])
e.Append(LIBPATH=['../test/gtest/make'])
e.Append(CPPPATH=['../test/gtest/include'])
# include paths
e.Append(CPPPATH=['../soccer'])
# build the program that runs the tests
test_runner = e.Program('test-runner', test_srcs)
e.Depends(test_runner, rename_gtest);
install_test_runner = e.Install(exec_dir, test_runner)
testCpp = e.Command('file-that-doesnt-exist',
exec_dir.File('test-runner'),
'%s' % exec_dir.File('test-runner'))
e.Depends(testCpp, install_test_runner)
e.Depends(testCpp, test_runner)
pythonTestRunner = Dir("#/soccer/gameplay").File('run_tests.sh')
testPython = e.Command('file-that-doesnt-exist2',
pythonTestRunner,
'cd soccer/gameplay; ./run_tests.sh')
# make a 'test' command so that 'scons test' builds the tests and runs them
test = e.Alias('test', [testPython, testCpp])