Browse Source

Test-Driver -> test_driver

default_compile_flags
vector-of-bool 4 years ago
parent
commit
4d66d88bc3
8 changed files with 14 additions and 14 deletions
  1. +1
    -1
      docs/err/test-failure.rst
  2. +4
    -4
      docs/err/unknown-test-driver.rst
  3. +1
    -1
      docs/guide/packages.rst
  4. +2
    -2
      docs/tut/hello-test.rst
  5. +1
    -1
      src/dds/error/errors.cpp
  6. +2
    -2
      src/dds/library/manifest.hpp
  7. +2
    -2
      src/dds/package/manifest.cpp
  8. +1
    -1
      src/dds/package/manifest.hpp

+ 1
- 1
docs/err/test-failure.rst View File



This error message is printed when a project's tests encounter a failure This error message is printed when a project's tests encounter a failure
condition. The exact behavior of tests is determined by a project's condition. The exact behavior of tests is determined by a project's
``Test-Driver``.
``test_driver``.


If you see this error, it is most likely that you have an issue in the tests of If you see this error, it is most likely that you have an issue in the tests of
your project. your project.

+ 4
- 4
docs/err/unknown-test-driver.rst View File

Error: Unknown ``Test-Driver``
Error: Unknown ``test_driver``
############################## ##############################


``dds`` has a set of known ``Test-Driver``s built-in, and they may be specified
with the ``Test-Driver`` key. Receiving this error indicates that the specified
``Test-Driver`` was not recognized by ``dds``. Check your spelling, and check
``dds`` has a set of known ``test_driver``s built-in, and they may be specified
with the ``test_driver`` key. Receiving this error indicates that the specified
``test_driver`` was not recognized by ``dds``. Check your spelling, and check
that the driver you want to use is supported by ``dds``. Refer to the that the driver you want to use is supported by ``dds``. Refer to the
:doc:`/guide/packages` page. :doc:`/guide/packages` page.

+ 1
- 1
docs/guide/packages.rst View File

A *test* source file is a source file whose file stem ends with ``.test``. Like A *test* source file is a source file whose file stem ends with ``.test``. Like
application sources, a *test* source file is omitted from the main library, and application sources, a *test* source file is omitted from the main library, and
it will be used to generate tests. The exact behavior of tests is determined by it will be used to generate tests. The exact behavior of tests is determined by
the ``Test-Driver`` setting for the package, but the default is that each test
the ``test_driver`` setting for the package, but the default is that each test
source file will generate a single test executable that is executed by ``dds`` source file will generate a single test executable that is executed by ``dds``
when running unit tests. when running unit tests.



+ 2
- 2
docs/tut/hello-test.rst View File

diagnostics? diagnostics?




A ``Test-Driver``: Using *Catch2*
A ``test_driver``: Using *Catch2*
********************************* *********************************


``dds`` ships with built-in support for the `Catch2`_ C and C++ testing ``dds`` ships with built-in support for the `Catch2`_ C and C++ testing
} }


If you now run ``dds build``, we will get a linker error for a multiply-defined If you now run ``dds build``, we will get a linker error for a multiply-defined
``main`` function. When setting the ``Test-Driver`` to ``Catch-Main``, ``dds``
``main`` function. When setting the ``test_driver`` to ``Catch-Main``, ``dds``
will compile an entrypoint separately from any particular test, and the tests will compile an entrypoint separately from any particular test, and the tests
will link against that entrypoint. This means we cannot provide our own will link against that entrypoint. This means we cannot provide our own
``main`` function, and should instead use Catch's ``TEST_CASE`` macro to ``main`` function, and should instead use Catch's ``TEST_CASE`` macro to

+ 1
- 1
src/dds/error/errors.cpp View File

return "The source ditsribution already exists at the destination <- (Seeing this " return "The source ditsribution already exists at the destination <- (Seeing this "
"text is a `dds` bug. Please report it.)"; "text is a `dds` bug. Please report it.)";
case errc::unknown_test_driver: case errc::unknown_test_driver:
return "The specified Test-Driver is not known to `dds`";
return "The specified test_driver is not known to `dds`";
case errc::dependency_resolve_failure: case errc::dependency_resolve_failure:
return "`dds` was unable to find a solution for the package dependencies given."; return "`dds` was unable to find a solution for the package dependencies given.";
case errc::dup_lib_name: case errc::dup_lib_name:

+ 2
- 2
src/dds/library/manifest.hpp View File

namespace dds { namespace dds {


/** /**
* Represents the contents of a `library.dds`. This is somewhat a stripped-down
* Represents the contents of a `library.json5`. This is somewhat a stripped-down
* version of lm::library, to only represent exactly the parts that we want to * version of lm::library, to only represent exactly the parts that we want to
* offer via `library.dds`.
* offer via `library.json5`.
*/ */
struct library_manifest { struct library_manifest {
/// The name of the library /// The name of the library

+ 2
- 2
src/dds/package/manifest.cpp View File

} else { } else {
auto dym = *did_you_mean(test_driver_str, {"Catch-Main", "Catch"}); auto dym = *did_you_mean(test_driver_str, {"Catch-Main", "Catch"});
throw_user_error< throw_user_error<
errc::unknown_test_driver>("Unknown 'Test-Driver' '{}' (Did you mean '{}'?)",
errc::unknown_test_driver>("Unknown 'test_driver' '{}' (Did you mean '{}'?)",
test_driver_str, test_driver_str,
dym); dym);
} }
} else { } else {
auto dym = *did_you_mean(test_driver, {"Catch-Main", "Catch"}); auto dym = *did_you_mean(test_driver, {"Catch-Main", "Catch"});
throw_user_error<errc::unknown_test_driver>( throw_user_error<errc::unknown_test_driver>(
"Unknown 'Test-Driver' '{}' (Did you mean '{}'?)",
"Unknown 'test_driver' '{}' (Did you mean '{}'?)",
test_driver, test_driver,
dym); dym);
} }

+ 1
- 1
src/dds/package/manifest.hpp View File

package_id pkg_id; package_id pkg_id;
/// The declared `Namespace` of the package. This directly corresponds with the libman Namespace /// The declared `Namespace` of the package. This directly corresponds with the libman Namespace
std::string namespace_; std::string namespace_;
/// The `Test-Driver` that this package declares, or `nullopt` if absent.
/// The `test_driver` that this package declares, or `nullopt` if absent.
std::optional<test_lib> test_driver; std::optional<test_lib> test_driver;
/// The dependencies declared with the `Depends` fields, if any. /// The dependencies declared with the `Depends` fields, if any.
std::vector<dependency> dependencies; std::vector<dependency> dependencies;

Loading…
Cancel
Save