diff options
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/CMakeLists.txt | 11 | ||||
-rw-r--r-- | unittests/Makefile | 14 | ||||
-rw-r--r-- | unittests/mixer_test.cpp | 2 |
3 files changed, 13 insertions, 14 deletions
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 644609a10..1657797e9 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -12,7 +12,7 @@ include_directories(${CMAKE_SOURCE_DIR}/../src/lib) add_definitions(-D__EXPORT=) set(CMAKE_C_FLAGS "-std=c99") -set(CMAKE_CXX_FLAGS "-std=c++11 -Wno-write-strings") +set(CMAKE_CXX_FLAGS "-std=c++11") # check add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure) @@ -46,7 +46,14 @@ add_executable(conversion_test conversion_test.cpp ${CMAKE_SOURCE_DIR}/../src/sy add_gtest(conversion_test) # sbus2_test +# TODO: move to gtest add_executable(sbus2_test sbus2_test.cpp hrt.cpp) +add_gtest(sbus2_test) +# st24_test +# TODO: move to gtest +add_executable(st24_test st24_test.cpp hrt.cpp ${CMAKE_SOURCE_DIR}/../src/lib/rc/st24.c) +add_gtest(st24_test) -# todo: add st24_test sf0x_test + +# todo: add sf0x_test diff --git a/unittests/Makefile b/unittests/Makefile index 1d6db6817..eb15ebbea 100644 --- a/unittests/Makefile +++ b/unittests/Makefile @@ -40,11 +40,7 @@ gtest_main.a: gtest-all.o gtest_main.o $(AR) $(ARFLAGS) $@ $^ -all: st24_test sf0x_test - -ST24_FILES=../src/lib/rc/st24.c \ - hrt.cpp \ - st24_test.cpp +all: sf0x_test SF0X_FILES= \ hrt.cpp \ @@ -54,17 +50,13 @@ SF0X_FILES= \ sf0x_test: $(SF0X_FILES) $(CC) -o sf0x_test $(SF0X_FILES) $(CFLAGS) -st24_test: $(ST24_FILES) - $(CC) -o st24_test $(ST24_FILES) $(CFLAGS) - cmake_gtests: mkdir -p build cd build && CC=gcc cmake .. && $(MAKE) check -unittests: clean sf0x_test st24_test cmake_gtests +unittests: clean sf0x_test cmake_gtests ./sf0x_test - ./st24_test .PHONY: clean clean: - rm -rf gtest.a gtest_main.a *.o $(ODIR)/*.o *~ core $(INCDIR)/*~ sample_unittest st24_test sf0x_test build + rm -rf gtest.a gtest_main.a *.o $(ODIR)/*.o *~ core $(INCDIR)/*~ sample_unittest sf0x_test build diff --git a/unittests/mixer_test.cpp b/unittests/mixer_test.cpp index 29595c067..fd3ece7f8 100644 --- a/unittests/mixer_test.cpp +++ b/unittests/mixer_test.cpp @@ -6,6 +6,6 @@ TEST(MixerTest, Mixer) { - char* args[] = {"empty", "../../ROMFS/px4fmu_common/mixers/IO_pass.mix", "../../ROMFS/px4fmu_common/mixers/FMU_quad_w.mix"}; + char* args[] = {"empty", "../ROMFS/px4fmu_common/mixers/IO_pass.mix", "../ROMFS/px4fmu_common/mixers/FMU_quad_w.mix"}; ASSERT_EQ(test_mixer(3, args), 0) << "IO_pass.mix failed"; } |