Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
71 changes: 71 additions & 0 deletions onqtam/doctest/2.3.3/doctest_llar.gox
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import (
"os"
"path/filepath"
)

const consumerSource = `#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>

TEST_CASE("testing the factorial function") {
CHECK(1 == 1);
}
`

id "onqtam/doctest"

fromVer "2.3.3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Do not claim compatibility from 2.3.3

This floor makes the formula select this implementation for 2.3.3 through the later tags, but the exact 2.3.3 consumer cannot compile on current Linux/glibc: doctest declares altStackMem[4 * SIGSTKSZ], and SIGSTKSZ is not an integral constant expression there. llar test --verbose ./onqtam/doctest@2.3.3 --os linux --arch amd64 reproduces the failure at the consumer compile, whereas 2.4.6 and v2.4.11 pass. Raise fromVer to the first compatible tag (2.4.6 in this environment), or add a separate compatible implementation/patch so selecting the advertised lower versions does not produce an unusable package.


onBuild ctx => {
installDir := ctx.outputDir

// Use the upstream install rules so the CMake consumer receives the
// complete Config, Version, Targets, and helper-script set.
c := cmake.new(ctx.SourceDir, filepath.join(ctx.SourceDir, "_build"), installDir)
c.define "CMAKE_POLICY_VERSION_MINIMUM", "3.5"
c.define "CMAKE_INSTALL_LIBDIR", "lib"
c.defineBool "DOCTEST_WITH_TESTS", false
c.defineBool "DOCTEST_WITH_MAIN_IN_STATIC_LIB", false
c.configure
c.build
c.install

licenseDir := filepath.join(installDir, "licenses")
os.mkdirAll(licenseDir, 0o755)!
os.writeFile(
filepath.join(licenseDir, "LICENSE.txt"),
os.readFile(filepath.join(ctx.SourceDir, "LICENSE.txt"))!,
0o644,
)!

pcDir := filepath.join(installDir, "lib", "pkgconfig")
os.mkdirAll(pcDir, 0o755)!
pc := pkgconfig.new(
name = "doctest",
description = "C++11/14/17/20 single header testing framework",
version = "2.3.3",
cflags = ["-I$${includedir}"],
)!
out := os.create(filepath.join(pcDir, "doctest.pc"))!
pc.writeTo(out)!
out.close()!

pkgconfig.use installDir
ctx.setMetadata pkgconfig.lookup("doctest")!
}

onTest ctx => {
installDir := ctx.outputDir
testDir := filepath.join(ctx.SourceDir, "_llar_consumer")
os.mkdirAll(testDir, 0o755)!

consumer := filepath.join(testDir, "consumer.cpp")
os.writeFile(consumer, []byte(consumerSource), 0o644)!

pkgconfig.use installDir
flagsFile := filepath.join(testDir, "doctest.flags")
os.writeFile(flagsFile, []byte(pkgconfig.lookup("doctest")!), 0o644)!

binary := filepath.join(testDir, "consumer")
exec! "c++", "-std=c++11", consumer, "-o", binary, "@"+flagsFile
exec! binary
}
4 changes: 4 additions & 0 deletions onqtam/doctest/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"path": "onqtam/doctest",
"deps": {}
}
Loading