Skip to content

Commit

Permalink
Merge pull request #356 from fnc12/dev
Browse files Browse the repository at this point in the history
1.4
  • Loading branch information
fnc12 authored Aug 13, 2019
2 parents 24283f6 + ac860bc commit de4e2bd
Show file tree
Hide file tree
Showing 82 changed files with 9,532 additions and 7,986 deletions.
185 changes: 109 additions & 76 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,114 @@
# Defaults
os: linux
dist: xenial

language: cpp
sudo: required
matrix:
include:
- name: "GCC-9"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- ninja-build
env:
- CC: gcc-9
- CXX: g++-9

compiler:
- clang
- name: "GCC-7"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- ninja-build
env:
- CC: gcc-7
- CXX: g++-7

os:
- osx
- name: "LLVM/Clang (Travis default)"
language: cpp
compiler: clang
addons:
apt:
packages:
- ninja-build
env:
- SQLITE_ORM_OMITS_CODECVT: ON

- name: AppleClang-10.0.1
os: osx
osx_image: xcode10.2
language: cpp
env:
- SQLITE_ORM_OMITS_CODECVT: ON
addons:
homebrew:
packages:
- catch2
- ninja
update: true

- name: "LLVM/Clang (latest)"
os: osx
osx_image: xcode10.2
addons:
homebrew:
packages:
- llvm
- catch2
- ninja
update: true
env:
- CPPFLAGS: "-I/usr/local/opt/llvm/include"
- LDFLAGS: "-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
- CPATH: /usr/local/opt/llvm/include
- LIBRARY_PATH: /usr/local/opt/llvm/lib
- LD_LIBRARY_PATH: /usr/local/opt/llvm/lib
- CC: /usr/local/opt/llvm/bin/clang
- CXX: /usr/local/opt/llvm/bin/clang++
- SQLITE_ORM_OMITS_CODECVT: ON

- name: "GCC-6"
os: osx
osx_image: xcode10.2
addons:
homebrew:
packages:
- gcc@6
- catch2
- ninja
update: true
env:
- CC: gcc-6
- CXX: g++-6

before_install:
- |
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" # Use coreutils from homebrew.
fi
install:
- |
# Catch2 test framework
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
git clone --depth=1 --quiet https://github.com/catchorg/Catch2.git
cd Catch2
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo env "PATH=$PATH" cmake --build ./build --target install
fi
# scripts to run before build
before_script:
- if [[ "$CXX" == *"clang"* ]]; then clang --version ; fi
- cd ${TRAVIS_BUILD_DIR}
- mkdir compile && cd compile
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DSQLITE_ORM_OMITS_CODECVT="${SQLITE_ORM_OMITS_CODECVT:OFF}" ..

