Tried using google tests
This commit is contained in:
parent
d6716df807
commit
3b5e38bf7d
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
|||||||
.vscode/c_cpp_properties.json
|
.vscode/c_cpp_properties.json
|
||||||
.vscode/launch.json
|
.vscode/launch.json
|
||||||
.vscode/ipch
|
.vscode/ipch
|
||||||
|
test/build/*
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#include <Serial.h>
|
||||||
|
|
||||||
enum class ErrorCode {
|
enum class ErrorCode {
|
||||||
SUCCESS,
|
SUCCESS,
|
||||||
@ -29,6 +30,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
ErrorCode pushBack(const T& item) {
|
ErrorCode pushBack(const T& item) {
|
||||||
|
Serial.print(_count);
|
||||||
|
Serial.print(_capacity);
|
||||||
if (_count == _capacity) {
|
if (_count == _capacity) {
|
||||||
return ErrorCode::BUFFER_FULL;
|
return ErrorCode::BUFFER_FULL;
|
||||||
}
|
}
|
||||||
|
@ -9,10 +9,11 @@ include_directories(
|
|||||||
${ARDUINO_MOCK_LIBS_DIR}/lib/gtest/gtest/src/gtest/googletest/include
|
${ARDUINO_MOCK_LIBS_DIR}/lib/gtest/gtest/src/gtest/googletest/include
|
||||||
${ARDUINO_MOCK_LIBS_DIR}/lib/gtest/gtest/src/gtest/googlemock/include
|
${ARDUINO_MOCK_LIBS_DIR}/lib/gtest/gtest/src/gtest/googlemock/include
|
||||||
)
|
)
|
||||||
|
message(ARDUINO_MOCK_INCLUDE_DIRS="${ARDUINO_MOCK_INCLUDE_DIRS}")
|
||||||
|
|
||||||
file(GLOB LIB_SRCS "../*.ino")
|
file(GLOB LIBS_SRCS "libs/*.cpp")
|
||||||
file(GLOB SRCS "*.cpp")
|
file(GLOB SRCS "*.cpp")
|
||||||
add_executable(test-all ${SRCS} ${LIB_SRCS})
|
add_executable(test-all ${SRCS} ${LIBS_SRCS})
|
||||||
|
|
||||||
target_link_libraries(test-all
|
target_link_libraries(test-all
|
||||||
${ARDUINO_MOCK_LIBS_DIR}/lib/gtest/gtest/src/gtest-build/googlemock/gtest/libgtest.a
|
${ARDUINO_MOCK_LIBS_DIR}/lib/gtest/gtest/src/gtest-build/googlemock/gtest/libgtest.a
|
||||||
|
@ -10,7 +10,7 @@ ExternalProject_Add(arduino_mock
|
|||||||
)
|
)
|
||||||
|
|
||||||
ExternalProject_Get_Property(arduino_mock source_dir)
|
ExternalProject_Get_Property(arduino_mock source_dir)
|
||||||
set(ARDUINO_MOCK_INCLUDE_DIRS ${source_dir}/include PARENT_SCOPE)
|
set(ARDUINO_MOCK_INCLUDE_DIRS ${source_dir}/include/arduino-mock PARENT_SCOPE)
|
||||||
|
|
||||||
ExternalProject_Get_Property(arduino_mock binary_dir)
|
ExternalProject_Get_Property(arduino_mock binary_dir)
|
||||||
set(ARDUINO_MOCK_LIBS_DIR ${binary_dir} PARENT_SCOPE)
|
set(ARDUINO_MOCK_LIBS_DIR ${binary_dir} PARENT_SCOPE)
|
||||||
|
0
test/build.sh
Normal file → Executable file
0
test/build.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user