File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11.pioenvs
22.piolibdeps
3+ /external /unity /* -repo /
4+ /build /
Original file line number Diff line number Diff line change 1- language : python
2- python :
3- - " 2.7"
4-
1+ dist : trusty
52sudo : false
6- cache :
7- directories :
8- - " ~/.platformio"
3+ group : beta
4+
5+ language : cpp
6+
7+ matrix :
8+ include :
9+ - compiler : gcc
10+ addons :
11+ apt :
12+ sources :
13+ - ubuntu-toolchain-r-test
14+ packages :
15+ - git
16+ - g++-5
17+ env : COMPILER=g++-5
918
10- install :
11- - pip install -U platformio
19+ - compiler : clang
20+ addons :
21+ apt :
22+ sources :
23+ - ubuntu-toolchain-r-test
24+ - llvm-toolchain-precise-3.6
25+ packages :
26+ - git
27+ - clang-3.6
28+ env : COMPILER=clang++-3.6
1229
1330script :
14- - platformio test
31+ - git --version
32+ - cmake --version
33+ - make --version
34+ - make build test
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.2.2 )
2+ project (ArduinoFake VERSION 0.1)
3+
4+ set (CMAKE_CXX_STANDARD 11)
5+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
6+
7+ LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} /cmake)
8+
9+ # Include external libs
10+ add_subdirectory (external )
11+
12+ # Targets that we develop here
13+ enable_testing ()
14+
15+ add_subdirectory (src )
16+ add_subdirectory (test )
Original file line number Diff line number Diff line change 1+ default_target : all
2+
3+ all : clean build test clean
4+
5+ cmake :
6+ @cmake $(CURDIR ) -B$(CURDIR ) /build
7+
8+ build : cmake
9+ @cd $(CURDIR ) /build && make all
10+
11+ test :
12+ @cd $(CURDIR ) /build && CTEST_OUTPUT_ON_FAILURE=TRUE make test
13+
14+ pio-test :
15+ @pio test
16+
17+ clean :
18+ @rm -rf $(CURDIR ) /build/*
19+ @rm -rf $(CURDIR ) /.pioenvs/*
20+
21+ .PHONY : cmake build test clean all
Original file line number Diff line number Diff line change 1+ find_package (Git REQUIRED )
2+
3+ function (execute_git )
4+ set (options "" )
5+ set (oneValueArgs
6+ OUTPUT_VARIABLE
7+ )
8+ set (multiValueArgs
9+ COMMAND
10+ )
11+ cmake_parse_arguments (args "${options} " "${oneValueArgs} " "${multiValueArgs} " ${ARGN} )
12+
13+ execute_process (
14+ COMMAND ${GIT_EXECUTABLE} ${args_COMMAND}
15+ OUTPUT_VARIABLE GIT_RESULT
16+ )
17+
18+ set (${args_OUTPUT_VARIABLE} ${GIT_RESULT} PARENT_SCOPE )
19+ endfunction ()
20+
21+ function (download_repo )
22+ set (options "" )
23+ set (oneValueArgs
24+ URL
25+ TAG
26+ CLONE_DIR
27+ )
28+ set (multiValueArgs "" )
29+ cmake_parse_arguments (args "${options} " "${oneValueArgs} " "${multiValueArgs} " ${ARGN} )
30+
31+ # If no tag is specified, default to master
32+ if (NOT args_TAG)
33+ set (args_TAG master)
34+ endif ()
35+
36+ execute_git (
37+ COMMAND rev-parse --show-toplevel
38+ OUTPUT_VARIABLE GIT_ROOT
39+ )
40+
41+ # Need to remove linebreak
42+ string (STRIP ${GIT_ROOT} GIT_ROOT)
43+
44+ # Make clone-dir path relative to git-root
45+ string (REPLACE ${GIT_ROOT} / "" RELATIVE_CLONE_DIR ${args_CLONE_DIR} )
46+
47+ if (NOT EXISTS ${args_CLONE_DIR} )
48+ message ("Cloning branch ${args_TAG} from ${args_URL} into directory ${args_CLONE_DIR} " )
49+ execute_git (
50+ COMMAND clone --depth=50 --branch=${args_TAG} ${args_URL} ${args_CLONE_DIR}
51+ WORKING_DIRECTORY ${GIT_ROOT}
52+ )
53+ endif ()
54+
55+ endfunction ()
Original file line number Diff line number Diff line change 1+ # Include external libs
2+ add_subdirectory (unity )
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.2.2 )
2+ project (unity VERSION 2.4.1 LANGUAGES C )
3+
4+ include (git-download )
5+
6+ set (REPO_DIR ${PROJECT_SOURCE_DIR} /${PROJECT_NAME} -repo)
7+
8+ download_repo (
9+ URL "https://github.com/ThrowTheSwitch/Unity.git"
10+ TAG v${PROJECT_VERSION}
11+ CLONE_DIR ${REPO_DIR}
12+ )
13+
14+ add_library (${PROJECT_NAME} STATIC
15+ ${REPO_DIR} /src/unity.c
16+ )
17+
18+ target_include_directories (${PROJECT_NAME} PUBLIC
19+ ${REPO_DIR} /src
20+ )
Original file line number Diff line number Diff line change 55#endif
66
77#include < cstring>
8- #include < fakeit/fakeit.hpp>
8+ #include " fakeit/fakeit.hpp"
99
10- #include < FunctionFake.h>
11- #include < StreamFake.h>
12- #include < SerialFake.h>
13- #include < ClientFake.h>
14- #include < PrintFake.h>
10+ #include " FunctionFake.h"
11+ #include " StreamFake.h"
12+ #include " SerialFake.h"
13+ #include " ClientFake.h"
14+ #include " PrintFake.h"
1515
16- #include < arduino/Arduino.h>
16+ #include " arduino/Arduino.h"
1717
1818#define ArduinoFakeGetFunction () ArduinoFakeGetter(Function)
1919#define ArduinoFakeGetSerial () ArduinoFakeGetter(Serial)
Original file line number Diff line number Diff line change 1+ aux_source_directory (. SRC_LIST )
2+ aux_source_directory (./fakeit SRC_LIST )
3+ aux_source_directory (./arduino SRC_LIST )
4+
5+ add_library (${PROJECT_NAME} SHARED ${SRC_LIST} )
Original file line number Diff line number Diff line change 11#ifndef FUNCTION_FAKE_H
22#define FUNCTION_FAKE_H
33
4- #include < fakeit/fakeit.hpp>
4+ #include " fakeit/fakeit.hpp"
55
66struct FunctionFake
77{
You can’t perform that action at this time.
0 commit comments