From f614173d688fd6e57871e1bab5a159e06a2ac07a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Jul 2018 15:38:54 +0200 Subject: Fix test breakages due to nesting checks and amalgamation --- bdep/new.cli | 30 +++++++++++++++++++++--------- bdep/new.cxx | 7 +++++-- tests/common.test | 2 +- tests/new.test | 4 ++++ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/bdep/new.cli b/bdep/new.cli index 63c5c51..b188af9 100644 --- a/bdep/new.cli +++ b/bdep/new.cli @@ -195,16 +195,17 @@ namespace bdep new project." } - dir_path --config-add|-A + dir_path --output-dir|-o { "", - "Add an existing build configuration ." + "Create the project in the specified directory." } - dir_path --config-create|-C + dir_path --directory|-d { "", - "Create a new build configuration in ." + "Assume the project is in the specified directory rather than in the + current working directory. Only used with \cb{--package}." } cmd_new_type --type|-t @@ -232,17 +233,28 @@ namespace bdep system-specific." } - dir_path --output-dir|-o + bool --no-amalgamation + { + "Create a project with disabled amalgamation support. This option is + normally only used for testing." + } + + bool --no-checks + { + "Suppress nested project/package checks. This option is normally only + used for testing." + } + + dir_path --config-add|-A { "", - "Create the project in the specified directory." + "Add an existing build configuration ." } - dir_path --directory|-d + dir_path --config-create|-C { "", - "Assume project is in the specified directory rather than in the current - working directory." + "Create a new build configuration in ." } }; diff --git a/bdep/new.cxx b/bdep/new.cxx index 7cdddc8..76bb63b 100644 --- a/bdep/new.cxx +++ b/bdep/new.cxx @@ -170,6 +170,7 @@ namespace bdep // Do some sanity check (nested packages, etc; you would be surprised what // people come up with). // + if (!o.no_checks ()) { project_package pp ( find_project_package (out, true /* ignore_not_found */)); @@ -366,8 +367,10 @@ namespace bdep // build/bootstrap.build // os.open (f = bd / "bootstrap.build"); - os << "project = " << n << endl - << endl + os << "project = " << n << endl; + if (o.no_amalgamation ()) + os << "amalgamation = # Disabled." << endl; + os << endl << "using version" << endl << "using config" << endl; if (tests) diff --git a/tests/common.test b/tests/common.test index 0b1153c..d85e038 100644 --- a/tests/common.test +++ b/tests/common.test @@ -27,7 +27,7 @@ clean = $* clean deinit = $* deinit init = $* init fetch = $* fetch -new = $* new +new = $* new --no-checks status = $* status sync = $* sync update = $* update diff --git a/tests/new.test b/tests/new.test index b5b3670..703540a 100644 --- a/tests/new.test +++ b/tests/new.test @@ -4,6 +4,10 @@ .include common.test +# Disable nesting checks and amalgamation support in the created projects. +# +test.arguments += --no-checks --no-amalgamation + cxx = "config.cxx=$config.cxx" status += -d prj -- cgit v1.1