From def0adc835b35f503eda48049e9e753786c21655 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 24 Aug 2021 13:29:52 +0300 Subject: Add support for build-time mark (*) in tests, examples, and benchmarks package manifest values --- libbrep/package.hxx | 11 +++++++++-- libbrep/package.xml | 6 ++++++ load/load.cxx | 5 ++++- mod/mod-package-version-details.cxx | 10 ++++++++-- tests/load/1/math/libfoo-1.2.4+1.tar.gz | Bin 1025 -> 1032 bytes tests/load/1/math/packages.manifest | 4 ++-- tests/load/driver.cxx | 2 +- www/package-version-details-body.css | 15 ++++++++++++--- 8 files changed, 42 insertions(+), 11 deletions(-) diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 1619185..85eaec0 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -20,7 +20,7 @@ // #define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 19 -#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 20, closed) +#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 21, closed) namespace brep { @@ -194,15 +194,22 @@ namespace brep struct test_dependency: dependency { test_dependency_type type; + bool buildtime; test_dependency () = default; test_dependency (package_name n, test_dependency_type t, + bool b, optional c) : dependency {std::move (n), std::move (c), nullptr /* package */}, - type (t) + type (t), + buildtime (b) { } + + // Database mapping. + // + #pragma db member(buildtime) default(false) // @@ TMP }; // certificate diff --git a/libbrep/package.xml b/libbrep/package.xml index 01597c2..093f54e 100644 --- a/libbrep/package.xml +++ b/libbrep/package.xml @@ -1,4 +1,10 @@ + + + + + + diff --git a/load/load.cxx b/load/load.cxx index 0d53a0d..4f4e5c4 100644 --- a/load/load.cxx +++ b/load/load.cxx @@ -528,7 +528,10 @@ load_packages (const shared_ptr& rp, ts.reserve (pm.tests.size ()); for (bpkg::test_dependency& td: pm.tests) - ts.emplace_back (move (td.name), td.type, move (td.constraint)); + ts.emplace_back (move (td.name), + td.type, + td.buildtime, + move (td.constraint)); } // Cache before the package name is moved. diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index a23989e..0faf7a2 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -327,10 +327,10 @@ handle (request& rq, response& rs) << TH; if (da.conditional) - s << "?"; + s << '?'; if (da.buildtime) - s << "*"; + s << '*'; s << ~TH << TD @@ -429,6 +429,12 @@ handle (request& rq, response& rs) } s << TR(CLASS=id) + << TH; + + if (td.buildtime) + s << '*'; + + s << ~TH << TD << SPAN(CLASS="value"); diff --git a/tests/load/1/math/libfoo-1.2.4+1.tar.gz b/tests/load/1/math/libfoo-1.2.4+1.tar.gz index 74678eb..bafc657 100644 Binary files a/tests/load/1/math/libfoo-1.2.4+1.tar.gz and b/tests/load/1/math/libfoo-1.2.4+1.tar.gz differ diff --git a/tests/load/1/math/packages.manifest b/tests/load/1/math/packages.manifest index ea37e2a..335b9d0 100644 --- a/tests/load/1/math/packages.manifest +++ b/tests/load/1/math/packages.manifest @@ -79,11 +79,11 @@ requires: linux | windows | macosx; Symbian support is coming. requires: c++11 requires: ? ; libc++ standard library if using Clang on Mac OS X. requires: ? vc++ >= 12.0; Only if using VC++ on Windows. -tests: libfoo-tests == 1.2.4 +tests: * libfoo-tests == 1.2.4 examples: libfoo-examples benchmarks: libfoo-benchmarks > 0.0.1 location: libfoo-1.2.4+1.tar.gz -sha256sum: c02b6033107387e05f48aa62ee6498152c967deb0e91a62f1e618fe9fd1bc644 +sha256sum: 042a9c1df1bf6fc61a47d864dceff3cb68640aa68490174c10f5baf813116fa5 : name: libfoo-benchmarks version: 1.2.4 diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx index 8192827..887818c 100644 --- a/tests/load/driver.cxx +++ b/tests/load/driver.cxx @@ -825,7 +825,7 @@ test_pkg_repos (const cstrings& loader_args, assert (check_location (fpv5)); assert (fpv5->sha256sum && *fpv5->sha256sum == - "c02b6033107387e05f48aa62ee6498152c967deb0e91a62f1e618fe9fd1bc644"); + "042a9c1df1bf6fc61a47d864dceff3cb68640aa68490174c10f5baf813116fa5"); assert (fpv5->buildable); diff --git a/www/package-version-details-body.css b/www/package-version-details-body.css index 8a4e0a1..524e5bd 100644 --- a/www/package-version-details-body.css +++ b/www/package-version-details-body.css @@ -244,10 +244,15 @@ h1, h2, h3 font-size: 0.94em; } +/* + * Tests, examples, and benchmarks tables. + */ #tests {margin-top: .4em; margin-bottom: 1em;} +#tests th {width: 2.8em; text-align: center;} +#tests th:after{content: "";} #tests tr:nth-child(even) td {background-color: rgba(0, 0, 0, 0.07);} -#tests td {margin-left: 2.8em; padding-left: .4em;} +#tests td {padding-left: .4em;} #tests tr.tests td .value { @@ -257,9 +262,11 @@ h1, h2, h3 } #examples {margin-top: .4em; margin-bottom: 1em;} +#examples th {width: 2.8em; text-align: center;} +#examples th:after{content: "";} #examples tr:nth-child(even) td {background-color: rgba(0, 0, 0, 0.07);} -#examples td {margin-left: 2.8em; padding-left: .4em;} +#examples td {padding-left: .4em;} #examples tr.examples td .value { @@ -269,9 +276,11 @@ h1, h2, h3 } #benchmarks {margin-top: .4em; margin-bottom: 1em;} +#benchmarks th {width: 2.8em; text-align: center;} +#benchmarks th:after{content: "";} #benchmarks tr:nth-child(even) td {background-color: rgba(0, 0, 0, 0.07);} -#benchmarks td {margin-left: 2.8em; padding-left: .4em;} +#benchmarks td {padding-left: .4em;} #benchmarks tr.benchmarks td .value { -- cgit v1.1