Skip to content

Commit b46a8c7

Browse files
committed
Add few tests
1 parent fc74cda commit b46a8c7

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

test/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
target_sources(rsltest_test PRIVATE
2-
always_passes.cpp
3-
)
2+
always_passes.cpp
3+
discover.cpp
4+
)

test/discover.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include <rsl/test>
2+
#include <tuple>
3+
4+
namespace test_discovery
5+
{
6+
int called = 0;
7+
[[= rsl::test]]
8+
void test_called()
9+
{
10+
++called;
11+
ASSERT(true);
12+
}
13+
14+
void test_not_called()
15+
{
16+
--called;
17+
ASSERT(false);
18+
}
19+
20+
[[= rsl::test]]
21+
[[= rsl::rename("renamed_test")]]
22+
void ensure_called()
23+
{
24+
ASSERT(called == 1);
25+
}
26+
27+
28+
[[= rsl::test]]
29+
[[=rsl::params({{'a', 10}, {'c', 12}})]]
30+
void test_with_params(char foo, int bar){
31+
ASSERT(bar > 5);
32+
ASSERT(foo != 'x');
33+
};
34+
35+
} // namespace test_discovery

0 commit comments

Comments
 (0)