diff --git a/.travis.yml b/.travis.yml index 31f86b34..894f6a63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,29 @@ # .travis.yml -# Configure Travis CI service to build SOCI library -# Mateusz Loskot , http://github.com/SOCI +# Configure Travis CI service to build SOCI library, http://github.com/SOCI +# +# Copyright (c) 2013 Mateusz Loskot # language: cpp -# Testing against two compilers will create (at least) 2 rows in build matrix -# http://about.travis-ci.org/docs/user/languages/cpp/ compiler: - g++ - - clang + #- clang services: - mysql - postgresql +env: + matrix: + - SOCI_TRAVIS_BACKEND=db2 + - SOCI_TRAVIS_BACKEND=empty + - SOCI_TRAVIS_BACKEND=firebird + - SOCI_TRAVIS_BACKEND=mysql + - SOCI_TRAVIS_BACKEND=odbc + - SOCI_TRAVIS_BACKEND=oracle + - SOCI_TRAVIS_BACKEND=postgresql + - SOCI_TRAVIS_BACKEND=sqlite3 + before_install: ./bin/ci/before_install.sh before_script: ./bin/ci/before_script.sh script: ./bin/ci/script.sh @@ -22,7 +32,6 @@ notifications: email: recipients: - soci-devel@lists.sourceforge.net - - mateusz@loskot.net on_success: change # [always|never|change] # default: change on_failure: always # [always|never|change] # default: always diff --git a/bin/ci/before_install.sh b/bin/ci/before_install.sh index e076e897..4bc98abb 100755 --- a/bin/ci/before_install.sh +++ b/bin/ci/before_install.sh @@ -1,91 +1,13 @@ -#!/bin/bash -# Run before_intsall actions for SOCI build at travis-ci.org -# Mateusz Loskot , http://github.com/SOCI +#!/bin/bash -e +# Run before_install actions for SOCI build at travis-ci.org # -source ./bin/ci/common.sh -# Install dependencies -echo "$(tmstamp) *** before_install::apt-get starting $(date) ***" -#sudo apt-get install -qq apt-transport-https -#wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O - | sudo apt-key add - -#sudo bash -c 'echo "deb https://oss.oracle.com/debian unstable main non-free" >> /etc/apt/sources.list' -sudo bash -c 'echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list' +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192 sudo apt-get update -qq -#if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes ia32-libs ia32-libs-multiarch fi -sudo apt-get install -qq \ - tar bzip2 \ - libstdc++5 \ - libaio1 \ - libboost-dev libboost-date-time-dev \ - libmyodbc odbc-postgresql \ - firebird2.5-super firebird2.5-dev -echo "$(tmstamp) *** before_install::apt-get finished $(date) ***" - -echo "$(tmstamp) *** before_install::oracle starting $(date) ***" - -if wget http://brzuchol.loskot.net/software/oracle/instantclient_11_2-linux-x64-mloskot.tar.bz2 ; then - tar -jxf instantclient_11_2-linux-x64-mloskot.tar.bz2 - sudo mkdir -p /opt - sudo mv instantclient_11_2 /opt - sudo ln -s ${ORACLE_HOME}/libclntsh.so.11.1 ${ORACLE_HOME}/libclntsh.so - sudo ln -s ${ORACLE_HOME}/libocci.so.11.1 ${ORACLE_HOME}/libocci.so -else - echo "WARNING: failed to download Orcale distribution. Oracle will not be tested." -fi -echo "$(tmstamp) *** before_install::oracle finished $(date) ***" - -echo "$(tmstamp) *** before_install::db2 starting $(date) ***" -echo "Running apt-get install db2exc" -# deliberately verbose to test - mloskot -sudo apt-get install -y db2exc -echo "Running db2profile and db2rmln" -sudo /bin/sh -c '. ~db2inst1/sqllib/db2profile ; $DB2DIR/cfg/db2rmln' -echo "Setting up db2 users" -echo -e "db2inst1\ndb2inst1" | sudo passwd db2inst1 -echo -e "db2fenc1\ndb2fenc1" | sudo passwd db2fenc1 -echo -e "dasusr1\ndasusr1" | sudo passwd dasusr1 -echo "Configuring DB2 ODBC driver" -if test `getconf LONG_BIT` = "64" ; then - if test -f /home/db2inst1/sqllib/lib64/libdb2o.so ; then - DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib64/libdb2o.so - else - echo "ERROR: can't find the 64-bit DB2 ODBC library" - exit 1 - fi -else - if test -f /home/db2inst1/sqllib/lib32/libdb2.so ; then - DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib32/libdb2.so - elif test -f /home/db2inst1/sqllib/lib/libdb2.so ; then - DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib/libdb2.so - else - echo "ERROR: can't find the 32-bit DB2 ODBC library" - exit 1 - fi -fi -echo "DB2 ODBC driver set to $DB2_ODBC_DRIVER" -echo "$(tmstamp) *** before_install::db2 finished $(date) ***" - -echo "$(tmstamp) *** before_install::odbc starting $(date) ***" -# to prevent header file conflicts, unixodbc-dev has to be installed after -# db2rmln is run -sudo apt-get install -qq unixodbc-dev -echo "$(tmstamp) *** before_install::odbc finished $(date) ***" +sudo apt-get install -qq libboost-dev libboost-date-time-dev -echo "$(tmstamp) *** before_install::config starting $(date) ***" -# Configure Firebird -# See: Non-interactive setup for travis-ci.org -# http://tech.groups.yahoo.com/group/firebird-support/message/120883 -#sudo dpkg-reconfigure -f noninteractive firebird2.5-super -sudo sed /ENABLE_FIREBIRD_SERVER=/s/no/yes/ -i /etc/default/firebird2.5 -cat /etc/default/firebird2.5 | grep ENABLE_FIREBIRD_SERVER -sudo service firebird2.5-super start -# Configure ODBC -sudo odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini -cat < +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +sudo bash -c 'echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list' +sudo apt-get update -qq +sudo apt-get install -y db2exc + +echo "Running db2profile and db2rmln" +sudo /bin/sh -c '. ~db2inst1/sqllib/db2profile ; $DB2DIR/cfg/db2rmln' + +echo "Setting up db2 users" +echo -e "db2inst1\ndb2inst1" | sudo passwd db2inst1 +echo -e "db2fenc1\ndb2fenc1" | sudo passwd db2fenc1 +echo -e "dasusr1\ndasusr1" | sudo passwd dasusr1 + +echo "Configuring DB2 ODBC driver" +if test `getconf LONG_BIT` = "64" ; then + if test -f /home/db2inst1/sqllib/lib64/libdb2o.so ; then + DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib64/libdb2o.so + else + echo "ERROR: can't find the 64-bit DB2 ODBC library" + exit 1 + fi +else + if test -f /home/db2inst1/sqllib/lib32/libdb2.so ; then + DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib32/libdb2.so + elif test -f /home/db2inst1/sqllib/lib/libdb2.so ; then + DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib/libdb2.so + else + echo "ERROR: can't find the 32-bit DB2 ODBC library" + exit 1 + fi +fi +echo "DB2 ODBC driver set to $DB2_ODBC_DRIVER" diff --git a/bin/ci/before_install_firebird.sh b/bin/ci/before_install_firebird.sh new file mode 100755 index 00000000..9ec3214f --- /dev/null +++ b/bin/ci/before_install_firebird.sh @@ -0,0 +1,16 @@ +#!/bin/bash -e +# Install Firebird server for SOCI at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +sudo apt-get install -qq firebird2.5-super firebird2.5-dev + +# Configure Firebird server +# See: Non-interactive setup for travis-ci.org +# http://tech.groups.yahoo.com/group/firebird-support/message/120883 +#sudo dpkg-reconfigure -f noninteractive firebird2.5-super +sudo sed /ENABLE_FIREBIRD_SERVER=/s/no/yes/ -i /etc/default/firebird2.5 +cat /etc/default/firebird2.5 | grep ENABLE_FIREBIRD_SERVER +sudo service firebird2.5-super start diff --git a/bin/ci/before_install_odbc.sh b/bin/ci/before_install_odbc.sh new file mode 100755 index 00000000..e9f9346b --- /dev/null +++ b/bin/ci/before_install_odbc.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e +# Install ODBC libraries for SOCI at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +sudo apt-get install -qq \ + tar bzip2 \ + unixodbc-dev \ + libmyodbc odbc-postgresql + +sudo odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini diff --git a/bin/ci/before_install_oracle.sh b/bin/ci/before_install_oracle.sh new file mode 100755 index 00000000..fdd10675 --- /dev/null +++ b/bin/ci/before_install_oracle.sh @@ -0,0 +1,15 @@ +#!/bin/bash -e +# Install Oracle client libraries for SOCI at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +sudo apt-get install -qq tar bzip2 libaio1 + +wget http://brzuchol.loskot.net/software/oracle/instantclient_11_2-linux-x64-mloskot.tar.bz2 +tar -jxf instantclient_11_2-linux-x64-mloskot.tar.bz2 +sudo mkdir -p /opt +sudo mv instantclient_11_2 /opt +sudo ln -s ${ORACLE_HOME}/libclntsh.so.11.1 ${ORACLE_HOME}/libclntsh.so +sudo ln -s ${ORACLE_HOME}/libocci.so.11.1 ${ORACLE_HOME}/libocci.so diff --git a/bin/ci/before_script.sh b/bin/ci/before_script.sh index 8b8ed561..4fe32bc9 100755 --- a/bin/ci/before_script.sh +++ b/bin/ci/before_script.sh @@ -1,21 +1,9 @@ -#!/bin/bash +#!/bin/bash -e # Run before_script actions for SOCI build at travis-ci.org -# Mateusz Loskot , http://github.com/SOCI # -source ./bin/ci/common.sh -# Create local databases -echo "$(tmstamp) *** before_script::createdb starting $(date) ***" -# MySQL (service provided) -mysql --version -mysql -e 'create database soci_test;' -# PostgreSQL (service provided) -psql --version -psql -c 'create database soci_test;' -U postgres -# Firebird (installed manually, see before_install.sh) -isql-fb -z -q -i /dev/null # --version -echo 'CREATE DATABASE "LOCALHOST:/tmp/soci_test.fdb" PAGE_SIZE = 16384;' > /tmp/create_soci_test.sql -isql-fb -u SYSDBA -p masterkey -i /tmp/create_soci_test.sql -q -cat /tmp/create_soci_test.sql -sudo -u db2inst1 -i db2 "CREATE DATABASE SOCITEST" -sudo -u db2inst1 -i db2 "ACTIVATE DATABASE SOCITEST" -echo "$(tmstamp) *** before_script::createdb finished $(date) ***" +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +before_script="${TRAVIS_BUILD_DIR}/bin/ci/before_script_${SOCI_TRAVIS_BACKEND}.sh" +[ -x ${before_script} ] && ${before_script} || echo "nothing to run" diff --git a/bin/ci/before_script_db2.sh b/bin/ci/before_script_db2.sh new file mode 100755 index 00000000..9480c4d5 --- /dev/null +++ b/bin/ci/before_script_db2.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e +# Sets up environment for SOCI backend DB2 at travis-ci.org +# +# Copyright (c) 2013 Brian R. Toonen +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +sudo -u db2inst1 -i db2 "CREATE DATABASE SOCITEST" +sudo -u db2inst1 -i db2 "ACTIVATE DATABASE SOCITEST" diff --git a/bin/ci/before_script_firebird.sh b/bin/ci/before_script_firebird.sh new file mode 100755 index 00000000..35954571 --- /dev/null +++ b/bin/ci/before_script_firebird.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e +# Configure Firebird database for SOCI build at travis-ci.org +# +# Mateusz Loskot , http://github.com/SOCI +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +isql-fb -z -q -i /dev/null # --version +echo 'CREATE DATABASE "LOCALHOST:/tmp/soci_test.fdb" PAGE_SIZE = 16384;' > /tmp/create_soci_test.sql +isql-fb -u SYSDBA -p masterkey -i /tmp/create_soci_test.sql -q +cat /tmp/create_soci_test.sql diff --git a/bin/ci/before_script_mysql.sh b/bin/ci/before_script_mysql.sh new file mode 100755 index 00000000..b32f3149 --- /dev/null +++ b/bin/ci/before_script_mysql.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e +# Sets up environment for SOCI backend MySQL at travis-ci.org +# +# Mateusz Loskot , http://github.com/SOCI +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +mysql --version +mysql -e 'create database soci_test;' diff --git a/bin/ci/before_script_odbc.sh b/bin/ci/before_script_odbc.sh new file mode 100755 index 00000000..56495740 --- /dev/null +++ b/bin/ci/before_script_odbc.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e +# Sets up environment for SOCI backend ODBC at travis-ci.org +# +# Mateusz Loskot , http://github.com/SOCI +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +mysql --version +mysql -e 'create database soci_test;' +psql --version +psql -c 'create database soci_test;' -U postgres diff --git a/bin/ci/before_script_postgresql.sh b/bin/ci/before_script_postgresql.sh new file mode 100755 index 00000000..20a2579a --- /dev/null +++ b/bin/ci/before_script_postgresql.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e +# Sets up environment for SOCI backend PostgreSQL at travis-ci.org +# +# Mateusz Loskot , http://github.com/SOCI +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +psql --version +psql -c 'create database soci_test;' -U postgres diff --git a/bin/ci/common.sh b/bin/ci/common.sh index e2f5b026..0a643943 100644 --- a/bin/ci/common.sh +++ b/bin/ci/common.sh @@ -1,21 +1,36 @@ -#!/bin/bash +#!/bin/bash -e # Common definitions used by SOCI build scripts at travis-ci.org -# Mateusz Loskot , http://github.com/SOCI # -set -e - +# Copyright (c) 2013 Mateusz Loskot +# if [[ "$TRAVIS" != "true" ]] ; then echo "Running this script makes no sense outside of travis-ci.org" exit 1 fi -# Functions -tmstamp() { echo -n "[$(date '+%H:%M:%S')]" ; } +# # Environment -NUMTHREADS=4 +# +TCI_NUMTHREADS=2 if [[ -f /sys/devices/system/cpu/online ]]; then # Calculates 1.5 times physical threads - NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 )) + TCI_NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 )) fi -export NUMTHREADS export ORACLE_HOME=/opt/instantclient_11_2 export LD_LIBRARY_PATH=${ORACLE_HOME}:${LD_LIBRARY_PATH} +# +# Functions +# +tmstamp() +{ + echo -n "[$(date '+%H:%M:%S')]" ; +} + +run_make() +{ + [ $TCI_NUMTHREADS -gt 0 ] && make -j $TCI_NUMTHREADS ] || make +} + +run_test() +{ + ctest -V --output-on-failure . +} diff --git a/bin/ci/script.sh b/bin/ci/script.sh index d4c4795f..d982aee6 100755 --- a/bin/ci/script.sh +++ b/bin/ci/script.sh @@ -1,41 +1,14 @@ -#!/bin/bash -# Run script actions for SOCI build at travis-ci.org -# Mateusz Loskot , http://github.com/SOCI +#!/bin/bash -e +# Run test script actions for SOCI build at travis-ci.org # -source ./bin/ci/common.sh -# Build SOCI using CMake (primary build configuration) -mkdir -p src/_build -cd src/_build -echo "$(tmstamp) *** script::cmake-config starting $(date) ***" -if [ "${CXX}" == "g++" ] -then - ORACLE_USER="soci_tester" -else - ORACLE_USER="soci_tester1" -fi - -cmake \ - -DSOCI_STATIC=OFF \ - -DSOCI_TESTS=ON \ - -DSOCI_DB2_TEST_CONNSTR:STRING="DSN=SOCITEST\;Uid=db2inst1\;Pwd=db2inst1" \ - -DSOCI_EMPTY_TEST_CONNSTR:STRING="dummy connection" \ - -DSOCI_FIREBIRD_TEST_CONNSTR:STRING="service=LOCALHOST:/tmp/soci_test.fdb user=SYSDBA password=masterkey" \ - -DSOCI_MYSQL_TEST_CONNSTR:STRING="db=soci_test" \ - -DSOCI_ORACLE_TEST_CONNSTR:STRING="service=brzuchol.loskot.net user=${ORACLE_USER} password=soci_secret" \ - -DSOCI_POSTGRESQL_TEST_CONNSTR:STRING="dbname=soci_test user=postgres" \ - -DSOCI_SQLITE3_TEST_CONNSTR:STRING="soci_test.db" \ - -DSOCI_ODBC_TEST_POSTGRESQL_CONNSTR="FILEDSN=${PWD}/../backends/odbc/test/test-postgresql.dsn;" \ - -DSOCI_ODBC_TEST_MYSQL_CONNSTR="FILEDSN=${PWD}/../backends/odbc/test/test-mysql.dsn;" \ - -DSOCI_ODBC_TEST_DB2_CONNSTR:STRING="Driver=DB2\;Database=SOCITEST\;Uid=db2inst1\;Pwd=db2inst1" \ - .. -echo "$(tmstamp) *** script::cmake-config finished $(date) ***" +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh -echo "$(tmstamp) *** script::cmake-build starting $(date) ***" -echo "$(tmstamp) *** script::cmake-build make -j ${NUMTHREADS} $(date) ***" -#cmake --build . -make -j 4 -echo "$(tmstamp) *** script::cmake-build finished $(date) ***" +# prepare build directory +builddir="${TRAVIS_BUILD_DIR}/src/_build" +mkdir -p ${builddir} +cd ${builddir} -echo "$(tmstamp) *** script::cmake-test starting $(date) ***" -ctest -V --output-on-failure . -echo "$(tmstamp) *** script::cmake-test finished $(date) ***" +# build and run tests +${TRAVIS_BUILD_DIR}/bin/ci/script_${SOCI_TRAVIS_BACKEND}.sh diff --git a/bin/ci/script_db2.sh b/bin/ci/script_db2.sh new file mode 100755 index 00000000..ed174c15 --- /dev/null +++ b/bin/ci/script_db2.sh @@ -0,0 +1,24 @@ +#!/bin/bash -e +# Builds and tests SOCI backend DB2 at travis-ci.org +# +# Copyright (c) 2013 Brian R. Toonen +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=ON \ + -DSOCI_EMPTY=OFF \ + -DSOCI_FIREBIRD=OFF \ + -DSOCI_MYSQL=OFF \ + -DSOCI_ODBC=OFF \ + -DSOCI_ORACLE=OFF \ + -DSOCI_POSTGRESQL=OFF \ + -DSOCI_SQLITE3=OFF \ + -DSOCI_DB2_TEST_CONNSTR:STRING="DSN=SOCITEST\;Uid=db2inst1\;Pwd=db2inst1" \ + .. + +run_make +run_test diff --git a/bin/ci/script_empty.sh b/bin/ci/script_empty.sh new file mode 100755 index 00000000..a93e541e --- /dev/null +++ b/bin/ci/script_empty.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e +# Builds and tests SOCI backend empty at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=OFF \ + -DSOCI_EMPTY=ON \ + -DSOCI_FIREBIRD=OFF \ + -DSOCI_MYSQL=OFF \ + -DSOCI_ODBC=OFF \ + -DSOCI_ORACLE=OFF \ + -DSOCI_POSTGRESQL=OFF \ + -DSOCI_SQLITE3=OFF \ + .. + +run_make +run_test diff --git a/bin/ci/script_firebird.sh b/bin/ci/script_firebird.sh new file mode 100755 index 00000000..7c75fca7 --- /dev/null +++ b/bin/ci/script_firebird.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e +# Builds and tests SOCI backend Firebird at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=OFF \ + -DSOCI_EMPTY=OFF \ + -DSOCI_FIREBIRD=ON \ + -DSOCI_MYSQL=OFF \ + -DSOCI_ODBC=OFF \ + -DSOCI_ORACLE=OFF \ + -DSOCI_POSTGRESQL=OFF \ + -DSOCI_SQLITE3=OFF \ + -DSOCI_FIREBIRD_TEST_CONNSTR:STRING="service=LOCALHOST:/tmp/soci_test.fdb user=SYSDBA password=masterkey" \ + .. + +run_make +run_test diff --git a/bin/ci/script_mysql.sh b/bin/ci/script_mysql.sh new file mode 100755 index 00000000..58d57709 --- /dev/null +++ b/bin/ci/script_mysql.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e +# Builds and tests SOCI backend SQLite3 at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=OFF \ + -DSOCI_EMPTY=OFF \ + -DSOCI_FIREBIRD=OFF \ + -DSOCI_MYSQL=ON \ + -DSOCI_ODBC=OFF \ + -DSOCI_ORACLE=OFF \ + -DSOCI_POSTGRESQL=OFF \ + -DSOCI_SQLITE3=OFF \ + -DSOCI_MYSQL_TEST_CONNSTR:STRING="db=soci_test" \ + .. + +run_make +run_test diff --git a/bin/ci/script_odbc.sh b/bin/ci/script_odbc.sh new file mode 100755 index 00000000..79a655e7 --- /dev/null +++ b/bin/ci/script_odbc.sh @@ -0,0 +1,24 @@ +#!/bin/bash -e +# Builds and tests SOCI backend ODBC at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=OFF \ + -DSOCI_EMPTY=OFF \ + -DSOCI_FIREBIRD=OFF \ + -DSOCI_MYSQL=OFF \ + -DSOCI_ODBC=ON \ + -DSOCI_ORACLE=OFF \ + -DSOCI_POSTGRESQL=OFF \ + -DSOCI_SQLITE3=OFF \ + -DSOCI_ODBC_TEST_POSTGRESQL_CONNSTR="FILEDSN=${PWD}/../backends/odbc/test/test-postgresql.dsn;" \ + -DSOCI_ODBC_TEST_MYSQL_CONNSTR="FILEDSN=${PWD}/../backends/odbc/test/test-mysql.dsn;" \ + .. + +run_make +run_test diff --git a/bin/ci/script_oracle.sh b/bin/ci/script_oracle.sh new file mode 100755 index 00000000..743476c8 --- /dev/null +++ b/bin/ci/script_oracle.sh @@ -0,0 +1,30 @@ +#!/bin/bash -e +# Builds and tests SOCI backend Oracle at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +if [ "${CXX}" == "g++" ] +then + ORACLE_USER="soci_tester" +else + ORACLE_USER="soci_tester1" +fi + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=OFF \ + -DSOCI_EMPTY=OFF \ + -DSOCI_FIREBIRD=OFF \ + -DSOCI_MYSQL=OFF \ + -DSOCI_ODBC=OFF \ + -DSOCI_ORACLE=ON \ + -DSOCI_POSTGRESQL=OFF \ + -DSOCI_SQLITE3=OFF \ + -DSOCI_ORACLE_TEST_CONNSTR:STRING="service=brzuchol.loskot.net user=${ORACLE_USER} password=soci_secret" \ + .. + +run_make +run_test diff --git a/bin/ci/script_postgresql.sh b/bin/ci/script_postgresql.sh new file mode 100755 index 00000000..2a519461 --- /dev/null +++ b/bin/ci/script_postgresql.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e +# Builds and tests SOCI backend SQLite3 at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=OFF \ + -DSOCI_EMPTY=OFF \ + -DSOCI_FIREBIRD=OFF \ + -DSOCI_MYSQL=OFF \ + -DSOCI_ODBC=OFF \ + -DSOCI_ORACLE=OFF \ + -DSOCI_POSTGRESQL=ON \ + -DSOCI_SQLITE3=OFF \ + -DSOCI_POSTGRESQL_TEST_CONNSTR:STRING="dbname=soci_test user=postgres" \ + .. + +run_make +run_test diff --git a/bin/ci/script_sqlite3.sh b/bin/ci/script_sqlite3.sh new file mode 100755 index 00000000..1a3de1fe --- /dev/null +++ b/bin/ci/script_sqlite3.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e +# Builds and tests SOCI backend SQLite3 at travis-ci.org +# +# Copyright (c) 2013 Mateusz Loskot +# +source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh + +cmake \ + -DSOCI_TESTS=ON \ + -DSOCI_STATIC=OFF \ + -DSOCI_DB2=OFF \ + -DSOCI_EMPTY=OFF \ + -DSOCI_FIREBIRD=OFF \ + -DSOCI_MYSQL=OFF \ + -DSOCI_ODBC=OFF \ + -DSOCI_ORACLE=OFF \ + -DSOCI_POSTGRESQL=OFF \ + -DSOCI_SQLITE3=ON \ + -DSOCI_SQLITE3_TEST_CONNSTR:STRING="soci_test.db" \ + .. + +run_make +run_test