build: Add infrastructure for building automated tests.
[gps-watch.git] / SConscript.test
1 Import('env')
2 env = env.Clone()
3
4 env.Append(RUSTCFLAGS = [
5     '-g',
6     '-C', 'opt-level=s',
7 ])
8
9 SConscript('SConscript.libcommon.rs', exports='env', duplicate=0)
10
11 test_source_files = [
12     'test/main.rs', # Must be listed first (see below).
13 ]
14
15 test_env = env.Clone()
16
17 test_env.Append(RUSTCFLAGS = [
18     '-L', '$LIBPATH',
19     '--test',
20 ])
21
22 test = test_env.Rustc('gps-watch-test', test_source_files[0])
23
24 for f in test_source_files:
25     Depends(test, f)
26
27 Depends(test, 'libcommon.rlib')
28
29 Default(test)