From 857d9566ffd4dfc572831fa3cc04e0394c0d7e92 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 22 Oct 2019 22:51:14 +0300 Subject: Add support for tests, examples, and benchmarks package manifest values Also rename dependency_constraint class to version_constraint. --- tests/manifest/driver.cxx | 10 ++--- tests/manifest/testscript | 106 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 107 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index 6ef6193..85097be 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -61,7 +61,7 @@ main (int argc, char* argv[]) { if (mode == "-p") { - bool complete_depends (false); + bool complete_dependencies (false); bool ignore_unknown (false); for (int i (2); i != argc; ++i) @@ -69,7 +69,7 @@ main (int argc, char* argv[]) string o (argv[i]); if (o == "-c") - complete_depends = true; + complete_dependencies = true; else if (o == "-i") ignore_unknown = true; else @@ -96,7 +96,7 @@ main (int argc, char* argv[]) } }, ignore_unknown, - complete_depends).serialize (s); + complete_dependencies).serialize (s); } else if (mode == "-ec") { @@ -109,8 +109,8 @@ main (int argc, char* argv[]) string s; while (!eof (getline (cin, s))) { - dependency_constraint c (s); - dependency_constraint ec (c.effective (v)); + version_constraint c (s); + version_constraint ec (c.effective (v)); assert (c.complete () == (c == ec)); diff --git a/tests/manifest/testscript b/tests/manifest/testscript index 2af195d..ee47889 100644 --- a/tests/manifest/testscript +++ b/tests/manifest/testscript @@ -499,7 +499,7 @@ EOI } - : dependency + : depends : { : short-name @@ -515,7 +515,7 @@ : invalid-version-range : - $* -c <'stdin:6:10: error: invalid dependency constraint: min version is greater than max version' != 0 + $* -c <'stdin:6:10: error: invalid prerequisite package constraint: min version is greater than max version' != 0 : 1 name: foo version: 2.0.0 @@ -586,7 +586,7 @@ license: LGPLv2 depends: bar ~$ EOI - stdin:6:10: error: invalid dependency constraint: dependent version is not standard + stdin:6:10: error: invalid prerequisite package constraint: dependent version is not standard EOE : latest-snapshot @@ -607,7 +607,6 @@ depends: bar == 2.0.0-a.0.123 | libbaz [2.0.0-a.0.1 2.0.0-a.1) | libbox\ [2.0.0-a.0.1 2.0.0-a.1) | libfox [1.0 2.0.0-a.0.123) EOO - } : incomplete @@ -621,6 +620,102 @@ depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $) EOF } + + : tests + : + { + : short-name + : + $* <'stdin:6:8: error: invalid tests package name: length is less than two characters' != 0 + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tests: b + EOI + + : invalid-version-range-incomplete + : + $* -c <'stdin:6:8: error: invalid tests package constraint: min version is greater than max version' != 0 + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tests: bar [$ 1.0.0] + EOI + + : invalid-version-range + : + $* -c <'stdin:6:8: error: invalid tests package constraint: min version is greater than max version' != 0 + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tests: bar [2.0.0 1.0.0] + EOI + + : invalid-version + : + $* -c <'stdin:6:8: error: invalid tests package constraint: invalid version: equal version endpoints are earliest' != 0 + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tests: bar == 2.0.0- + EOI + + : complete + : + { + test.options += -c + + : final + : + $* <>EOO + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tests: bar == $ + EOI + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tests: bar == 2.0.0 + EOO + + : non-standard-shortcut + : + $* <>EOE != 0 + : 1 + name: foo + version: 2.0.0-x + summary: Modern C++ parser + license: LGPLv2 + tests: bar ~$ + EOI + stdin:6:8: error: invalid tests package constraint: dependent version is not standard + EOE + } + + : incomplete + : + $* <>EOF + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tests: bar == $ + EOF + } } : package-list @@ -670,6 +765,9 @@ requires: ? ; libc++ standard library if using Clang on Mac OS X. requires: zlib; Most Linux/UNIX systems already have one; or get it at\ www.zlib.net. + tests: libfoo-tests + examples: libfoo-examples == 1.2.3 + benchmarks: libfoo-benchmarks ~1.2.0 builds: +!windows &( +gcc +clang ) +( +windows &msvc ) build-include: linux* build-include: freebsd* -- cgit v1.1