-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConscriptTests_clang
58 lines (46 loc) · 2.38 KB
/
SConscriptTests_clang
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
import os
from SCons.Script import Environment
compiler_name = "clang"
unity_src_path = "#.pio/libdeps/Native/Unity/src"
unity_include_path = ".pio/libdeps/Native/Unity/src"
test_src_path = "#test"
test_include_path = "test"
ehgk_src_path = "#lib/ehgk_page"
ehgk_include_path = "lib/ehgk_page"
test_build_path = f".pio/build/Native/test/{compiler_name}"
test_env = Environment(ENV = os.environ)
test_env.Replace(
CC = f"{compiler_name}"
)
test_env.Replace(
CCFLAGS=[
f"-I{unity_include_path}",
f"-I{test_include_path}",
f"-I{ehgk_include_path}",
],
)
# Build test program
prg = test_env.Program(
target = f"{test_build_path}/{compiler_name}_test",
source = [
test_env.Object(source = f"{unity_src_path}/unity.c", target = f"{test_build_path}/unity"),
test_env.Object(source = f"{ehgk_src_path}/ehgk_page_iterator.c", target = f"{test_build_path}/ehgk_page_iterator"),
test_env.Object(source = f"{test_src_path}/eghk_page_iterator_test_utils.c", target = f"{test_build_path}/eghk_page_iterator_test_utils"),
test_env.Object(source = f"{test_src_path}/ehgk_iterator_lines_test.c", target = f"{test_build_path}/ehgk_iterator_lines_test"),
test_env.Object(source = f"{test_src_path}/ehgk_page_add_led_test.c", target = f"{test_build_path}/ehgk_page_add_led_test"),
test_env.Object(source = f"{test_src_path}/ehgk_page_delete_led_test.c", target = f"{test_build_path}/ehgk_page_delete_led_test"),
test_env.Object(source = f"{test_src_path}/ehgk_page_iterator_column_leds_test.c", target = f"{test_build_path}/ehgk_page_iterator_column_leds_test"),
test_env.Object(source = f"{test_src_path}/ehgk_page_iterator_column_one_led_test.c", target = f"{test_build_path}/ehgk_page_iterator_column_one_led_test"),
test_env.Object(source = f"{test_src_path}/ehgk_page_iterator_once_test.c", target = f"{test_build_path}/ehgk_page_iterator_once_test"),
test_env.Object(source = f"{test_src_path}/main.c", target = f"{test_build_path}/main"),
]
)
run_tests = test_env.Command(
target = f"run_tests_{compiler_name}",
source = f"{test_build_path}/{compiler_name}_test",
action = [f"./{test_build_path}/{compiler_name}_test"]
)
test_env.Depends( run_tests, prg )
test_env.Default(
run_tests
)