Skip to content

Commit de4e2bd

Browse files
authored
Merge pull request #356 from fnc12/dev
1.4
2 parents 24283f6 + ac860bc commit de4e2bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+9532
-7986
lines changed

.travis.yml

Lines changed: 109 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,114 @@
1+
# Defaults
2+
os: linux
3+
dist: xenial
14

2-
language: cpp
3-
sudo: required
5+
matrix:
6+
include:
7+
- name: "GCC-9"
8+
addons:
9+
apt:
10+
sources:
11+
- ubuntu-toolchain-r-test
12+
packages:
13+
- g++-9
14+
- ninja-build
15+
env:
16+
- CC: gcc-9
17+
- CXX: g++-9
418

5-
compiler:
6-
- clang
19+
- name: "GCC-7"
20+
addons:
21+
apt:
22+
sources:
23+
- ubuntu-toolchain-r-test
24+
packages:
25+
- g++-7
26+
- ninja-build
27+
env:
28+
- CC: gcc-7
29+
- CXX: g++-7
730

8-
os:
9-
- osx
31+
- name: "LLVM/Clang (Travis default)"
32+
language: cpp
33+
compiler: clang
34+
addons:
35+
apt:
36+
packages:
37+
- ninja-build
38+
env:
39+
- SQLITE_ORM_OMITS_CODECVT: ON
1040

