Adding a "test" target to CMake & a Travis CI config file

This commit is contained in:
Sébastien Rombauts 2013-08-24 19:20:36 +02:00
parent a02c80d157
commit ada826aa8f
4 changed files with 33 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,5 +1,6 @@
Debug Debug
Release Release
build
*.ncb *.ncb
*.suo *.suo
@ -9,3 +10,4 @@ Release
doc doc
core core
*ipch *ipch
.settings/

15
.travis.yml Normal file
View File

@ -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

View File

@ -1,12 +1,23 @@
cmake_minimum_required (VERSION 2.6) cmake_minimum_required (VERSION 2.6)
project (SQLiteCpp) 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_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 add_library(SQLiteCpp
src/Column.cpp src/Column.cpp
src/Database.cpp src/Database.cpp
src/Statement.cpp src/Statement.cpp
src/Transaction.cpp src/Transaction.cpp
) )
# add the exmple1 executable, linked with the wrapper library
add_executable(example1 examples/example1/main.cpp) add_executable(example1 examples/example1/main.cpp)
target_link_libraries (example1 SQLiteCpp sqlite3) target_link_libraries (example1 SQLiteCpp sqlite3)
# add a "test" target:
enable_testing()
# does the example1 runs successfully
add_test (Example1Run example1)

View File

@ -98,6 +98,11 @@ cd Release
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j 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 ### License
Copyright (c) 2012-2013 Sébastien Rombauts (sebastien.rombauts@gmail.com) Copyright (c) 2012-2013 Sébastien Rombauts (sebastien.rombauts@gmail.com)