From ada826aa8f5e5f5a565e28deb9ae8132ec056fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Sat, 24 Aug 2013 19:20:36 +0200 Subject: [PATCH] Adding a "test" target to CMake & a Travis CI config file --- .gitignore | 2 ++ .travis.yml | 15 +++++++++++++++ CMakeLists.txt | 11 +++++++++++ README.md | 5 +++++ 4 files changed, 33 insertions(+) create mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index 8e56601..865e38c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ Debug Release +build *.ncb *.suo @@ -9,3 +10,4 @@ Release doc core *ipch +.settings/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..99d1f06 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: cpp + +compiler: + - gcc + - clang + +# using a symbolic link to get the "make test" to work as if launched from the root directorys +before_script: + - mkdir build + - cd build + - cmake .. + - ln -s ../examples examples + +script: make && make test + diff --git a/CMakeLists.txt b/CMakeLists.txt index ef69108..d91ef7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,23 @@ cmake_minimum_required (VERSION 2.6) project (SQLiteCpp) add_definitions(-rdynamic -fstack-protector-all -Wall -Wextra -pedantic -Weffc++ -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wundef -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn) + +# add the wrapper as a library add_library(SQLiteCpp src/Column.cpp src/Database.cpp src/Statement.cpp src/Transaction.cpp ) + +# add the exmple1 executable, linked with the wrapper library add_executable(example1 examples/example1/main.cpp) target_link_libraries (example1 SQLiteCpp sqlite3) +# add a "test" target: +enable_testing() + +# does the example1 runs successfully +add_test (Example1Run example1) + + diff --git a/README.md b/README.md index c77d43e..1f10af7 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,11 @@ cd Release cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release make -j +### Continuous Integration + +This project is continuously tested under Ubuntu Linux with the gcc and clang compilers +using the Travis-CI community service (https://travis-ci.org) + ### License Copyright (c) 2012-2013 Sébastien Rombauts (sebastien.rombauts@gmail.com)