Sqlitecpp testing practices

From SRombauts/SQLiteCpp · View interactive version

Sqlitecpp testing practices is an AI agent skill from the GitHub repository SRombauts/SQLiteCpp. GoogleTest patterns and testing practices for SQLiteCpp test coverage and structure.

How to use this skill

Skill file

SQLiteCpp Testing Practices

Scope

Test File Structure

#include <gtest/gtest.h>
#include <SQLiteCpp/Database.h>

TEST(DatabaseTest, CanOpenReadWriteDatabase)
{
    // Arrange: setup test database
    SQLite::Database db(":memory:", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);

    // Act: perform operation
    db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY)");

    // Assert: verify behavior
    EXPECT_EQ(1, db.exec("INSERT INTO test DEFAULT VALUES"));
}

Adding a New Test File

Common Patterns

Running Tests

# CMake (from build dir)
ctest --output-on-failure
bin/SQLiteCpp_tests --gtest_filter=Database.*

# Meson
meson test -C builddir
meson test -C builddir --test-args="--gtest_filter=Database.*"

Canonical References

Cross-References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.