Skip to content

Commit

Permalink
Set up Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyates committed Oct 12, 2015
1 parent 8e86761 commit b510081
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 266 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sudo: false
addons:
apt:
packages:
- libboost-all-dev
- libgtest-dev
- libsqlite3-dev
- xutils-dev
postgresql: "9.4"
env:
- PG_USER=postgres CPPAR_LIBRARYPATHS=$HOME/gtest
language: cpp
install:
- bundle install --path vendor/bundle
- mkdir $HOME/cppar_build $HOME/gtest
- cp -r /usr/src/gtest $HOME/cppar_build
- cd $HOME/cppar_build/gtest && cmake . && make && mv libg* $HOME/gtest && cd -
script: ./configure && bundle exec rake test
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
[![Build Status](https://secure.travis-ci.org/joeyates/cpp-active-record.png)][Continuous Integration]

ActiveRecord - a C++ implementation of the Active Record pattern.

* [Source][Source Code]
* [Continuous Integration][Continuous Integration]

[Source Code]: https://github.com/joeyates/cpp-active-record "Source code at GitHub"
[Continuous Integration]: http://travis-ci.org/joeyates/cpp-active-record "Build status by Travis-CI"

Databases supported:
* PostgreSQL
* SQLite
Expand Down
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require 'rake/builder'
ARCHITECTURE = 'x86_64'
PROFILED = ENV['PROFILED']
GTEST_FILTER = ENV['GTEST_FILTER']
LIBRARY_PATHS = (ENV['CPPAR_LIBRARYPATHS'] || '').split(',')

def running_tests
tasks = Rake.application.top_level_tasks
Expand Down Expand Up @@ -76,6 +77,7 @@ Rake::Builder.new do |builder|
builder.objects_path = "objects/#{name}"
builder.include_paths = include_paths
builder.compilation_options = ['-pg'] if PROFILED
builder.library_paths = LIBRARY_PATHS
end

TEST_NAME = "#{name}_test"
Expand All @@ -98,7 +100,7 @@ Rake::Builder.new do |builder|
builder.include_paths = include_paths + ['test']
builder.linker_options = ['-L.']
builder.library_dependencies = ['gtest', "active_record_#{name}", 'pq', 'sqlite3', 'pthread']
builder.library_paths = ["."]
builder.library_paths = LIBRARY_PATHS + ["."]
builder.target_prerequisites = [:"rake:build"]
builder.default_task = :run
builder.target_parameters = test_target_parameters
Expand Down
Loading

0 comments on commit b510081

Please sign in to comment.