From 6dfd50f13f18be0d381d2bcd2f9cebb71d7c7615 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Mon, 5 Dec 2016 18:39:37 -0800 Subject: [PATCH] add unit tests to cmake and appveyor config --- .travis.yml | 5 +++++ CMakeLists.txt | 9 +++++++++ appveyor.yml | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 402f631..904cc0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,8 @@ script: - ./bootstrap - ./configure - make test +- make distclean +- cmake . +- make +- make test +- make clean diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bfe761..40db882 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,3 +14,12 @@ include_directories (include win32) add_definitions (-DHAVE_CONFIG_H -DYAML_DECLARE_STATIC) add_library (yaml STATIC ${SRC}) +add_executable (test-version tests/test-version.c) +target_link_libraries(test-version yaml) +add_test(NAME version COMMAND test-version) + +add_executable (test-reader tests/test-reader.c) +target_link_libraries(test-reader yaml) +add_test(NAME reader COMMAND test-reader) + +enable_testing() diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..7922b4b --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,12 @@ +version: 0.1.7.{build} + +image: +- Visual Studio 2015 +- Visual Studio 2013 + +build_script: +- cmake . +- cmake --build . --config release --clean-first +- ctest -C release +- C:\cygwin\bin\sh -c "export PATH=/usr/bin:/usr/local/bin:$PATH && ./bootstrap && ./configure && make && make test && make distclean" +- C:\cygwin64\bin\sh -c "export PATH=/usr/bin:/usr/local/bin:$PATH && ./bootstrap && ./configure && make && make test && make distclean" -- 2.45.1