Skip to content

Commit

Permalink
add unit tests to cmake and appveyor config
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Dec 6, 2016
1 parent e4fd039 commit 6dfd50f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ script:
- ./bootstrap
- ./configure
- make test
- make distclean
- cmake .
- make
- make test
- make clean
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
12 changes: 12 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 6dfd50f

Please sign in to comment.