#include "color.hpp"
#include "debug.hpp"
#include "discard.hpp"
#include "exit_code.hpp"
#include "main.hpp"
#include "source_location.hpp"
#include "string_view.hpp"
#include <stdlib.h>
Go to the source code of this file.
|
class | bsl::ut_scenario |
| Defines a unit test scenario. A scenario defines a user story, describing the "scenario" being tested. A scenario should be paired with ut_given, ut_when and ut_then to define the scenario in english. More...
|
|
class | bsl::ut_given |
| Defines the initial state of a unit test scenario including the creation of any objects that might participate in the unit test. More...
|
|
class | bsl::ut_when |
| Defines the "action" of a unit test scenario. More...
|
|
class | bsl::ut_then |
| Defines the expected "result" of a unit test scenario. More...
|
|
|
void | bsl::details::ut_print_here (sloc_type const &sloc) noexcept |
| Prints the current source location to the console. More...
|
|
constexpr bsl::exit_code | bsl::ut_success () noexcept |
| Outputs a message and returns bsl::exit_success. More...
|
|
void | bsl::ut_check_failed () noexcept |
| This is a non-constexpr function that can be used to detect when a unit test check fails. If this function is called at compile-time, it will not compile, resulting in a human readable error message.
|
|
constexpr bool | bsl::ut_check (bool const test, sloc_type const &sloc=here()) noexcept |
| Checks to see if "test" is true. If test is false, this function will exit fast with a failure code. More...
|
|
- Copyright
- Copyright (C) 2020 Assured Information Security, Inc.
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
◆ ut_print_here()
void bsl::details::ut_print_here |
( |
sloc_type const & |
sloc | ) |
|
|
inlinenoexcept |
Prints the current source location to the console.
- Parameters
-
sloc | the current source location to print |
◆ ut_success()
Outputs a message and returns bsl::exit_success.
- Returns
- returns bsl::exit_success
◆ ut_check()
constexpr bool bsl::ut_check |
( |
bool const |
test, |
|
|
sloc_type const & |
sloc = here() |
|
) |
| |
|
noexcept |
Checks to see if "test" is true. If test is false, this function will exit fast with a failure code.
- Parameters
-
test | if test is true, this function returns true. If test is false, this function will exit fast with a failure code. |
sloc | used to identify the location in the unit test that a check failed. |
- Returns
- returns test