This repository was archived by the owner on Sep 20, 2026. It is now read-only.
Repository navigation
formula: onqtam/doctest #444
Open
MeteorsLiu
wants to merge
4
commits into
xgo-dev:main
Choose a base branch
from
MeteorsLiu:issue/318-doctest-luna
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9098730
formula: add onqtam/doctest
MeteorsLiu 003ff2d
fix(doctest): remove incomplete CMake export files
MeteorsLiu d818314
fix(doctest): preserve complete upstream CMake package
MeteorsLiu 04b803b
fix(doctest): keep CMake package under lib
MeteorsLiu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
|
|
||
| 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 | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "path": "onqtam/doctest", | ||
| "deps": {} | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.3through the later tags, but the exact2.3.3consumer cannot compile on current Linux/glibc: doctest declaresaltStackMem[4 * SIGSTKSZ], andSIGSTKSZis not an integral constant expression there.llar test --verbose ./onqtam/doctest@2.3.3 --os linux --arch amd64reproduces the failure at the consumer compile, whereas2.4.6andv2.4.11pass. RaisefromVerto 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.