-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🆕 🎨 [core] Support for
tagging
tests
Problem: - Only skip tag is supported but the concept is more generic than that. - Pipe operator is using for skipping tests which is also used for parameterized tests. Solution: - Add support for multiple, different tagging with `tag(name)`. - Replace `|` with `>>` for tagging. - Make skip just a `tag("skip")`.
- Loading branch information
1 parent
9590225
commit c6c6975
Showing
7 changed files
with
182 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright (c) 2019-2020 Kris Jusiak (kris at jusiak dot net) | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
#include <boost/ut.hpp> | ||
|
||
int main() { | ||
using namespace boost::ut; | ||
|
||
cfg<override> = {.filter = "tag", .tag = {"execute"}}; | ||
|
||
// clang-format off | ||
tag("execute") >> skip >> | ||
"tag"_test = [] { | ||
expect(42_i == 43) << "should not fire!"; | ||
expect(false) << "should fail!"; | ||
}; | ||
|
||
tag("execute") >> "tag"_test= [] { | ||
expect(42_i == 42); | ||
}; | ||
|
||
tag("not executed") >> "tag"_test= [] { | ||
expect(43_i == 42); | ||
}; | ||
|
||
tag("not executed") >> tag("execute") >> | ||
"tag"_test= [] { | ||
expect(42_i == 42); | ||
}; | ||
// clang-format on | ||
} |
Oops, something went wrong.