diff options
Diffstat (limited to 'libbrep/package.hxx')
-rw-r--r-- | libbrep/package.hxx | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 0ab8413..e249573 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -20,7 +20,7 @@ // #define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 17 -#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 18, closed) +#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 19, open) namespace brep { @@ -181,6 +181,30 @@ namespace brep #pragma db value(requirement_alternatives) definition + // tests + // + using bpkg::test_dependency_type; + using bpkg::to_test_dependency_type; + + #pragma db map type(test_dependency_type) as(string) \ + to(to_string (?)) \ + from(brep::to_test_dependency_type (?)) + + #pragma db value + struct test_dependency: dependency + { + test_dependency_type type; + + test_dependency () = default; + test_dependency (package_name n, + test_dependency_type t, + optional<version_constraint> c) + : dependency {std::move (n), std::move (c), nullptr /* package */}, + type (t) + { + } + }; + // certificate // #pragma db value @@ -386,9 +410,7 @@ namespace brep optional<email_type> build_error_email, dependencies_type, requirements_type, - small_vector<dependency, 1> tests, - small_vector<dependency, 1> examples, - small_vector<dependency, 1> benchmarks, + small_vector<test_dependency, 1> tests, build_class_exprs, build_constraints_type, optional<path> location, @@ -459,9 +481,7 @@ namespace brep optional<email_type> build_error_email; dependencies_type dependencies; requirements_type requirements; - small_vector<dependency, 1> tests; // Note: foreign-mapped in build. - small_vector<dependency, 1> examples; // Note: foreign-mapped in build. - small_vector<dependency, 1> benchmarks; // Note: foreign-mapped in build. + small_vector<test_dependency, 1> tests; // Note: foreign-mapped in build. build_class_exprs builds; // Note: foreign-mapped in build. build_constraints_type build_constraints; // Note: foreign-mapped in build. @@ -563,14 +583,9 @@ namespace brep set(odb::nested_set (this.requirements, std::move (?))) \ id_column("") key_column("") value_column("id") - // tests, examples, benchmarks - // - // Seeing that these reuse the dependency types, we are also going to - // have identical database mapping. + // tests // - #pragma db member(tests) id_column("") value_column("dep_") - #pragma db member(examples) id_column("") value_column("dep_") - #pragma db member(benchmarks) id_column("") value_column("dep_") + #pragma db member(tests) id_column("") value_column("test_") // builds // |