41+
- name: AppleClang-10.0.1
42+
os: osx
43+
osx_image: xcode10.2
44+
language: cpp
45+
env:
46+
- SQLITE_ORM_OMITS_CODECVT: ON
47+
addons:
48+
homebrew:
49+
packages:
50+
- catch2
51+
- ninja
52+
update: true
53+
54+
- name: "LLVM/Clang (latest)"
55+
os: osx
56+
osx_image: xcode10.2
57+
addons:
58+
homebrew:
59+
packages:
60+
- llvm
61+
- catch2
62+
- ninja
63+
update: true
64+
env:
65+
- CPPFLAGS: "-I/usr/local/opt/llvm/include"
66+
- LDFLAGS: "-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
67+
- CPATH: /usr/local/opt/llvm/include
68+
- LIBRARY_PATH: /usr/local/opt/llvm/lib
69+
- LD_LIBRARY_PATH: /usr/local/opt/llvm/lib
70+
- CC: /usr/local/opt/llvm/bin/clang
71+
- CXX: /usr/local/opt/llvm/bin/clang++
72+
- SQLITE_ORM_OMITS_CODECVT: ON
73+
74+
- name: "GCC-6"
75+
os: osx
76+
osx_image: xcode10.2
77+
addons:
78+
homebrew:
79+
packages:
80+
- gcc@6
81+
- catch2
82+
- ninja
83+
update: true
84+
env:
85+
- CC: gcc-6
86+
- CXX: g++-6
87+
88+
before_install:
89+
- |
90+
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
91+
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" # Use coreutils from homebrew.
92+
fi
93+
94+
install:
95+
- |
96+
# Catch2 test framework
97+
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
98+
git clone --depth=1 --quiet https://github.com/catchorg/Catch2.git
99+
cd Catch2
100+
cmake -Bbuild -H. -DBUILD_TESTING=OFF
101+
sudo env "PATH=$PATH" cmake --build ./build --target install
102+
fi
103+
104+
# scripts to run before build
105+
before_script:
106+
- if [[ "$CXX" == *"clang"* ]]; then clang --version ; fi
107+
- cd ${TRAVIS_BUILD_DIR}
108+
- mkdir compile && cd compile
109+
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DSQLITE_ORM_OMITS_CODECVT="${SQLITE_ORM_OMITS_CODECVT:OFF}" ..
110+
111+
# build examples, and run tests (ie make & make test)
11112
script:
12-
- wget https://sqlite.org/2017/sqlite-amalgamation-3190300.zip
13-
- unzip sqlite-amalgamation-3190300.zip
14-
- mkdir sqlite_amalgamation
15-
- cp -r sqlite-amalgamation-3190300/* sqlite_amalgamation
16-
- rm sqlite-amalgamation-3190300.zip
17-
- clang -c sqlite-amalgamation-3190300/sqlite3.c -o sqlite.static
18-
- clang++ -std=c++1y tests/tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -o tests.out
19-
- ./tests.out
20-
- 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
21-
- ./tests_without_codecvt.out
22-
- clang++ -std=c++1y tests/static_tests.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -stdlib=libc++ -o static_tests.out
23-
- ./static_tests.out
24-
- clang++ -std=c++1y examples/core_functions.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
25-
- ./a.out
26-
- clang++ -std=c++1y examples/distinct.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
27-
- ./a.out
28-
- clang++ -std=c++1y examples/enum_binding.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
29-
- ./a.out
30-
- clang++ -std=c++1y examples/group_by.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
31-
- ./a.out
32-
- clang++ -std=c++1y examples/in_memory.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
33-
- ./a.out
34-
- clang++ -std=c++1y examples/iteration.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
35-
- ./a.out
36-
- clang++ -std=c++1y examples/key_value.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
37-
- ./a.out
38-
- clang++ -std=c++1y examples/nullable_enum_binding.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
39-
- ./a.out
40-
- clang++ -std=c++1y examples/select.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
41-
- ./a.out
42-
- clang++ -std=c++1y examples/subentities.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
43-
- ./a.out
44-
- clang++ -std=c++1y examples/insert.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
45-
- ./a.out
46-
- clang++ -std=c++1y examples/update.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
47-
- ./a.out
48-
- clang++ -std=c++1y examples/multi_table_select.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
49-
- ./a.out
50-
- clang++ -std=c++1y examples/cross_join.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
51-
- ./a.out
52-
- clang++ -std=c++1y examples/blob.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
53-
- ./a.out
54-
- clang++ -std=c++1y examples/foreign_key.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
55-
- ./a.out
56-
- clang++ -std=c++1y examples/index.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
57-
- ./a.out
58-
- clang++ -std=c++1y examples/date_time.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
59-
- ./a.out
60-
- clang++ -std=c++1y examples/composite_key.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
61-
- ./a.out
62-
- clang++ -std=c++1y examples/unique.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
63-
- ./a.out
64-
- clang++ -std=c++1y examples/synchronous.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
65-
- ./a.out
66-
- clang++ -std=c++1y examples/self_join.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
67-
- ./a.out
68-
- clang++ -std=c++1y examples/natural_join.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
69-
- ./a.out
70-
- clang++ -std=c++1y examples/union.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
71-
- ./a.out
72-
- clang++ -std=c++1y examples/subquery.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
73-
- ./a.out
74-
- clang++ -std=c++1y examples/having.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
75-
- ./a.out
76-
- clang++ -std=c++1y examples/exists.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
77-
- ./a.out
78-
- clang++ -std=c++1y examples/except_intersection.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
79-
- ./a.out
80-
- clang++ -std=c++1y examples/custom_aliases.cpp sqlite.static -I include/ -I sqlite_amalgamation/ -ldl -lpthread -o a.out
81-
- ./a.out
113+
- cmake --build . --config Debug -- -k 10
114+
- ctest --verbose --output-on-failure -C Debug -j $(nproc)

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
cmake_minimum_required (VERSION 3.2)
2+
cmake_policy(SET CMP0057 NEW)
3+
24
set(CMAKE_CXX_STANDARD 14)
35
set(CMAKE_CXX_STANDARD_REQUIRED ON)
46

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

1113
project("sqlite_orm" VERSION ${PACKAGE_VERSION})
1214

15+
set(CMAKE_VERBOSE_MAKEFILE ON)
16+
1317
message(STATUS "Configuring ${CMAKE_PROJECT_NAME} ${sqlite_orm_VERSION}")
1418

1519
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")

CONTRIBUTING.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# How to Contribute #
2+
3+
Thank you for your interest in contributing to the sqlite_orm project!
4+
5+
## GitHub pull requests ##
6+
7+
This is the preferred method of submitting changes. When you submit a pull request through github,
8+
it activates the continuous integration (CI) build systems at Appveyor and Travis to build your changes
9+
on a variety of Linux, Windows and MacOS configurations and run all the test suites. Follow these requirements
10+
for a successful pull request:
11+
12+
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.
13+
14+
1. The pull request title must begin with the github issue identifier if it has an associated issue, for example:
15+
16+
#9999 : an example pull request title
17+
18+
1. Commit messages must be understandable in future by different developers and must be written in english language only:
19+
20+
Instructions:
21+
22+
1. Create a fork in your GitHub account of http://github.com/fnc12/sqlite_orm
23+
1. Clone the fork to your development system.
24+
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).
25+
1. Modify the source to include the improvement/bugfix, and:
26+
27+
* Remember to provide *tests* for all submitted changes!
28+
* Use test-driven development (TDD): add a test that will isolate the bug *before* applying the change that fixes it.
29+
* Verify that you follow current code style on sqlite_orm.
30+
* [*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.
31+
32+
1. Commit and push changes to your branch (please use issue name and description as commit title, e.g. "make it perfect. (fixes #9999)").
33+
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.
34+
1. Wait for other contributors or committers to review your new addition, and for a CI build to complete.
35+
1. Wait for a owner or collaborators to commit your patch.
36+
37+
## If you want to build the project locally ##
38+
39+
See our detailed instructions on the [CMake README](/build/cmake/README.md).
40+
41+
## If you want to review open issues... ##
42+
43+
1. Review the [GitHub Pull Request Backlog](https://github.com/fnc12/sqlite_orm/pulls). Code reviews are opened to all.
44+
45+
## If you discovered a defect... ##
46+
47+
1. Check to see if the issue is already in the [github issues](https://github.com/fnc12/sqlite_orm/issues).
48+
1. If not please create an issue describing the change you're proposing in the github issues page.
49+
1. Contribute your code changes using the GitHub pull request method:
50+
51+
## GitHub recipes for Pull Requests ##
52+
53+
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.
54+
55+
### Squash your changes ###
56+
57+
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.
58+
59+
1. Use the command ``git log`` to identify how many commits you made since you began.
60+
2. Use the command ``git rebase -i HEAD~N`` where N is the number of commits.
61+
3. Leave "pull" in the first line.
62+
4. Change all other lines from "pull" to "fixup".
63+
5. All your changes are now in a single commit.
64+
65+
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:
66+
67+
git push -u origin feature/9999-make-perfect --force
68+
69+
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).
70+
71+
### Rebase your pull request ###
72+
73+
If your pull request has a conflict with dev, it needs to be rebased:
74+
75+
git checkout feature/9999-make-perfect
76+
git rebase upstream dev
77+
(resolve any conflicts, make sure it builds)
78+
git push -u origin feature/9999-make-perfect --force
79+
80+
### Fix a bad merge ###
81+
82+
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:
83+
84+
git checkout dev
85+
git pull upstream dev
86+
git checkout -b feature/9999-make-perfect-take-2
87+
git cherry-pick ...
88+
(pick only your commits from your original pull request in ascending chronological order)
89+
squash your changes to a single commit if there is more than one (see above)
90+
git push -u origin feature/9999-make-perfect-take-2:feature/9999-make-perfect
91+
92+
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.
93+
94+

0 commit comments

Comments
 (0)