Lely core libraries
2.2.5
|
#include <lely/features.h>
Go to the source code of this file.
Macros | |
#define | TAP_ARGS_HAS_COMMA(...) |
Evaluates to 1 if the argument list contains a comma, and 0 if not. | |
#define | TAP_ARGS_DEFAULT(arg, ...) TAP_ARGS_DEFAULT_(TAP_ARGS_HAS_COMMA(__VA_ARGS__), arg, __VA_ARGS__) |
Appends arg if the variadic argument list contains a single argument. | |
#define | tap_plan(...) tap_plan_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Specifies the test plan. More... | |
#define | tap_test(...) tap_test_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Evaluates an expression. More... | |
#define | tap_pass(...) tap_test_impl(1, "", __FILE__, __LINE__, "" __VA_ARGS__) |
Indicates that a test has passed. More... | |
#define | tap_fail(...) tap_test_impl(0, "", __FILE__, __LINE__, "" __VA_ARGS__) |
Indicates that a test has failed. More... | |
#define | tap_todo(...) tap_todo_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Indicates that a test is expected to fail. More... | |
#define | tap_skip(...) tap_skip_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Skips a test. More... | |
#define | tap_diag(...) tap_diag_impl("# " __VA_ARGS__) |
Emits a diagnostic message. More... | |
#define | tap_abort(...) tap_abort_impl("" __VA_ARGS__) |
Aborts all tests. More... | |
#define | tap_assert(expr) |
Similar to assert() , but invokes tap_abort() if expr evaluates to zero. | |
This is the public header file of the Test Anything Protocol (TAP) library.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file tap.h.
#define tap_plan | ( | ... | ) | tap_plan_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Specifies the test plan.
The first argument MUST be the number of test to run. If no tests are run, a second argument MAY be provided. If it is, it is interpreted as a printf-style format string describing the reason for skipping the tests. Any further arguments are printed under the control of the format string.
#define tap_test | ( | ... | ) | tap_test_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Evaluates an expression.
If the result is non-zero, the test passed, otherwise it failed. The first argument MUST be the expression to be evaluated. The second argument is optional. If it is specified, it is interpreted as a printf-style format string describing the test. Any further arguments are printed under the control of the format string.
#define tap_pass | ( | ... | ) | tap_test_impl(1, "", __FILE__, __LINE__, "" __VA_ARGS__) |
Indicates that a test has passed.
No arguments are required, but if they are specified, the first argument is interpreted as a printf-style format string describing the test. Any further arguments are printed under the control of the format string.
#define tap_fail | ( | ... | ) | tap_test_impl(0, "", __FILE__, __LINE__, "" __VA_ARGS__) |
Indicates that a test has failed.
No arguments are required, but if they are specified, the first argument is interpreted as a printf-style format string describing the test. Any further arguments are printed under the control of the format string.
#define tap_todo | ( | ... | ) | tap_todo_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Indicates that a test is expected to fail.
If the expression evaluates to zero, the test is not considered to have failed. The arguments are the same as for tap_test().
#define tap_skip | ( | ... | ) | tap_skip_(TAP_ARGS_DEFAULT("", __VA_ARGS__)) |
Skips a test.
The provided expression is not evaluated. The arguments are the same as for tap_test().
#define tap_diag | ( | ... | ) | tap_diag_impl("# " __VA_ARGS__) |
#define tap_abort | ( | ... | ) | tap_abort_impl("" __VA_ARGS__) |
Aborts all tests.
The first argument, if provided, is interpreted as a printf-style format string describing the reason for aborting. Any further arguments are printed under the control of the format string. Note that this function aborts the running process and does not return.