mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-07 03:06:05 -04:00
Test linking with builtin libsqlite3-dev package on Ubuntu (#485)
This commit is contained in:
commit
69771bf222
32
.github/workflows/cmake_builtin_lib.yml
vendored
Normal file
32
.github/workflows/cmake_builtin_lib.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: CMake SQLite3 builtin library
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: ${{ matrix.config.name }}
|
||||||
|
runs-on: ${{ matrix.config.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
- {
|
||||||
|
name: "Ubuntu Latest GCC",
|
||||||
|
os: ubuntu-latest,
|
||||||
|
generator: "Unix Makefiles",
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
name: "macOS Latest Clang",
|
||||||
|
os: macos-latest,
|
||||||
|
generator: "Unix Makefiles",
|
||||||
|
}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout ${{ github.ref_name }}
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- run: git submodule update --init --recursive
|
||||||
|
- run: mkdir build
|
||||||
|
- run: cmake -G "Unix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DSQLITECPP_INTERNAL_SQLITE=OFF -DSQLITE_OMIT_LOAD_EXTENSION=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_RUN_CPPCHECK=OFF -DSQLITECPP_RUN_CPPLINT=OFF ..
|
||||||
|
working-directory: build
|
||||||
|
- run: cmake --build build --config Debug
|
||||||
|
- run: ctest --verbose --output-on-failure --test-dir build
|
@ -190,6 +190,7 @@ if (SQLITECPP_INCLUDE_SCRIPT)
|
|||||||
.gitbugtraq
|
.gitbugtraq
|
||||||
.github/dependabot.yml
|
.github/dependabot.yml
|
||||||
.github/workflows/cmake.yml
|
.github/workflows/cmake.yml
|
||||||
|
.github/workflows/cmake_builtin_lib.yml
|
||||||
.github/workflows/cmake_subdir_example.yml
|
.github/workflows/cmake_subdir_example.yml
|
||||||
.github/workflows/meson.yml
|
.github/workflows/meson.yml
|
||||||
.gitignore
|
.gitignore
|
||||||
|
@ -87,7 +87,7 @@ int main()
|
|||||||
{
|
{
|
||||||
// Using SQLITE_VERSION would require #include <sqlite3.h> which we want to avoid: use SQLite::VERSION if possible.
|
// Using SQLITE_VERSION would require #include <sqlite3.h> which we want to avoid: use SQLite::VERSION if possible.
|
||||||
// std::cout << "SQlite3 version " << SQLITE_VERSION << std::endl;
|
// std::cout << "SQlite3 version " << SQLITE_VERSION << std::endl;
|
||||||
std::cout << "SQlite3 version " << SQLite::VERSION << " (" << SQLite::getLibVersion() << ")" << std::endl;
|
std::cout << "SQlite3 compile time header version " << SQLite::VERSION << " (vs dynamic lib version " << SQLite::getLibVersion() << ")" << std::endl;
|
||||||
std::cout << "SQliteC++ version " << SQLITECPP_VERSION << std::endl;
|
std::cout << "SQliteC++ version " << SQLITECPP_VERSION << std::endl;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -34,7 +34,8 @@ void assertion_failed(const char* apFile, const long apLine, const char* apFunc,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SQLITECPP_INTERNAL_SQLITE
|
// NOTE on macOS FindSQLite3 find an unrelated sqlite3.h from Mono.framework that doesn't match the actual package version!
|
||||||
|
#if defined(SQLITECPP_INTERNAL_SQLITE) || !defined(__APPLE__)
|
||||||
TEST(SQLiteCpp, version)
|
TEST(SQLiteCpp, version)
|
||||||
{
|
{
|
||||||
EXPECT_STREQ(SQLITE_VERSION, SQLite::VERSION);
|
EXPECT_STREQ(SQLITE_VERSION, SQLite::VERSION);
|
||||||
@ -559,7 +560,10 @@ TEST(Database, getHeaderInfo)
|
|||||||
EXPECT_EQ(h.databaseTextEncoding, 1);
|
EXPECT_EQ(h.databaseTextEncoding, 1);
|
||||||
EXPECT_EQ(h.incrementalVaccumMode, 0);
|
EXPECT_EQ(h.incrementalVaccumMode, 0);
|
||||||
EXPECT_EQ(h.versionValidFor, 3);
|
EXPECT_EQ(h.versionValidFor, 3);
|
||||||
|
// NOTE on macOS FindSQLite3 find an unrelated sqlite3.h from Mono.framework that doesn't match the actual package version!
|
||||||
|
#if defined(SQLITECPP_INTERNAL_SQLITE) || !defined(__APPLE__)
|
||||||
EXPECT_EQ(h.sqliteVersion, SQLITE_VERSION_NUMBER);
|
EXPECT_EQ(h.sqliteVersion, SQLITE_VERSION_NUMBER);
|
||||||
|
#endif && !defined(__APPLE__)
|
||||||
}
|
}
|
||||||
remove("test.db3");
|
remove("test.db3");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user