Skip to content

Commit 95a146f

Browse files
committed
Initial minimal commit to compile a host-run test binary
1 parent 76e931e commit 95a146f

File tree

4 files changed

+17871
-0
lines changed

4 files changed

+17871
-0
lines changed

test/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

test/CMakeLists.txt

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
##########################################################################
2+
3+
cmake_minimum_required(VERSION 2.8)
4+
5+
##########################################################################
6+
7+
project(test-ArduinoCore-API)
8+
9+
##########################################################################
10+
11+
include_directories(../api)
12+
include_directories(external/catch/v2.13.1/include)
13+
14+
##########################################################################
15+
16+
set(CMAKE_CXX_STANDARD 11)
17+
18+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
19+
20+
##########################################################################
21+
22+
set(TEST_TARGET ${CMAKE_PROJECT_NAME})
23+
24+
##########################################################################
25+
26+
set(TEST_SRCS
27+
)
28+
29+
set(TEST_DUT_SRCS
30+
)
31+
32+
##########################################################################
33+
34+
set(TEST_TARGET_SRCS
35+
src/main.cpp
36+
${TEST_SRCS}
37+
${TEST_UTIL_SRCS}
38+
${TEST_DUT_SRCS}
39+
)
40+
41+
##########################################################################
42+
43+
add_compile_definitions(HOST)
44+
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
45+
add_compile_options(-Wno-cast-function-type)
46+
47+
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "--coverage")
48+
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--coverage -Wno-deprecated-copy")
49+
50+
##########################################################################
51+
52+
add_executable(
53+
${TEST_TARGET}
54+
${TEST_TARGET_SRCS}
55+
)
56+
57+
##########################################################################
58+

0 commit comments

Comments
 (0)