Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcpkg port 1.8 fixes #1121

Merged
merged 23 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
80a30d9
Merge remote-tracking branch 'upstream/dev' into dev
trueqbit Jul 8, 2022
dae4287
Merge remote-tracking branch 'upstream/dev' into dev
trueqbit Jan 13, 2023
f776085
Corrected passing warning flags to msvc
trueqbit Jan 15, 2023
3154d24
Updated to Catch2 v3
trueqbit Jan 15, 2023
8e9625e
Fixed availability of chrono binding example
trueqbit Jan 15, 2023
5330ecd
Corrected appveyor vcpkg initialization
trueqbit Jan 15, 2023
a0acab7
Turned `type_is_nullable` into a specializable struct again
trueqbit Jan 16, 2023
b9bcc29
Fixed availability of pointer passing example
trueqbit Jan 16, 2023
3f1a03b
Disable vcpkg telemetry on appveyor builds
trueqbit Jan 16, 2023
0a20570
Correctly pin appveyor vcpkg test environment
trueqbit Jan 16, 2023
9532b82
Clang-formatted all files
trueqbit Jan 16, 2023
c21687b
Revert "removed PointerAlignment and changer DerivePointerAlignment t…
fnc12 Dec 9, 2020
5818dac
Applied new code formatting
trueqbit Jan 16, 2023
16720e3
Updated clang-format lint action
trueqbit Jan 16, 2023
b15409a
Updated Catch2 dependency handling
trueqbit Jan 16, 2023
848e54d
Remove dangling submodule path
trueqbit Jan 16, 2023
5ab4931
Corrected grammar in documentation for concepts
trueqbit Jan 16, 2023
1116c83
Another attempt to bootstrap vcpkg on windows
trueqbit Jan 23, 2023
5c369fb
Merge branch 'dev' into vcpkg-port-1.8-fixes
trueqbit Jan 23, 2023
2bdb84c
Another attempt to bootstrap vcpkg on windows
trueqbit Jan 23, 2023
9ed4f4c
Fixed stupid mistake in appveyor build path
trueqbit Jan 24, 2023
785868c
Try C++14 with Visual Studio 2022 instead of Visual Studio 2015 Update 3
trueqbit Jan 24, 2023
a4c4e6b
Runner-up: Conformance fallback for NSMDI
trueqbit Jan 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ for:
if "%appveyor_build_worker_image%"=="Visual Studio 2015" (set generator="Visual Studio 14 2015" %architecture%)
install:
- |-
cd C:\Tools\vcpkg
git clone --depth 1 --branch 2023.01.09 https://github.com/microsoft/vcpkg.git "$HOME/vcpkg"
.\bootstrap-vcpkg.bat
cd "%APPVEYOR_BUILD_FOLDER%"
C:\Tools\vcpkg\vcpkg integrate install
vcpkg install sqlite3:%platform%-windows
before_build:
Expand All @@ -121,6 +125,8 @@ for:
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
git clone --depth 1 --branch 2023.01.09 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
$HOME/vcpkg/booststrap.sh
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
vcpkg install sqlite3 --overlay-triplets=vcpkg/triplets
before_build:
Expand All @@ -145,7 +151,7 @@ for:
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
git clone --depth 1 --branch 2022.05.10 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
git clone --depth 1 --branch 2023.01.09 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
$HOME/vcpkg/booststrap.sh
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
vcpkg install sqlite3 --overlay-triplets=vcpkg/triplets
Expand Down
2 changes: 1 addition & 1 deletion dev/statement_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ namespace sqlite_orm {
using statement_type = conflict_clause_t;

template<class Ctx>
std::string operator()(const statement_type& statement, const Ctx& context) const {
std::string operator()(const statement_type& statement, const Ctx&) const {
switch(statement) {
case conflict_clause_t::rollback:
return "ROLLBACK";
Expand Down
18 changes: 8 additions & 10 deletions examples/chrono_binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include <format>

#if __cpp_lib_chrono >= 201907L && __cpp_lib_format >= 201907L
#define ENABLE_THIS_EXAMPLE
#endif

#ifdef ENABLE_THIS_EXAMPLE

///////////////////////////////
/// sys_days binding as TEXT
Expand All @@ -14,11 +18,6 @@
#include <sstream>
#include <regex>

static std::chrono::sys_days today() {
const auto today = std::chrono::sys_days{floor<std::chrono::days>(std::chrono::system_clock::now())};
return today;
}

/**
* This is the date we want to map to our sqlite db.
* Let's make it `TEXT`
Expand Down Expand Up @@ -143,10 +142,10 @@ struct Person {
std::string name;
std::chrono::sys_days birthdate;
};
#endif

int main(int argc, const char* argv[]) {
cout << argv[0] << endl;

int main(int, char**) {
#ifdef ENABLE_THIS_EXAMPLE
const std::string db_name = "sys_days.sqlite";
::remove(db_name.c_str());

Expand All @@ -168,6 +167,5 @@ int main(int argc, const char* argv[]) {
auto pers = storage.get<Person>(1);
year_month_day ymd = pers.birthdate; // using the implicit operator from sys_days to year_month_day
assert(ymd == birthdate);
}

#endif
}
16 changes: 7 additions & 9 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,29 +141,27 @@ if (MSVC)
if (MSVC_VERSION LESS_EQUAL 1900)
target_compile_options(unit_tests PUBLIC
# C4503: decorated name length exceeded
/wd"4503"
/wd4503
# C4800: forcing value to bool (performance warning)
/wd"4800")
/wd4800)
else()
target_compile_options(unit_tests PUBLIC
# warning-level 4
/W4
# C4127: conditional expression is constant
/wd"4127"
/wd4127
# C4456: declaration of 'symbol' hides previous local declaration
/wd"4456"
/wd4456
# C4458: declaration of 'symbol' hides class member
/wd"4458")
/wd4458)
endif()
endif()

target_precompile_headers(unit_tests PRIVATE
<sqlite_orm/sqlite_orm.h>
<catch2/catch.hpp>)
# tests.cpp contains CATCH_CONFIG_MAIN
set_source_files_properties(tests.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
<catch2/catch_all.hpp>)

target_link_libraries(unit_tests PRIVATE sqlite_orm Catch2::Catch2)
target_link_libraries(unit_tests PRIVATE sqlite_orm Catch2::Catch2WithMain)

add_test(NAME "All_in_one_unit_test"
COMMAND unit_tests
Expand Down
2 changes: 1 addition & 1 deletion tests/ast_iterator_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/backup_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>
#include <cstdio> // remove

using namespace sqlite_orm;
Expand Down
2 changes: 1 addition & 1 deletion tests/built_in_functions_tests/core_functions_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/built_in_functions_tests/datetime_function_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/built_in_functions_tests/math_functions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/column_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/constraints/check.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/constraints/composite_key.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/constraints/default.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/constraints/foreign_key.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <type_traits> // std::is_same

Expand Down
8 changes: 4 additions & 4 deletions tests/constraints/unique.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

TEST_CASE("Unique") {
using Catch::Matchers::Contains;
using Catch::Matchers::ContainsSubstring;

struct Contact {
int id = 0;
Expand Down Expand Up @@ -57,11 +57,11 @@ TEST_CASE("Unique") {
storage.insert(Contact{0, "John", "Doe", "[email protected]"});

REQUIRE_THROWS_WITH(storage.insert(Contact{0, "Johnny", "Doe", "[email protected]"}),
Contains("constraint failed"));
ContainsSubstring("constraint failed"));

storage.insert(Shape{0, "red", "green"});
storage.insert(Shape{0, "red", "blue"});
REQUIRE_THROWS_WITH(storage.insert(Shape{0, "red", "green"}), Contains("constraint failed"));
REQUIRE_THROWS_WITH(storage.insert(Shape{0, "red", "green"}), ContainsSubstring("constraint failed"));

std::vector<List> lists(2);
REQUIRE_NOTHROW(storage.insert_range(lists.begin(), lists.end()));
Expand Down
2 changes: 1 addition & 1 deletion tests/explicit_columns.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/filename.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/get_all_custom_containers.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <list>
#include <deque>
Expand Down
6 changes: 3 additions & 3 deletions tests/index_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down Expand Up @@ -48,7 +48,7 @@ TEST_CASE("index") {

#ifdef SQLITE_ORM_OPTIONAL_SUPPORTED
TEST_CASE("filtered index") {
using Catch::Matchers::Contains;
using Catch::Matchers::ContainsSubstring;

struct Test {
std::optional<int> field1 = 0;
Expand All @@ -62,7 +62,7 @@ TEST_CASE("filtered index") {
REQUIRE_NOTHROW(storage.sync_schema());

storage.insert(Test{1, std::nullopt});
REQUIRE_THROWS_WITH(storage.insert(Test{1, std::nullopt}), Contains("constraint failed"));
REQUIRE_THROWS_WITH(storage.insert(Test{1, std::nullopt}), ContainsSubstring("constraint failed"));
}
SECTION("2") {
auto storage = make_storage(
Expand Down
2 changes: 1 addition & 1 deletion tests/json.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/arithmetic_operators.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/between.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/binary_operators.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/bitwise.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/cast.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/glob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Obtained from here https://www.tutlane.com/tutorial/sqlite/sqlite-glob-operator
*/
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>
#include <vector> // std::vector
#include <algorithm> // std::find_if, std::count

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/in.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/is_null.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/like.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/operators/not_operator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/pointer_passing_interface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;
using std::unique_ptr;
Expand Down
2 changes: 1 addition & 1 deletion tests/pragma_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <sqlite_orm/sqlite_orm.h>
#include <cstdio> // ::remove
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
2 changes: 1 addition & 1 deletion tests/prepared_statement_tests/column_names.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

using namespace sqlite_orm;

Expand Down
8 changes: 4 additions & 4 deletions tests/prepared_statement_tests/get.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include "prepared_common.h"

using namespace sqlite_orm;

TEST_CASE("Prepared get") {
using namespace PreparedStatementTests;
using Catch::Matchers::Contains;
using Catch::Matchers::ContainsSubstring;
using Catch::Matchers::UnorderedEquals;

const int defaultVisitTime = 50;
Expand Down Expand Up @@ -72,7 +72,7 @@ TEST_CASE("Prepared get") {
}
{
get<0>(statement) = 4;
REQUIRE_THROWS_WITH(storage.execute(statement), Contains("Not found"));
REQUIRE_THROWS_WITH(storage.execute(statement), ContainsSubstring("Not found"));
}
}
}
Expand All @@ -94,7 +94,7 @@ TEST_CASE("Prepared get") {
//..
}
SECTION("execute") {
REQUIRE_THROWS_WITH(storage.execute(statement), Contains("Not found"));
REQUIRE_THROWS_WITH(storage.execute(statement), ContainsSubstring("Not found"));
}
}
{
Expand Down
Loading