-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fmt v11 and c++20 modules support #10
Changes from 36 commits
5bc0f0f
a836c69
1f14622
f808761
0757158
a9ee48b
b2e4c3b
c271d77
110906e
ab0cc5e
79827a3
b5ecdbf
6007797
6042313
4841d77
014a3d8
8055762
1130bb6
c553ca8
495ab27
c328c6c
b3b1dcc
82e02d5
dc8fb4b
105613f
f3a93ca
780ba03
682c69b
2922bb4
3d7398a
c5c5ab5
05855de
8841258
7c56c1c
6b5d114
8f3e148
bffc9c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.bdep/ | ||
.vs/ | ||
|
||
# Local default options files. | ||
# | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Compiler/linker output. | ||
# | ||
*.d | ||
*.t | ||
*.i | ||
*.i.* | ||
*.ii | ||
*.ii.* | ||
*.o | ||
*.obj | ||
*.gcm | ||
*.pcm | ||
*.ifc | ||
*.so | ||
*.dylib | ||
*.dll | ||
*.a | ||
*.lib | ||
*.exp | ||
*.pdb | ||
*.ilk | ||
*.exe | ||
*.exe.dlls/ | ||
*.exe.manifest | ||
*.pc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
basics | ||
|
||
# Testscript output directory (can be symlink). | ||
# | ||
test-basics |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
include ../test-main/ | ||
|
||
#test_names = | ||
# args-test \ | ||
# assert-test \ | ||
# base-test | ||
gtest_test_names = args-test assert-test base-test chrono-test color-test compile-fp-test compile-test format-test gtest-extra-test noexception-test os-test ostream-test printf-test std-test unicode-test xchar-test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this list have been formed from globing the |
||
|
||
# header-only-test <- header only mode seemingly not supported by this build2 package? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it was not supported, I basically had the same reasons as explained in the packaging guide although that wouldnt prevent support of header-only mode later if the demand is there. So far nobody needed it. |
||
# scan-test <- some linker issues | ||
# posix-mock-test <- needs posix-mock.h, and has some msvc/runtime conditional logic going on | ||
|
||
standalone_test_names = enforce-checks-test # some way to pair these? -DFMT_ENFORCE_COMPILE_STRING | ||
|
||
for test_name : $gtest_test_names | ||
{ | ||
./: exe{$test_name} : test/cxx{$test_name} | ||
exe{$test_name}: ../test-main/liba{test-main}: | ||
{ | ||
bin.whole = true | ||
} | ||
} | ||
|
||
./: exe{ranges-test} : test/cxx{ranges-test ranges-odr-test} | ||
exe{ranges-test}: ../test-main/liba{test-main}: | ||
{ | ||
bin.whole = true | ||
} | ||
|
||
# linker issues. | ||
#./: exe{scan-test} : test/cxx{scan-test} ../test-main/liba{test-main} | ||
|
||
# @todo: cmake adds this test conditionally on NOT ( msvc AND fmt-shared ) | ||
# in build2, i guess it's a bit different in that we can potentially build both shared and static variants within a single config? | ||
# also not clear how fmt_shared/fmt_header_only is being configured, looks like the package doesn't do anything there. using defaults only? | ||
# if $cxx. != msvc | ||
#./: exe{format-impl-test} : test/cxx{format-impl-test header-only-test} ../test-main/liba{test-main} | ||
|
||
|
||
import fmt = fmt%lib{fmt} | ||
|
||
for test_name : $standalone_test_names | ||
{ | ||
./: exe{$test_name} : test/cxx{$test_name} $fmt | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../upstream/test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/config.build | ||
/root/ | ||
/bootstrap/ | ||
build/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
project = fmt-tests | ||
|
||
using version | ||
using config | ||
using test | ||
using dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Uncomment to suppress warnings coming from external libraries. | ||
# | ||
#cxx.internal.scope = current | ||
|
||
cxx.std = latest | ||
|
||
using cxx | ||
|
||
hxx{*}: extension = h | ||
mxx{*}: extension = cc | ||
cxx{*}: extension = cc | ||
|
||
# All executables are tests | ||
# | ||
exe{*}: test = true | ||
|
||
# The test target for cross-testing (running tests under Wine, etc). | ||
# | ||
test.target = $cxx.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./: {*/ -build/} manifest |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
: 1 | ||
name: fmt-tests | ||
version: 11.0.1-a.0.z | ||
project: fmt | ||
summary: Tests package for fmt upstream tests | ||
license: MIT | ||
url: https://github.com/fmtlib/fmt/ | ||
|
||
depends: * build2 >= 0.17.0 | ||
depends: * bpkg >= 0.17.0 | ||
|
||
depends: gtest ^1.11.0 | ||
depends: gmock ^1.11.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
libs = | ||
import libs += fmt%lib{fmt} | ||
import libs += gtest%lib{gtest} gmock%lib{gmock} | ||
|
||
liba{test-main}: test/cxx{test-main gtest-extra util} test/hxx{gtest-extra mock-allocator test-assert util} $libs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would defining it as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I'm yet to understand the intended usage of I also found this: |
||
|
||
# Export options. | ||
# | ||
liba{test-main}: | ||
{ | ||
cxx.export.poptions += "-I$src_base/test" | ||
cxx.export.libs = $libs | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../upstream/test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,18 @@ url: https://github.com/fmtlib/fmt/ | |
package-url: https://github.com/build2-packaging/fmt/ | ||
package-email: [email protected] | ||
|
||
tests: fmt-tests == $ | ||
|
||
depends: * build2 >= 0.17.0 | ||
depends: * bpkg >= 0.17.0 | ||
|
||
builds: default | ||
builds: -freebsd ; fmt tests failing, fixed on upstream master, pending removal next package release after 11.0.2 | ||
build-exclude: linux_debian_12-clang_17 ; clang-17 bug with libstdc++ std::tuple (https://github.com/llvm/llvm-project/issues/61415) | ||
build-exclude: **/x86_64-w64-mingw32 ; unknown error building installed tests 'error: unable to stat path D:\a\msys64\mingw64\lib\x86_64-w64-mingw32\14.1.0\pkgconfig\: the device is not ready' | ||
|
||
# Modules support still not sufficient to enable on CI | ||
#modules-builds: latest : &( +clang-18+ +msvc ) ; Modules builds only supported for latest Clang and MSVC | ||
#modules-build-config: config.cxx.features.modules=true ; Enable c++20 modules | ||
#modules-only-builds: latest : &( +clang-18+ +msvc ) ; Modules builds only supported for latest Clang and MSVC | ||
#modules-only-build-config: config.cxx.features.modules=true config.fmt.modules_only=true ; Enable c++20 modules and disable header usage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import! [metadata, rule_hint=cxx.link] libs = fmt%lib{fmt} | ||
|
||
./ : exe{driver} : {cxx}{driver} hxx{tests.inl} $libs testscript{**} | ||
./ : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that line still necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently not ;) |
||
|
||
if $($libs: fmt.is_module) | ||
{ | ||
./ : exe{driver-modules} : {cxx}{driver-modules} hxx{tests.inl} $libs testscript{**} | ||
} | ||
./ : exe{driver} : include = $($libs: fmt.has_header) | ||
./ : exe{driver-modules} : include = $($libs: fmt.has_module) | ||
|
||
exe{driver} : {cxx}{driver} hxx{tests.inl} $libs testscript{**} | ||
|
||
# For purposes of verifying that fmt headers are not made available for include when in modules-only mode | ||
cxx.poptions =+ "-DFMT_BUILD2_HAS_HEADER=($($libs: fmt.has_header) ? 1 : 0)" | ||
|
||
exe{driver-modules} : {cxx}{driver-modules} hxx{tests.inl} $libs testscript{**} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
|
||
// Verify that fmt headers are not available if config.fmt.modules_only is true | ||
#if __has_include(<fmt/version.h>) != FMT_BUILD2_HAS_HEADER | ||
#error fmt headers should be available for include iff config.fmt.modules_only == false | ||
#endif | ||
|
||
#include <cassert> | ||
import std; | ||
#include <string> | ||
#include <chrono> | ||
#include <vector> | ||
|
||
import fmt; | ||
|
||
#include "tests.inl" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <cassert> | ||
#include <string> | ||
#include <chrono> | ||
#include <vector> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
: 1 | ||
location: fmt/ | ||
: | ||
location: fmt-tests/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
: 1 | ||
summary: fmt project repository | ||
|
||
#: | ||
#role: prerequisite | ||
#location: https://pkg.cppget.org/1/stable | ||
#trust: ... | ||
|
||
#: | ||
#role: prerequisite | ||
#location: https://git.build2.org/hello/libhello.git | ||
: | ||
role: prerequisite | ||
location: https://pkg.cppget.org/1/stable |
+1 −0 | .github/workflows/lint.yml | |
+30 −0 | ChangeLog.md | |
+9 −9 | README.md | |
+2 −2 | doc/api.md | |
+47 −31 | include/fmt/base.h | |
+32 −8 | include/fmt/format-inl.h | |
+22 −14 | include/fmt/format.h | |
+1 −1 | include/fmt/ranges.h | |
+43 −0 | support/check-commits | |
+4 −1 | test/CMakeLists.txt | |
+19 −1 | test/base-test.cc | |
+43 −0 | test/format-test.cc | |
+25 −0 | test/perf-sanity.cc | |
+22 −10 | test/ranges-test.cc | |
+5 −2 | test/scan.h |
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.
Are these comments still useful?