From 1e3688148d4e50236988c45b4f8e88f2d91d05c0 Mon Sep 17 00:00:00 2001 From: redaphid Date: Fri, 22 May 2015 01:42:18 -0700 Subject: [PATCH 1/8] CMake-ified. --- CMakeLists.txt | 42 +++++ Makefile | 352 +++++++++++++++++++++++++++++++++++++++ build.sh | 5 + lib/gmock/CMakeLists.txt | 17 ++ lib/gtest/CMakeLists.txt | 17 ++ test/CMakeLists.txt | 16 ++ test/gmock | 1 - test/googletest | 1 - 8 files changed, 449 insertions(+), 2 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 Makefile create mode 100755 build.sh create mode 100644 lib/gmock/CMakeLists.txt create mode 100644 lib/gtest/CMakeLists.txt create mode 100644 test/CMakeLists.txt delete mode 160000 test/gmock delete mode 160000 test/googletest diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..7af1535 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 2.8) +project (arduino_mock) + +find_package(Threads REQUIRED) +add_subdirectory(lib/gtest) +add_subdirectory(lib/gmock) + +message ("building arduino_mock") +message("Gtest include: ${GTEST_INCLUDE_DIRS}") +message("Gmock include: ${GMOCK_INCLUDE_DIRS}") +include_directories(${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} include) +file(GLOB SRC + "src/ArduinoMockAll.cc" +) + +add_library(arduino_mock STATIC ${SRC}) + +target_include_directories(arduino_mock + PUBLIC "include" +) + +target_link_libraries(arduino_mock + ${GTEST_LIBS_DIR}/libgtest.a + ${GMOCK_LIBS_DIR}/libgmock.a + ${CMAKE_THREAD_LIBS_INIT} +) + +set_target_properties( arduino_mock + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/dist/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/dist/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/dist/bin" +) + +add_dependencies(arduino_mock gtest gmock) + +option(test "Build all tests." OFF) + +if (test) + enable_testing() + add_subdirectory(test) +endif() diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..db6d827 --- /dev/null +++ b/Makefile @@ -0,0 +1,352 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/redaphid/Projects/Octoblu/arduino-mock + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/redaphid/Projects/Octoblu/arduino-mock + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." + /usr/bin/cmake -i . +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/redaphid/Projects/Octoblu/arduino-mock/CMakeFiles /home/redaphid/Projects/Octoblu/arduino-mock/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/redaphid/Projects/Octoblu/arduino-mock/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named arduino_mock + +# Build rule for target. +arduino_mock: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 arduino_mock +.PHONY : arduino_mock + +# fast build rule for target. +arduino_mock/fast: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/build +.PHONY : arduino_mock/fast + +src/Arduino.o: src/Arduino.cc.o +.PHONY : src/Arduino.o + +# target to build an object file +src/Arduino.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Arduino.cc.o +.PHONY : src/Arduino.cc.o + +src/Arduino.i: src/Arduino.cc.i +.PHONY : src/Arduino.i + +# target to preprocess a source file +src/Arduino.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Arduino.cc.i +.PHONY : src/Arduino.cc.i + +src/Arduino.s: src/Arduino.cc.s +.PHONY : src/Arduino.s + +# target to generate assembly for a file +src/Arduino.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Arduino.cc.s +.PHONY : src/Arduino.cc.s + +src/ArduinoMockAll.o: src/ArduinoMockAll.cc.o +.PHONY : src/ArduinoMockAll.o + +# target to build an object file +src/ArduinoMockAll.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/ArduinoMockAll.cc.o +.PHONY : src/ArduinoMockAll.cc.o + +src/ArduinoMockAll.i: src/ArduinoMockAll.cc.i +.PHONY : src/ArduinoMockAll.i + +# target to preprocess a source file +src/ArduinoMockAll.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/ArduinoMockAll.cc.i +.PHONY : src/ArduinoMockAll.cc.i + +src/ArduinoMockAll.s: src/ArduinoMockAll.cc.s +.PHONY : src/ArduinoMockAll.s + +# target to generate assembly for a file +src/ArduinoMockAll.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/ArduinoMockAll.cc.s +.PHONY : src/ArduinoMockAll.cc.s + +src/EEPROM.o: src/EEPROM.cc.o +.PHONY : src/EEPROM.o + +# target to build an object file +src/EEPROM.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/EEPROM.cc.o +.PHONY : src/EEPROM.cc.o + +src/EEPROM.i: src/EEPROM.cc.i +.PHONY : src/EEPROM.i + +# target to preprocess a source file +src/EEPROM.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/EEPROM.cc.i +.PHONY : src/EEPROM.cc.i + +src/EEPROM.s: src/EEPROM.cc.s +.PHONY : src/EEPROM.s + +# target to generate assembly for a file +src/EEPROM.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/EEPROM.cc.s +.PHONY : src/EEPROM.cc.s + +src/Serial.o: src/Serial.cc.o +.PHONY : src/Serial.o + +# target to build an object file +src/Serial.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Serial.cc.o +.PHONY : src/Serial.cc.o + +src/Serial.i: src/Serial.cc.i +.PHONY : src/Serial.i + +# target to preprocess a source file +src/Serial.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Serial.cc.i +.PHONY : src/Serial.cc.i + +src/Serial.s: src/Serial.cc.s +.PHONY : src/Serial.s + +# target to generate assembly for a file +src/Serial.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Serial.cc.s +.PHONY : src/Serial.cc.s + +src/Spark.o: src/Spark.cc.o +.PHONY : src/Spark.o + +# target to build an object file +src/Spark.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Spark.cc.o +.PHONY : src/Spark.cc.o + +src/Spark.i: src/Spark.cc.i +.PHONY : src/Spark.i + +# target to preprocess a source file +src/Spark.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Spark.cc.i +.PHONY : src/Spark.cc.i + +src/Spark.s: src/Spark.cc.s +.PHONY : src/Spark.s + +# target to generate assembly for a file +src/Spark.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Spark.cc.s +.PHONY : src/Spark.cc.s + +src/WiFi.o: src/WiFi.cc.o +.PHONY : src/WiFi.o + +# target to build an object file +src/WiFi.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/WiFi.cc.o +.PHONY : src/WiFi.cc.o + +src/WiFi.i: src/WiFi.cc.i +.PHONY : src/WiFi.i + +# target to preprocess a source file +src/WiFi.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/WiFi.cc.i +.PHONY : src/WiFi.cc.i + +src/WiFi.s: src/WiFi.cc.s +.PHONY : src/WiFi.s + +# target to generate assembly for a file +src/WiFi.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/WiFi.cc.s +.PHONY : src/WiFi.cc.s + +src/Wire.o: src/Wire.cc.o +.PHONY : src/Wire.o + +# target to build an object file +src/Wire.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Wire.cc.o +.PHONY : src/Wire.cc.o + +src/Wire.i: src/Wire.cc.i +.PHONY : src/Wire.i + +# target to preprocess a source file +src/Wire.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Wire.cc.i +.PHONY : src/Wire.cc.i + +src/Wire.s: src/Wire.cc.s +.PHONY : src/Wire.s + +# target to generate assembly for a file +src/Wire.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Wire.cc.s +.PHONY : src/Wire.cc.s + +src/serialHelper.o: src/serialHelper.cc.o +.PHONY : src/serialHelper.o + +# target to build an object file +src/serialHelper.cc.o: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/serialHelper.cc.o +.PHONY : src/serialHelper.cc.o + +src/serialHelper.i: src/serialHelper.cc.i +.PHONY : src/serialHelper.i + +# target to preprocess a source file +src/serialHelper.cc.i: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/serialHelper.cc.i +.PHONY : src/serialHelper.cc.i + +src/serialHelper.s: src/serialHelper.cc.s +.PHONY : src/serialHelper.s + +# target to generate assembly for a file +src/serialHelper.cc.s: + $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/serialHelper.cc.s +.PHONY : src/serialHelper.cc.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... arduino_mock" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... src/Arduino.o" + @echo "... src/Arduino.i" + @echo "... src/Arduino.s" + @echo "... src/ArduinoMockAll.o" + @echo "... src/ArduinoMockAll.i" + @echo "... src/ArduinoMockAll.s" + @echo "... src/EEPROM.o" + @echo "... src/EEPROM.i" + @echo "... src/EEPROM.s" + @echo "... src/Serial.o" + @echo "... src/Serial.i" + @echo "... src/Serial.s" + @echo "... src/Spark.o" + @echo "... src/Spark.i" + @echo "... src/Spark.s" + @echo "... src/WiFi.o" + @echo "... src/WiFi.i" + @echo "... src/WiFi.s" + @echo "... src/Wire.o" + @echo "... src/Wire.i" + @echo "... src/Wire.s" + @echo "... src/serialHelper.o" + @echo "... src/serialHelper.i" + @echo "... src/serialHelper.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..7c4386c --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd build +cmake -Dtest=ON .. +make +make test diff --git a/lib/gmock/CMakeLists.txt b/lib/gmock/CMakeLists.txt new file mode 100644 index 0000000..723d633 --- /dev/null +++ b/lib/gmock/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 2.8.8) +project(gmock_builder C CXX) +include(ExternalProject) + +ExternalProject_Add(gmock + URL https://googlemock.googlecode.com/files/gmock-1.7.0.zip + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gmock + INSTALL_COMMAND "" +) + +# Specify include dir +ExternalProject_Get_Property(gmock source_dir) +set(GMOCK_INCLUDE_DIRS ${source_dir}/include PARENT_SCOPE) + +# Specify MainTest's link libraries +ExternalProject_Get_Property(gmock binary_dir) +set(GMOCK_LIBS_DIR ${binary_dir} PARENT_SCOPE) diff --git a/lib/gtest/CMakeLists.txt b/lib/gtest/CMakeLists.txt new file mode 100644 index 0000000..d710055 --- /dev/null +++ b/lib/gtest/CMakeLists.txt @@ -0,0 +1,17 @@ +message("in gtest") +project(gtest_builder C CXX) +include(ExternalProject) + +ExternalProject_Add(gtest + URL https://googletest.googlecode.com/files/gtest-1.7.0.zip + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest + INSTALL_COMMAND "" +) + +# Specify include dir +ExternalProject_Get_Property(gtest source_dir) +set(GTEST_INCLUDE_DIRS ${source_dir}/include PARENT_SCOPE) + +# Specify MainTest's link libraries +ExternalProject_Get_Property(gtest binary_dir) +set(GTEST_LIBS_DIR ${binary_dir} PARENT_SCOPE) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..375dccc --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,16 @@ +message ("building tests for Arduino Mock") +# include_directories(${GTEST_INCLUDE_DIRS}) +file(GLOB SRCS *.cc) + +add_executable(arduinoMockTest ${SRCS}) + +target_link_libraries(arduinoMockTest + arduino_mock + ${GTEST_LIBS_DIR}/libgtest.a + ${GTEST_LIBS_DIR}/libgtest_main.a + ${GMOCK_LIBS_DIR}/libgmock.a + ${CMAKE_THREAD_LIBS_INIT} +) + +add_dependencies(arduinoMockTest gtest) +add_test(arduino_mock_test arduinoMockTest) diff --git a/test/gmock b/test/gmock deleted file mode 160000 index 896ba0e..0000000 --- a/test/gmock +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 896ba0e03f520fb9b6ed582bde2bd00847e3c3f2 diff --git a/test/googletest b/test/googletest deleted file mode 160000 index 4650552..0000000 --- a/test/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4650552ff637bb44ecf7784060091cbed3252211 From 986ef081b741e7b50c725cef999846a7257980a9 Mon Sep 17 00:00:00 2001 From: ikeyasu Date: Sun, 24 May 2015 15:11:01 +0900 Subject: [PATCH 2/8] Support ctest --- Makefile | 352 -------------------------------------------- test/CMakeLists.txt | 8 +- test/Makefile | 184 ----------------------- test/test_all.cc | 12 ++ 4 files changed, 16 insertions(+), 540 deletions(-) delete mode 100644 Makefile delete mode 100644 test/Makefile create mode 100644 test/test_all.cc diff --git a/Makefile b/Makefile deleted file mode 100644 index db6d827..0000000 --- a/Makefile +++ /dev/null @@ -1,352 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/redaphid/Projects/Octoblu/arduino-mock - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/redaphid/Projects/Octoblu/arduino-mock - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." - /usr/bin/cmake -i . -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/redaphid/Projects/Octoblu/arduino-mock/CMakeFiles /home/redaphid/Projects/Octoblu/arduino-mock/CMakeFiles/progress.marks - $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/redaphid/Projects/Octoblu/arduino-mock/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named arduino_mock - -# Build rule for target. -arduino_mock: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 arduino_mock -.PHONY : arduino_mock - -# fast build rule for target. -arduino_mock/fast: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/build -.PHONY : arduino_mock/fast - -src/Arduino.o: src/Arduino.cc.o -.PHONY : src/Arduino.o - -# target to build an object file -src/Arduino.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Arduino.cc.o -.PHONY : src/Arduino.cc.o - -src/Arduino.i: src/Arduino.cc.i -.PHONY : src/Arduino.i - -# target to preprocess a source file -src/Arduino.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Arduino.cc.i -.PHONY : src/Arduino.cc.i - -src/Arduino.s: src/Arduino.cc.s -.PHONY : src/Arduino.s - -# target to generate assembly for a file -src/Arduino.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Arduino.cc.s -.PHONY : src/Arduino.cc.s - -src/ArduinoMockAll.o: src/ArduinoMockAll.cc.o -.PHONY : src/ArduinoMockAll.o - -# target to build an object file -src/ArduinoMockAll.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/ArduinoMockAll.cc.o -.PHONY : src/ArduinoMockAll.cc.o - -src/ArduinoMockAll.i: src/ArduinoMockAll.cc.i -.PHONY : src/ArduinoMockAll.i - -# target to preprocess a source file -src/ArduinoMockAll.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/ArduinoMockAll.cc.i -.PHONY : src/ArduinoMockAll.cc.i - -src/ArduinoMockAll.s: src/ArduinoMockAll.cc.s -.PHONY : src/ArduinoMockAll.s - -# target to generate assembly for a file -src/ArduinoMockAll.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/ArduinoMockAll.cc.s -.PHONY : src/ArduinoMockAll.cc.s - -src/EEPROM.o: src/EEPROM.cc.o -.PHONY : src/EEPROM.o - -# target to build an object file -src/EEPROM.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/EEPROM.cc.o -.PHONY : src/EEPROM.cc.o - -src/EEPROM.i: src/EEPROM.cc.i -.PHONY : src/EEPROM.i - -# target to preprocess a source file -src/EEPROM.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/EEPROM.cc.i -.PHONY : src/EEPROM.cc.i - -src/EEPROM.s: src/EEPROM.cc.s -.PHONY : src/EEPROM.s - -# target to generate assembly for a file -src/EEPROM.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/EEPROM.cc.s -.PHONY : src/EEPROM.cc.s - -src/Serial.o: src/Serial.cc.o -.PHONY : src/Serial.o - -# target to build an object file -src/Serial.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Serial.cc.o -.PHONY : src/Serial.cc.o - -src/Serial.i: src/Serial.cc.i -.PHONY : src/Serial.i - -# target to preprocess a source file -src/Serial.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Serial.cc.i -.PHONY : src/Serial.cc.i - -src/Serial.s: src/Serial.cc.s -.PHONY : src/Serial.s - -# target to generate assembly for a file -src/Serial.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Serial.cc.s -.PHONY : src/Serial.cc.s - -src/Spark.o: src/Spark.cc.o -.PHONY : src/Spark.o - -# target to build an object file -src/Spark.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Spark.cc.o -.PHONY : src/Spark.cc.o - -src/Spark.i: src/Spark.cc.i -.PHONY : src/Spark.i - -# target to preprocess a source file -src/Spark.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Spark.cc.i -.PHONY : src/Spark.cc.i - -src/Spark.s: src/Spark.cc.s -.PHONY : src/Spark.s - -# target to generate assembly for a file -src/Spark.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Spark.cc.s -.PHONY : src/Spark.cc.s - -src/WiFi.o: src/WiFi.cc.o -.PHONY : src/WiFi.o - -# target to build an object file -src/WiFi.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/WiFi.cc.o -.PHONY : src/WiFi.cc.o - -src/WiFi.i: src/WiFi.cc.i -.PHONY : src/WiFi.i - -# target to preprocess a source file -src/WiFi.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/WiFi.cc.i -.PHONY : src/WiFi.cc.i - -src/WiFi.s: src/WiFi.cc.s -.PHONY : src/WiFi.s - -# target to generate assembly for a file -src/WiFi.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/WiFi.cc.s -.PHONY : src/WiFi.cc.s - -src/Wire.o: src/Wire.cc.o -.PHONY : src/Wire.o - -# target to build an object file -src/Wire.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Wire.cc.o -.PHONY : src/Wire.cc.o - -src/Wire.i: src/Wire.cc.i -.PHONY : src/Wire.i - -# target to preprocess a source file -src/Wire.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Wire.cc.i -.PHONY : src/Wire.cc.i - -src/Wire.s: src/Wire.cc.s -.PHONY : src/Wire.s - -# target to generate assembly for a file -src/Wire.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/Wire.cc.s -.PHONY : src/Wire.cc.s - -src/serialHelper.o: src/serialHelper.cc.o -.PHONY : src/serialHelper.o - -# target to build an object file -src/serialHelper.cc.o: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/serialHelper.cc.o -.PHONY : src/serialHelper.cc.o - -src/serialHelper.i: src/serialHelper.cc.i -.PHONY : src/serialHelper.i - -# target to preprocess a source file -src/serialHelper.cc.i: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/serialHelper.cc.i -.PHONY : src/serialHelper.cc.i - -src/serialHelper.s: src/serialHelper.cc.s -.PHONY : src/serialHelper.s - -# target to generate assembly for a file -src/serialHelper.cc.s: - $(MAKE) -f CMakeFiles/arduino_mock.dir/build.make CMakeFiles/arduino_mock.dir/src/serialHelper.cc.s -.PHONY : src/serialHelper.cc.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... arduino_mock" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... src/Arduino.o" - @echo "... src/Arduino.i" - @echo "... src/Arduino.s" - @echo "... src/ArduinoMockAll.o" - @echo "... src/ArduinoMockAll.i" - @echo "... src/ArduinoMockAll.s" - @echo "... src/EEPROM.o" - @echo "... src/EEPROM.i" - @echo "... src/EEPROM.s" - @echo "... src/Serial.o" - @echo "... src/Serial.i" - @echo "... src/Serial.s" - @echo "... src/Spark.o" - @echo "... src/Spark.i" - @echo "... src/Spark.s" - @echo "... src/WiFi.o" - @echo "... src/WiFi.i" - @echo "... src/WiFi.s" - @echo "... src/Wire.o" - @echo "... src/Wire.i" - @echo "... src/Wire.s" - @echo "... src/serialHelper.o" - @echo "... src/serialHelper.i" - @echo "... src/serialHelper.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 375dccc..85d98b9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,9 +2,9 @@ message ("building tests for Arduino Mock") # include_directories(${GTEST_INCLUDE_DIRS}) file(GLOB SRCS *.cc) -add_executable(arduinoMockTest ${SRCS}) +add_executable(test_all test_all.cc) -target_link_libraries(arduinoMockTest +target_link_libraries(test_all arduino_mock ${GTEST_LIBS_DIR}/libgtest.a ${GTEST_LIBS_DIR}/libgtest_main.a @@ -12,5 +12,5 @@ target_link_libraries(arduinoMockTest ${CMAKE_THREAD_LIBS_INIT} ) -add_dependencies(arduinoMockTest gtest) -add_test(arduino_mock_test arduinoMockTest) +add_dependencies(test_all gtest) +add_test(arduino_mock_test test_all) diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index f567a1c..0000000 --- a/test/Makefile +++ /dev/null @@ -1,184 +0,0 @@ -# vim: set noexpandtab: -# A sample Makefile for building Google Test and using it in user -# tests. Please tweak it to suit your environment and project. You -# may want to move it to your project's root directory. -# -# SYNOPSIS: -# -# make [all] - makes everything. -# make TARGET - makes the given target. -# make test - Run all tests -# make clean - removes all files generated by make. -# make format - format coding style. - -# Please tweak the following variable definitions as needed by your -# project, except GTEST_HEADERS, which you can use in your own targets -# but shouldn't modify. - -# Points to the root of Google Test, relative to where this file is. -# Remember to tweak this if you move this file. -GTEST_DIR = ./googletest - -# Points to the root of Google Mock, relative to where this file is. -# Remember to tweak this if you move this file. -GMOCK_DIR = ./gmock - -# Points to the root of Arduino mock, relative to where this file is. -# Remember to tweak this if you move this file. -ARDUINO_MOCK_DIR = .. - -# Where to find user code. -TEST_DIR = . - -# Flags passed to the preprocessor. -# Set Google Test's header directory as a system directory, such that -# the compiler doesn't generate warnings in Google Test headers. -CPPFLAGS += -isystem $(GTEST_DIR)/include -isystem $(GMOCK_DIR)/include \ - -I$(ARDUINO_MOCK_DIR)/include - -# Flags passed to the C++ compiler. -CXXFLAGS += -g -Wall -Wextra -pthread \ - -Wno-missing-field-initializers \ - -Wno-missing-braces \ - -Wno-unused-command-line-argument - - -# All tests produced by this Makefile. Remember to add new tests you -# created to the list. -TESTS = Arduino_unittest Wire_unittest Serial_unittest Spark_unittest EEPROM_unittest WiFi_unittest serialHelper_unittest - -# All Google Test headers. Usually you shouldn't change this -# definition. -GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \ - $(GTEST_DIR)/include/gtest/internal/*.h - -# All Google Mock headers. Note that all Google Test headers are -# included here too, as they are included by Google Mock headers. -# Usually you shouldn't change this definition. -GMOCK_HEADERS = $(GMOCK_DIR)/include/gmock/*.h \ - $(GMOCK_DIR)/include/gmock/internal/*.h \ - $(GTEST_HEADERS) - -# Arduino Mock headers. -# Usually you shouldn't change this definition. -ARDUINO_MOCK_HEADERS = $(ARDUINO_MOCK_DIR)/include/arduino-mock/*.h - -# House-keeping build targets. - -all : $(TESTS) - -test : $(TESTS) - for t in $(TESTS); do ./$$t; done; - -clean : - rm -f $(TESTS) gmock.a gtest_main.a gmock_main.a \ - arduino_mock_all.a *.o - -format : - ../script/codeformatter.sh - -# Builds gtest.a and gtest_main.a. - -# Usually you shouldn't tweak such internal variables, indicated by a -# trailing _. -GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS) -GMOCK_SRCS_ = $(GMOCK_DIR)/src/*.cc $(GMOCK_HEADERS) -ARDUINO_MOCK_SRCS_ = $(ARDUINO_MOCK_DIR)/src/*.cc $(ARDUINO_MOCK_HEADERS) - -# For simplicity and to avoid depending on implementation details of -# Google Mock and Google Test, the dependencies specified below are -# conservative and not optimized. This is fine as Google Mock and -# Google Test compile fast and for ordinary users their source rarely -# changes. -gtest-all.o : $(GTEST_SRCS_) - $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CXXFLAGS) \ - -c $(GTEST_DIR)/src/gtest-all.cc - -gmock-all.o : $(GMOCK_SRCS_) - $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CXXFLAGS) \ - -c $(GMOCK_DIR)/src/gmock-all.cc - -gmock_main.o : $(GMOCK_SRCS_) - $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CXXFLAGS) \ - -c $(GMOCK_DIR)/src/gmock_main.cc - -gmock.a : gmock-all.o gtest-all.o - $(AR) $(ARFLAGS) $@ $^ - -gmock_main.a : gmock-all.o gtest-all.o gmock_main.o - $(AR) $(ARFLAGS) $@ $^ - -# Builds Arduino mocks. -ArduinoMockAll.o : $(ARDUINO_MOCK_SRCS_) - $(CXX) $(CPPFLAGS) -I$(ARDUINO_MOCK_DIR) $(CXXFLAGS) -c \ - $(ARDUINO_MOCK_DIR)/src/ArduinoMockAll.cc - -arduino_mock_all.a : ArduinoMockAll.o - $(AR) $(ARFLAGS) $@ $^ - -# Builds a test. A test should link with either gtest.a or -# gtest_main.a, depending on whether it defines its own main() -# function. - -Serial_unittest.o : $(TEST_DIR)/Serial_unittest.cc \ - $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(TEST_DIR)/Serial_unittest.cc - -Serial_unittest : Serial_unittest.o \ - gmock_main.a \ - arduino_mock_all.a - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ - -serialHelper_unittest.o : $(TEST_DIR)/serialHelper_unittest.cc \ - $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(TEST_DIR)/serialHelper_unittest.cc - -serialHelper_unittest : serialHelper_unittest.o \ - gmock_main.a \ - arduino_mock_all.a - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ - -Spark_unittest.o : $(TEST_DIR)/Spark_unittest.cc \ - $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(TEST_DIR)/Spark_unittest.cc - -Spark_unittest : Spark_unittest.o \ - gmock_main.a \ - arduino_mock_all.a - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ - -Arduino_unittest.o : $(TEST_DIR)/Arduino_unittest.cc \ - $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(TEST_DIR)/Arduino_unittest.cc - -Arduino_unittest : Arduino_unittest.o \ - gmock_main.a \ - arduino_mock_all.a - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ - -EEPROM_unittest.o : $(TEST_DIR)/EEPROM_unittest.cc \ - $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(TEST_DIR)/EEPROM_unittest.cc - -EEPROM_unittest : EEPROM_unittest.o \ - gmock_main.a \ - arduino_mock_all.a - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ - -Wire_unittest.o : $(TEST_DIR)/Wire_unittest.cc \ - $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(TEST_DIR)/Wire_unittest.cc - -Wire_unittest : Wire_unittest.o \ - gmock_main.a \ - arduino_mock_all.a - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ - -WiFi_unittest.o : $(TEST_DIR)/WiFi_unittest.cc \ - $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(TEST_DIR)/WiFi_unittest.cc - -WiFi_unittest : WiFi_unittest.o \ - gmock_main.a \ - arduino_mock_all.a - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ diff --git a/test/test_all.cc b/test/test_all.cc new file mode 100644 index 0000000..09d76c5 --- /dev/null +++ b/test/test_all.cc @@ -0,0 +1,12 @@ +#include "Arduino_unittest.cc" +#include "EEPROM_unittest.cc" +#include "Serial_unittest.cc" +#include "serialHelper_unittest.cc" +#include "Spark_unittest.cc" +#include "WiFi_unittest.cc" +#include "Wire_unittest.cc" + +int main(int argc, char* argv[]) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} From b1418f890efa6adb5031ae601e53b3aa338d7ed3 Mon Sep 17 00:00:00 2001 From: ikeyasu Date: Sun, 24 May 2015 15:11:19 +0900 Subject: [PATCH 3/8] Update .gititnore for CMake/ctest --- .gitignore | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e7f7f5c..30f42e5 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ CMakeCache.txt CMakeFiles cmake_install.cmake install_manifest.txt +CTestTestfile.cmake #ignore thumbnails created by windows Thumbs.db @@ -56,5 +57,9 @@ _ReSharper*/ build*/ *~ -#ignore binaries -*_unittest +#ignore executable binaries +test/test_all + +#ignore external lib +/lib/gmock/gmock/ +/lib/gtest/gtest/ From 954089728d4489078935ea246e5fea27d8cc87b7 Mon Sep 17 00:00:00 2001 From: ikeyasu Date: Sun, 24 May 2015 15:57:29 +0900 Subject: [PATCH 4/8] Update .travis.yml for CMake --- .travis.yml | 20 +++++++++++++++----- CMakeLists.txt | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fda4973..be0d609 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,20 @@ language: cpp +sudo: false compiler: - - gcc + - gcc before_install: - - sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu/ trusty main universe" - - sudo apt-get update -qq - - sudo apt-get install astyle=2.03-1 -qq + # astyle-2.03 + # downloading astyle-2.03 + - mkdir -p .travis-tmp/astyle-2.03 + - wget -P .travis-tmp/astyle-2.03/ http://heanet.dl.sourceforge.net/project/astyle/astyle/astyle%202.03/astyle_2.03_linux.tar.gz + - tar xvzf .travis-tmp/astyle-2.03/astyle_2.03_linux.tar.gz -C .travis-tmp/astyle-2.03/ + # build astyle-2.03 + - pushd .travis-tmp/astyle-2.03/astyle/build/gcc && make && export PATH=`pwd`/bin:$PATH && popd + # cmake-3.2.2 + - mkdir -p .travis-tmp/cmake-3.2.2 + - wget -P .travis-tmp/cmake-3.2.2/ http://www.cmake.org/files/v3.2/cmake-3.2.2-Linux-x86_64.sh + - bash .travis-tmp/cmake-3.2.2/cmake-3.2.2-Linux-x86_64.sh --exclude-subdir --prefix=.travis-tmp/cmake-3.2.2 --skip-license + - export PATH=`pwd`/.travis-tmp/cmake-3.2.2/bin:$PATH script: - - pushd test && make test && popd + - cmake -Dtest=ON && make && ctest -V - ./script/travis_format_checcker.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 7af1535..f44785f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.8) project (arduino_mock) find_package(Threads REQUIRED) From 22ca52ff15d6fcf79f4c3be71b5daa47dc68cbb9 Mon Sep 17 00:00:00 2001 From: ikeyasu Date: Sun, 24 May 2015 17:23:08 +0900 Subject: [PATCH 5/8] move build.sh to /build/ --- .travis.yml | 2 +- build.sh | 5 ----- build/build.sh | 7 +++++++ 3 files changed, 8 insertions(+), 6 deletions(-) delete mode 100755 build.sh create mode 100755 build/build.sh diff --git a/.travis.yml b/.travis.yml index be0d609..1e4a0d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,5 @@ before_install: - bash .travis-tmp/cmake-3.2.2/cmake-3.2.2-Linux-x86_64.sh --exclude-subdir --prefix=.travis-tmp/cmake-3.2.2 --skip-license - export PATH=`pwd`/.travis-tmp/cmake-3.2.2/bin:$PATH script: - - cmake -Dtest=ON && make && ctest -V + - pushd build && ./build.sh && popd - ./script/travis_format_checcker.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index 7c4386c..0000000 --- a/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -cd build -cmake -Dtest=ON .. -make -make test diff --git a/build/build.sh b/build/build.sh new file mode 100755 index 0000000..9629bc2 --- /dev/null +++ b/build/build.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu + +cd -- "$(dirname -- "$0")" +cmake -Dtest=ON .. +make +ctest -V From 92987e3a18c1a2f424ecf2fc33b8e207136e38e4 Mon Sep 17 00:00:00 2001 From: ikeyasu Date: Wed, 27 May 2015 21:46:32 +0900 Subject: [PATCH 6/8] move build/build.sh to build.sh --- build/build.sh => build.sh | 2 ++ 1 file changed, 2 insertions(+) rename build/build.sh => build.sh (76%) diff --git a/build/build.sh b/build.sh similarity index 76% rename from build/build.sh rename to build.sh index 9629bc2..cf88fa9 100755 --- a/build/build.sh +++ b/build.sh @@ -2,6 +2,8 @@ set -eu cd -- "$(dirname -- "$0")" +mkdir -p build +cd build cmake -Dtest=ON .. make ctest -V From 7ebee4a23845fb137a7a34099fb56ccb033ea984 Mon Sep 17 00:00:00 2001 From: ikeyasu Date: Fri, 12 Aug 2016 10:04:08 +0900 Subject: [PATCH 7/8] fix. .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e4a0d5..6fad5f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,5 @@ before_install: - bash .travis-tmp/cmake-3.2.2/cmake-3.2.2-Linux-x86_64.sh --exclude-subdir --prefix=.travis-tmp/cmake-3.2.2 --skip-license - export PATH=`pwd`/.travis-tmp/cmake-3.2.2/bin:$PATH script: - - pushd build && ./build.sh && popd + - ./build.sh - ./script/travis_format_checcker.sh From 7cfc0dd03ca6c0daa2b1941357e9e66cadf14983 Mon Sep 17 00:00:00 2001 From: ikeyasu Date: Fri, 12 Aug 2016 10:08:38 +0900 Subject: [PATCH 8/8] fix. url to download cmake in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6fad5f2..c952dde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: - pushd .travis-tmp/astyle-2.03/astyle/build/gcc && make && export PATH=`pwd`/bin:$PATH && popd # cmake-3.2.2 - mkdir -p .travis-tmp/cmake-3.2.2 - - wget -P .travis-tmp/cmake-3.2.2/ http://www.cmake.org/files/v3.2/cmake-3.2.2-Linux-x86_64.sh + - wget --no-check-certificate -P .travis-tmp/cmake-3.2.2/ https://cmake.org/files/v3.2/cmake-3.2.2-Linux-x86_64.sh - bash .travis-tmp/cmake-3.2.2/cmake-3.2.2-Linux-x86_64.sh --exclude-subdir --prefix=.travis-tmp/cmake-3.2.2 --skip-license - export PATH=`pwd`/.travis-tmp/cmake-3.2.2/bin:$PATH script: