From f3d18b793926e8638166a1f6ddd8fc4e5edf086b Mon Sep 17 00:00:00 2001 From: Amadey Vorontsov Date: Sun, 10 May 2026 01:42:20 +0000 Subject: [PATCH] [M5] verify-curated-db.sh + boost recipe (header-only) --- CHANGELOG.md | 17 ++ data/linkdb.json | 5 +- scripts/curated-snippets/abseil-cpp.cpp | 8 + scripts/curated-snippets/boost.cpp | 8 + scripts/curated-snippets/cli11.cpp | 13 ++ scripts/curated-snippets/curl.cpp | 7 + scripts/curated-snippets/cxxopts.cpp | 8 + scripts/curated-snippets/eigen.cpp | 8 + scripts/curated-snippets/fmt.cpp | 7 + scripts/curated-snippets/freetype.cpp | 13 ++ scripts/curated-snippets/glfw.cpp | 9 ++ scripts/curated-snippets/glm.cpp | 8 + scripts/curated-snippets/grpc.cpp | 7 + scripts/curated-snippets/libjpeg.cpp | 10 ++ scripts/curated-snippets/libpng.cpp | 7 + scripts/curated-snippets/magic_enum.cpp | 10 ++ scripts/curated-snippets/nlohmann_json.cpp | 9 ++ scripts/curated-snippets/openssl.cpp | 9 ++ scripts/curated-snippets/protobuf.cpp | 8 + scripts/curated-snippets/range-v3.cpp | 12 ++ scripts/curated-snippets/sdl2.cpp | 8 + scripts/curated-snippets/spdlog.cpp | 8 + scripts/curated-snippets/sqlite3.cpp | 7 + scripts/curated-snippets/tbb.cpp | 9 ++ scripts/curated-snippets/zlib.cpp | 7 + scripts/verify-curated-db.sh | 179 +++++++++++++++++++++ tests/cmd_add.cpp | 8 +- tests/cmd_build.cpp | 8 +- tests/linkdb_lookup.cpp | 12 +- 29 files changed, 412 insertions(+), 17 deletions(-) create mode 100644 scripts/curated-snippets/abseil-cpp.cpp create mode 100644 scripts/curated-snippets/boost.cpp create mode 100644 scripts/curated-snippets/cli11.cpp create mode 100644 scripts/curated-snippets/curl.cpp create mode 100644 scripts/curated-snippets/cxxopts.cpp create mode 100644 scripts/curated-snippets/eigen.cpp create mode 100644 scripts/curated-snippets/fmt.cpp create mode 100644 scripts/curated-snippets/freetype.cpp create mode 100644 scripts/curated-snippets/glfw.cpp create mode 100644 scripts/curated-snippets/glm.cpp create mode 100644 scripts/curated-snippets/grpc.cpp create mode 100644 scripts/curated-snippets/libjpeg.cpp create mode 100644 scripts/curated-snippets/libpng.cpp create mode 100644 scripts/curated-snippets/magic_enum.cpp create mode 100644 scripts/curated-snippets/nlohmann_json.cpp create mode 100644 scripts/curated-snippets/openssl.cpp create mode 100644 scripts/curated-snippets/protobuf.cpp create mode 100644 scripts/curated-snippets/range-v3.cpp create mode 100644 scripts/curated-snippets/sdl2.cpp create mode 100644 scripts/curated-snippets/spdlog.cpp create mode 100644 scripts/curated-snippets/sqlite3.cpp create mode 100644 scripts/curated-snippets/tbb.cpp create mode 100644 scripts/curated-snippets/zlib.cpp create mode 100755 scripts/verify-curated-db.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c5a2b6..76b1d60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,23 @@ All notable changes to cargoxx will be documented in this file. branch when the lockfile carries no rev. - `util::satisfies` treats `version == "*"` as a match against any range, mirroring the existing `range == "*"` shortcut. +- `scripts/verify-curated-db.sh` plus per-package using-snippets at + `scripts/curated-snippets/.cpp`. For each curated package the + script scaffolds a fresh project, `cargoxx add`s the dep, drops in a + snippet that exercises the library's API, and runs `cargoxx build`, + asserting the binary is produced. 21/25 packages pass against + `nixos-unstable`; the remaining 4 are documented as skipped: + `catch2`/`gtest` (their default linkdb targets ship their own + `main()` which collides with the snippet), `grpc` (needs `protobuf` + declared as a transitive dep — cross-package transitives are out of + v0.1 scope), `abseil-cpp` (nixpkgs builds it against libstdc++ while + our flake uses libc++ → ABI mismatch on the linker step). +- `data/linkdb.json`: `boost` recipe is now header-only — + `find_package(Boost REQUIRED)` + `Boost::headers`. Boost 1.89's + `BoostConfig.cmake` searches for separately-installed + `boost_Config.cmake` files that nixpkgs doesn't ship, so + the previous `COMPONENTS` form failed at configure time. + Linkdb-component tests now use `abseil-cpp` for component coverage. - `cargoxx remove ` drops a declared dep from `Cargoxx.toml`, errors when the dep is not declared. Other deps are preserved. - End-to-end verified on a freshly-scaffolded project. `tests/cmd_add.cpp` diff --git a/data/linkdb.json b/data/linkdb.json index e54d9d8..2aef7a5 100644 --- a/data/linkdb.json +++ b/data/linkdb.json @@ -35,9 +35,8 @@ { "version": ">=1.70.0", "nixpkgs_attr": "boost", - "find_package": "Boost REQUIRED COMPONENTS {{components}}", - "targets": ["Boost::{{component}}"], - "components": "supported" + "find_package": "Boost REQUIRED", + "targets": ["Boost::headers"] } ], "openssl": [ diff --git a/scripts/curated-snippets/abseil-cpp.cpp b/scripts/curated-snippets/abseil-cpp.cpp new file mode 100644 index 0000000..b977755 --- /dev/null +++ b/scripts/curated-snippets/abseil-cpp.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + auto s = absl::StrCat("abseil-", "cpp"); + std::println("abseil-cpp ok: {}", s); + return 0; +} diff --git a/scripts/curated-snippets/boost.cpp b/scripts/curated-snippets/boost.cpp new file mode 100644 index 0000000..3b66475 --- /dev/null +++ b/scripts/curated-snippets/boost.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + boost::filesystem::path p{"/tmp"}; + std::println("boost ok: {}", p.string()); + return 0; +} diff --git a/scripts/curated-snippets/cli11.cpp b/scripts/curated-snippets/cli11.cpp new file mode 100644 index 0000000..6dbb8c4 --- /dev/null +++ b/scripts/curated-snippets/cli11.cpp @@ -0,0 +1,13 @@ +#include +import std; + +int main(int argc, char** argv) { + CLI::App app{"verify"}; + try { + app.parse(argc, argv); + } catch (const CLI::ParseError& e) { + return app.exit(e); + } + std::println("cli11 ok"); + return 0; +} diff --git a/scripts/curated-snippets/curl.cpp b/scripts/curated-snippets/curl.cpp new file mode 100644 index 0000000..e9bd9f9 --- /dev/null +++ b/scripts/curated-snippets/curl.cpp @@ -0,0 +1,7 @@ +#include +import std; + +int main() { + std::println("curl ok: {}", curl_version()); + return 0; +} diff --git a/scripts/curated-snippets/cxxopts.cpp b/scripts/curated-snippets/cxxopts.cpp new file mode 100644 index 0000000..24741d6 --- /dev/null +++ b/scripts/curated-snippets/cxxopts.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + cxxopts::Options opts("verify", "verify cxxopts"); + std::println("cxxopts ok: {}", opts.program()); + return 0; +} diff --git a/scripts/curated-snippets/eigen.cpp b/scripts/curated-snippets/eigen.cpp new file mode 100644 index 0000000..0264a48 --- /dev/null +++ b/scripts/curated-snippets/eigen.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + Eigen::Vector2d v(1.0, 2.0); + std::println("eigen ok: ({},{})", v[0], v[1]); + return 0; +} diff --git a/scripts/curated-snippets/fmt.cpp b/scripts/curated-snippets/fmt.cpp new file mode 100644 index 0000000..0d73ac4 --- /dev/null +++ b/scripts/curated-snippets/fmt.cpp @@ -0,0 +1,7 @@ +#include +import std; + +int main() { + fmt::print("fmt ok\n"); + return 0; +} diff --git a/scripts/curated-snippets/freetype.cpp b/scripts/curated-snippets/freetype.cpp new file mode 100644 index 0000000..18f4350 --- /dev/null +++ b/scripts/curated-snippets/freetype.cpp @@ -0,0 +1,13 @@ +#include +#include FT_FREETYPE_H +import std; + +int main() { + FT_Library lib = nullptr; + auto err = FT_Init_FreeType(&lib); + if (err == 0 && lib) { + FT_Done_FreeType(lib); + } + std::println("freetype ok: init err {}", err); + return 0; +} diff --git a/scripts/curated-snippets/glfw.cpp b/scripts/curated-snippets/glfw.cpp new file mode 100644 index 0000000..a68bbc7 --- /dev/null +++ b/scripts/curated-snippets/glfw.cpp @@ -0,0 +1,9 @@ +#include +import std; + +int main() { + int major = 0, minor = 0, rev = 0; + glfwGetVersion(&major, &minor, &rev); + std::println("glfw ok: {}.{}.{}", major, minor, rev); + return 0; +} diff --git a/scripts/curated-snippets/glm.cpp b/scripts/curated-snippets/glm.cpp new file mode 100644 index 0000000..b2e034b --- /dev/null +++ b/scripts/curated-snippets/glm.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + glm::vec3 v(1.0f, 2.0f, 3.0f); + std::println("glm ok: ({},{},{})", v.x, v.y, v.z); + return 0; +} diff --git a/scripts/curated-snippets/grpc.cpp b/scripts/curated-snippets/grpc.cpp new file mode 100644 index 0000000..dc3a8bb --- /dev/null +++ b/scripts/curated-snippets/grpc.cpp @@ -0,0 +1,7 @@ +#include +import std; + +int main() { + std::println("grpc ok: {}", grpc::Version()); + return 0; +} diff --git a/scripts/curated-snippets/libjpeg.cpp b/scripts/curated-snippets/libjpeg.cpp new file mode 100644 index 0000000..9a4a29f --- /dev/null +++ b/scripts/curated-snippets/libjpeg.cpp @@ -0,0 +1,10 @@ +// libjpeg's jpeglib.h relies on stdio types being already declared. +#include +#include +#include +import std; + +int main() { + std::println("libjpeg ok: lib version {}", JPEG_LIB_VERSION); + return 0; +} diff --git a/scripts/curated-snippets/libpng.cpp b/scripts/curated-snippets/libpng.cpp new file mode 100644 index 0000000..9c94950 --- /dev/null +++ b/scripts/curated-snippets/libpng.cpp @@ -0,0 +1,7 @@ +#include +import std; + +int main() { + std::println("libpng ok: {}", png_access_version_number()); + return 0; +} diff --git a/scripts/curated-snippets/magic_enum.cpp b/scripts/curated-snippets/magic_enum.cpp new file mode 100644 index 0000000..ec35a70 --- /dev/null +++ b/scripts/curated-snippets/magic_enum.cpp @@ -0,0 +1,10 @@ +#include +import std; + +enum class Color { Red, Green, Blue }; + +int main() { + auto n = magic_enum::enum_count(); + std::println("magic_enum ok: {} entries", n); + return 0; +} diff --git a/scripts/curated-snippets/nlohmann_json.cpp b/scripts/curated-snippets/nlohmann_json.cpp new file mode 100644 index 0000000..85a1598 --- /dev/null +++ b/scripts/curated-snippets/nlohmann_json.cpp @@ -0,0 +1,9 @@ +#include +import std; + +int main() { + nlohmann::json j; + j["k"] = 42; + std::println("{}", j.dump()); + return 0; +} diff --git a/scripts/curated-snippets/openssl.cpp b/scripts/curated-snippets/openssl.cpp new file mode 100644 index 0000000..29b711c --- /dev/null +++ b/scripts/curated-snippets/openssl.cpp @@ -0,0 +1,9 @@ +#include +import std; + +int main() { + EVP_MD_CTX* ctx = EVP_MD_CTX_new(); + EVP_MD_CTX_free(ctx); + std::println("openssl ok"); + return 0; +} diff --git a/scripts/curated-snippets/protobuf.cpp b/scripts/curated-snippets/protobuf.cpp new file mode 100644 index 0000000..e14e1df --- /dev/null +++ b/scripts/curated-snippets/protobuf.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + google::protobuf::Arena arena; + std::println("protobuf ok: arena size {}", arena.SpaceUsed()); + return 0; +} diff --git a/scripts/curated-snippets/range-v3.cpp b/scripts/curated-snippets/range-v3.cpp new file mode 100644 index 0000000..4014b85 --- /dev/null +++ b/scripts/curated-snippets/range-v3.cpp @@ -0,0 +1,12 @@ +#include +import std; + +int main() { + auto v = ranges::views::iota(0, 5); + int sum = 0; + for (int i : v) { + sum += i; + } + std::println("range-v3 ok: {}", sum); + return 0; +} diff --git a/scripts/curated-snippets/sdl2.cpp b/scripts/curated-snippets/sdl2.cpp new file mode 100644 index 0000000..d888a5a --- /dev/null +++ b/scripts/curated-snippets/sdl2.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + auto* err = SDL_GetError(); + std::println("sdl2 ok: SDL_GetError() = '{}'", err ? err : ""); + return 0; +} diff --git a/scripts/curated-snippets/spdlog.cpp b/scripts/curated-snippets/spdlog.cpp new file mode 100644 index 0000000..8037bc2 --- /dev/null +++ b/scripts/curated-snippets/spdlog.cpp @@ -0,0 +1,8 @@ +#include +import std; + +int main() { + spdlog::set_level(spdlog::level::info); + spdlog::info("spdlog ok"); + return 0; +} diff --git a/scripts/curated-snippets/sqlite3.cpp b/scripts/curated-snippets/sqlite3.cpp new file mode 100644 index 0000000..bd36b68 --- /dev/null +++ b/scripts/curated-snippets/sqlite3.cpp @@ -0,0 +1,7 @@ +#include +import std; + +int main() { + std::println("sqlite3 ok: {}", sqlite3_libversion()); + return 0; +} diff --git a/scripts/curated-snippets/tbb.cpp b/scripts/curated-snippets/tbb.cpp new file mode 100644 index 0000000..c9df27a --- /dev/null +++ b/scripts/curated-snippets/tbb.cpp @@ -0,0 +1,9 @@ +#include +import std; + +int main() { + int sum = 0; + oneapi::tbb::parallel_for(0, 10, [&](int i) { sum += i; }); + std::println("tbb ok: {}", sum); + return 0; +} diff --git a/scripts/curated-snippets/zlib.cpp b/scripts/curated-snippets/zlib.cpp new file mode 100644 index 0000000..eac37bb --- /dev/null +++ b/scripts/curated-snippets/zlib.cpp @@ -0,0 +1,7 @@ +#include +import std; + +int main() { + std::println("zlib ok: {}", zlibVersion()); + return 0; +} diff --git a/scripts/verify-curated-db.sh b/scripts/verify-curated-db.sh new file mode 100755 index 0000000..412f102 --- /dev/null +++ b/scripts/verify-curated-db.sh @@ -0,0 +1,179 @@ +#!/usr/bin/env bash +# +# Build a tiny project for every curated-linkdb package, compile against the +# library, and verify the binary links. Catches nixpkgs attribute drift, +# find_package case mismatches, and missing components configurations. +# +# Usage: +# scripts/verify-curated-db.sh [pkg1 pkg2 ...] +# +# Env: +# CARGOXX absolute path to the cargoxx binary (default: ./build/cargoxx) +# VERIFY_DIR working directory (default: a fresh mktemp under /tmp) +# KEEP non-empty → leave VERIFY_DIR in place after the run +# +# Catch2 and gtest are intentionally skipped: their default linkdb targets +# (Catch2WithMain, GTest::gtest_main) supply their own main() and would +# collide with the using-snippet's int main(). + +set -uo pipefail + +REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" +CARGOXX="${CARGOXX:-${REPO_ROOT}/build/cargoxx}" +SNIPPETS_DIR="${REPO_ROOT}/scripts/curated-snippets" + +if [[ ! -x "${CARGOXX}" ]]; then + echo "ERROR: cargoxx binary not found at ${CARGOXX}" >&2 + echo " build it first: cmake --build build" >&2 + exit 2 +fi + +if [[ -z "${VERIFY_DIR:-}" ]]; then + VERIFY_DIR="$(mktemp -d -t cargoxx-verify-XXXXXX)" +fi +mkdir -p "${VERIFY_DIR}" + +if [[ -z "${KEEP:-}" ]]; then + trap 'rm -rf "${VERIFY_DIR}"' EXIT +fi + +echo "cargoxx: ${CARGOXX}" +echo "verify dir: ${VERIFY_DIR}" +echo + +# Format: "name|version|components" (components is comma-separated, may be empty) +ALL_PACKAGES=( + "fmt|10.2.0|" + "spdlog|1.13.0|" + "nlohmann_json|3.11.0|" + "boost|1.84.0|" + "openssl|3.2.0|" + "zlib|1.3.0|" + "sqlite3|3.45.0|" + "curl|8.5.0|" + "protobuf|25.0.0|" + "eigen|3.4.0|" + "tbb|2021.10.0|" + "libpng|1.6.40|" + "libjpeg|3.0.1|" + "freetype|2.13.2|" + "glfw|3.3.9|" + "glm|0.9.9.8|" + "sdl2|2.28.5|" + "cli11|2.4.1|" + "cxxopts|3.2.0|" + "range-v3|0.12.0|" + "magic_enum|0.9.5|" +) +SKIPPED_PACKAGES=( + "catch2 (links Catch2WithMain — conflicts with the snippet's main())" + "gtest (links GTest::gtest_main — conflicts with the snippet's main())" + "grpc (find_dependency(Protobuf) transitive — needs cross-package deps)" + "abseil-cpp (nixpkgs builds it against libstdc++; our flake uses libc++)" +) + +# Allow running on a subset: ./scripts/verify-curated-db.sh fmt boost +FILTER=("$@") + +is_filtered() { + local name="$1" + if [[ ${#FILTER[@]} -eq 0 ]]; then + return 0 + fi + local f + for f in "${FILTER[@]}"; do + if [[ "${f}" == "${name}" ]]; then + return 0 + fi + done + return 1 +} + +ok=() +failed=() + +run_one() { + local name="$1" version="$2" components="$3" + local snippet="${SNIPPETS_DIR}/${name}.cpp" + + if [[ ! -f "${snippet}" ]]; then + echo " ✗ no snippet at ${snippet}" >&2 + failed+=("${name}: missing snippet") + return 1 + fi + + local proj="${VERIFY_DIR}/${name}" + rm -rf "${proj}" + + pushd "${VERIFY_DIR}" >/dev/null || return 1 + if ! "${CARGOXX}" new "${name}" >"${VERIFY_DIR}/${name}.new.log" 2>&1; then + echo " ✗ cargoxx new failed (log: ${VERIFY_DIR}/${name}.new.log)" >&2 + failed+=("${name}: cargoxx new") + popd >/dev/null + return 1 + fi + popd >/dev/null + + pushd "${proj}" >/dev/null || return 1 + + local add_args=("${name}@${version}") + if [[ -n "${components}" ]]; then + add_args+=("--components" "${components}") + fi + if ! "${CARGOXX}" add "${add_args[@]}" >"${VERIFY_DIR}/${name}.add.log" 2>&1; then + echo " ✗ cargoxx add failed (log: ${VERIFY_DIR}/${name}.add.log)" >&2 + failed+=("${name}: cargoxx add") + popd >/dev/null + return 1 + fi + + cp "${snippet}" src/main.cpp + + if ! "${CARGOXX}" build >"${VERIFY_DIR}/${name}.build.log" 2>&1; then + echo " ✗ cargoxx build failed (log: ${VERIFY_DIR}/${name}.build.log)" >&2 + failed+=("${name}: cargoxx build") + popd >/dev/null + return 1 + fi + + if [[ ! -x "build/debug/${name}" ]]; then + echo " ✗ binary not produced at build/debug/${name}" >&2 + failed+=("${name}: missing binary") + popd >/dev/null + return 1 + fi + + popd >/dev/null + ok+=("${name}") + echo " ✓ ${name}" + return 0 +} + +for entry in "${ALL_PACKAGES[@]}"; do + IFS='|' read -r name version components <<<"${entry}" + if ! is_filtered "${name}"; then + continue + fi + echo "=== ${name} ${version} ===" + run_one "${name}" "${version}" "${components}" +done + +echo +echo "=============================" +echo "RESULTS" +echo "=============================" +echo "OK: ${#ok[@]}" +for n in "${ok[@]}"; do echo " ✓ ${n}"; done +echo +if [[ ${#failed[@]} -gt 0 ]]; then + echo "FAILED: ${#failed[@]}" + for f in "${failed[@]}"; do echo " ✗ ${f}"; done +fi +echo +echo "SKIPPED: ${#SKIPPED_PACKAGES[@]} (test-framework targets supply own main)" +for s in "${SKIPPED_PACKAGES[@]}"; do echo " · ${s}"; done + +if [[ ${#failed[@]} -gt 0 ]]; then + exit 1 +fi +exit 0 diff --git a/tests/cmd_add.cpp b/tests/cmd_add.cpp index dd80a27..e3e45f6 100644 --- a/tests/cmd_add.cpp +++ b/tests/cmd_add.cpp @@ -49,16 +49,16 @@ TEST_CASE("cmd_add stores components when provided", "[cli][add]") { auto parent = fresh_dir(); auto root = scaffold(parent); - auto r = cmd_add(root, "boost", "1.84.0", {"filesystem", "system"}, + auto r = cmd_add(root, "abseil-cpp", "20240116.0", {"strings", "base"}, overlay_path(parent)); REQUIRE(r.has_value()); auto m = manifest::parse(root / "Cargoxx.toml"); REQUIRE(m.has_value()); REQUIRE(m->dependencies.size() == 1); - REQUIRE(m->dependencies[0].name == "boost"); + REQUIRE(m->dependencies[0].name == "abseil-cpp"); REQUIRE(m->dependencies[0].components == - std::vector{"filesystem", "system"}); + std::vector{"strings", "base"}); } TEST_CASE("cmd_add accepts an empty version and stores '*'", "[cli][add]") { @@ -110,7 +110,7 @@ TEST_CASE("cmd_add rejects componentized package without components", auto parent = fresh_dir(); auto root = scaffold(parent); - auto r = cmd_add(root, "boost", "1.84.0", {}, overlay_path(parent)); + auto r = cmd_add(root, "abseil-cpp", "20240116.0", {}, overlay_path(parent)); REQUIRE_FALSE(r.has_value()); REQUIRE(r.error().code == ErrorCode::LinkdbComponentNotSupported); } diff --git a/tests/cmd_build.cpp b/tests/cmd_build.cpp index 47054a0..b962a64 100644 --- a/tests/cmd_build.cpp +++ b/tests/cmd_build.cpp @@ -104,16 +104,16 @@ TEST_CASE("cmd_build resolves a componentized dep", "[cli][build]") { auto parent = fresh_dir(); REQUIRE(cmd_new("app", false, parent).has_value()); auto root = parent / "app"; - add_dep(root, "boost", "1.84.0", {"filesystem", "system"}); + add_dep(root, "abseil-cpp", "20240116.0", {"strings", "base"}); auto r = cmd_build(root, true, false, std::nullopt, overlay_path(parent)); REQUIRE(r.has_value()); auto cmake_text = read_file(root / "build" / "CMakeLists.txt"); - REQUIRE(cmake_text.find("find_package(Boost REQUIRED COMPONENTS filesystem system)") != + REQUIRE(cmake_text.find("find_package(absl CONFIG REQUIRED)") != std::string::npos); - REQUIRE(cmake_text.find("Boost::filesystem") != std::string::npos); - REQUIRE(cmake_text.find("Boost::system") != std::string::npos); + REQUIRE(cmake_text.find("absl::strings") != std::string::npos); + REQUIRE(cmake_text.find("absl::base") != std::string::npos); } TEST_CASE("cmd_build synthesizes a lockfile entry per dep", "[cli][build]") { diff --git a/tests/linkdb_lookup.cpp b/tests/linkdb_lookup.cpp index 1c2e0f1..eabe0f9 100644 --- a/tests/linkdb_lookup.cpp +++ b/tests/linkdb_lookup.cpp @@ -56,19 +56,19 @@ TEST_CASE("resolve fails for an unknown package", "[linkdb]") { REQUIRE(rec.error().code == ErrorCode::LinkdbUnknownPackage); } -TEST_CASE("resolve substitutes boost components", "[linkdb]") { +TEST_CASE("resolve substitutes abseil-cpp components", "[linkdb]") { auto db = open_db(); - auto rec = db.resolve("boost", "1.84.0", {"filesystem", "system"}); + auto rec = db.resolve("abseil-cpp", "20240116.0", {"strings", "base"}); REQUIRE(rec.has_value()); - REQUIRE(rec->find_package == "Boost REQUIRED COMPONENTS filesystem system"); + REQUIRE(rec->find_package == "absl CONFIG REQUIRED"); REQUIRE(rec->targets == - std::vector{"Boost::filesystem", "Boost::system"}); + std::vector{"absl::strings", "absl::base"}); } TEST_CASE("resolve fails when a componentized package gets no components", "[linkdb]") { auto db = open_db(); - auto rec = db.resolve("boost", "1.84.0"); + auto rec = db.resolve("abseil-cpp", "20240116.0"); REQUIRE_FALSE(rec.has_value()); REQUIRE(rec.error().code == ErrorCode::LinkdbComponentNotSupported); } @@ -102,7 +102,7 @@ TEST_CASE("resolve covers all 25 curated packages", "[linkdb]") { {"fmt", "10.2.0", {}}, {"spdlog", "1.13.0", {}}, {"nlohmann_json", "3.11.0", {}}, - {"boost", "1.84.0", {"system"}}, + {"boost", "1.84.0", {}}, {"openssl", "3.2.0", {}}, {"zlib", "1.3.0", {}}, {"sqlite3", "3.45.0", {}},