# build examples, and run tests (ie make & make test)
script:
- wget https://sqlite.org/2017/sqlite-amalgamation-3190300.zip
- unzip sqlite-amalgamation-3190300.zip
- mkdir sqlite_amalgamation
- cp -r sqlite-amalgamation-3190300/* sqlite_amalgamation
- rm sqlite-amalgamation-3190300.zip
- clang -c sqlite-amalgamation-3190300/sqlite3.c -o sqlite.static
- clang++ -std=c++1y tests/tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -o tests.out
- ./tests.out
- clang++ -std=c++1y tests/tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -D SQLITE_ORM_OMITS_CODECVT -o tests_without_codecvt.out
- ./tests_without_codecvt.out
- clang++ -std=c++1y tests/static_tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -o static_tests.out
- ./static_tests.out
- clang++ -std=c++1y examples/core_functions.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/distinct.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/enum_binding.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/group_by.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/in_memory.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/iteration.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/key_value.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/nullable_enum_binding.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/select.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/subentities.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/insert.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/update.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/multi_table_select.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/cross_join.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/blob.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/foreign_key.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/index.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/date_time.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/composite_key.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/unique.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/synchronous.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/self_join.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/natural_join.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/union.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/subquery.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/having.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/exists.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/except_intersection.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- clang++ -std=c++1y examples/custom_aliases.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
- ./a.out
- cmake --build . --config Debug -- -k 10
- ctest --verbose --output-on-failure -C Debug -j $(nproc)
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cmake_minimum_required (VERSION 3.2)
cmake_policy(SET CMP0057 NEW)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand All @@ -10,6 +12,8 @@ set(PACKAGE_VERSION ${sqlite_orm_VERSION})

project("sqlite_orm" VERSION ${PACKAGE_VERSION})

set(CMAKE_VERBOSE_MAKEFILE ON)

message(STATUS "Configuring ${CMAKE_PROJECT_NAME} ${sqlite_orm_VERSION}")

set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
Expand Down
94 changes: 94 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# How to Contribute #

Thank you for your interest in contributing to the sqlite_orm project!

## GitHub pull requests ##

This is the preferred method of submitting changes. When you submit a pull request through github,
it activates the continuous integration (CI) build systems at Appveyor and Travis to build your changes
on a variety of Linux, Windows and MacOS configurations and run all the test suites. Follow these requirements
for a successful pull request:

1. All significant changes require a [github issue](https://github.com/fnc12/sqlite_orm/issues). Trivial changes such as fixing a typo or a compiler warning do not.

1. The pull request title must begin with the github issue identifier if it has an associated issue, for example:

#9999 : an example pull request title
1. Commit messages must be understandable in future by different developers and must be written in english language only:

Instructions:

1. Create a fork in your GitHub account of http://github.com/fnc12/sqlite_orm
1. Clone the fork to your development system.
1. Create a branch for your changes (best practice is following git flow pattern with issue number as branch name, e.g. feature/9999-some-feature or bugfix/9999-some-bug).
1. Modify the source to include the improvement/bugfix, and:

* Remember to provide *tests* for all submitted changes!
* Use test-driven development (TDD): add a test that will isolate the bug *before* applying the change that fixes it.
* Verify that you follow current code style on sqlite_orm.
* [*optional*] Verify that your change works on other platforms by adding a GitHub service hook to [Travis CI](http://docs.travis-ci.com/user/getting-started/#Step-one%3A-Sign-in) and [AppVeyor](http://www.appveyor.com/docs). You can use this technique to run the sqlite_orm CI jobs in your account to check your changes before they are made public. Every GitHub pull request into sqlite_orm will run the full CI build and test suite on your changes.

1. Commit and push changes to your branch (please use issue name and description as commit title, e.g. "make it perfect. (fixes #9999)").
1. Use GitHub to create a pull request going from your branch to sqlite_orm:dev. Ensure that the github issue number is at the beginning of the title of your pull request.
1. Wait for other contributors or committers to review your new addition, and for a CI build to complete.
1. Wait for a owner or collaborators to commit your patch.

## If you want to build the project locally ##

See our detailed instructions on the [CMake README](/build/cmake/README.md).

## If you want to review open issues... ##

1. Review the [GitHub Pull Request Backlog](https://github.com/fnc12/sqlite_orm/pulls). Code reviews are opened to all.

## If you discovered a defect... ##

1. Check to see if the issue is already in the [github issues](https://github.com/fnc12/sqlite_orm/issues).
1. If not please create an issue describing the change you're proposing in the github issues page.
1. Contribute your code changes using the GitHub pull request method:

## GitHub recipes for Pull Requests ##

Sometimes commmitters may ask you to take actions in your pull requests. Here are some recipes that will help you accomplish those requests. These examples assume you are working on github issue 9999. You should also be familiar with the [upstream](https://help.github.com/articles/syncing-a-fork/) repository concept.

### Squash your changes ###

If you have commits with adding code which is removed in a different commit within the same PR then please squash all commits to remove unnecessary add commits.

1. Use the command ``git log`` to identify how many commits you made since you began.
2. Use the command ``git rebase -i HEAD~N`` where N is the number of commits.
3. Leave "pull" in the first line.
4. Change all other lines from "pull" to "fixup".
5. All your changes are now in a single commit.

If you already have a pull request outstanding, you will need to do a "force push" to overwrite it since you changed your commit history:

git push -u origin feature/9999-make-perfect --force

A more detailed walkthrough of a squash can be found at [Git Ready](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html).

### Rebase your pull request ###

If your pull request has a conflict with dev, it needs to be rebased:

git checkout feature/9999-make-perfect
git rebase upstream dev
(resolve any conflicts, make sure it builds)
git push -u origin feature/9999-make-perfect --force

### Fix a bad merge ###

If your pull request contains commits that are not yours, then you should use the following technique to fix the bad merge in your branch:

git checkout dev
git pull upstream dev
git checkout -b feature/9999-make-perfect-take-2
git cherry-pick ...
(pick only your commits from your original pull request in ascending chronological order)
squash your changes to a single commit if there is more than one (see above)
git push -u origin feature/9999-make-perfect-take-2:feature/9999-make-perfect

This procedure will apply only your commits in order to the current dev, then you will squash them to a single commit, and then you force push your local feature/9999-make-perfect-take-2 into remote feature/9999-make-perfect which represents your pull request, replacing all the commits with the new one.


Loading

0 comments on commit de4e2bd

Please sign in to comment.