Skip to content

Commit 77efe11

Browse files
committed
Show main in synopsis
1 parent e53cc5f commit 77efe11

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

provides/include/testing_v1/private.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
#include "polyfill_v1/type_traits.hpp"
44
#include <utility>
55

6+
int main();
7+
68
namespace testing_v1 {
79

810
template <class Action> struct test_t;
911

10-
void run_all();
11-
1212
class Private {
13-
friend void run_all();
13+
friend int ::main();
1414
template <class> friend struct test_t;
1515

1616
class Static;

provides/include/testing_v1/synopsis.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
#include "testing_v1/private.hpp"
44

5-
namespace testing_v1 {
6-
75
// test.hpp ====================================================================
86

7+
/// A minimalist test framework.
8+
namespace testing_v1 {
9+
910
/// Holds a registered test action and should only be used at namespace scope.
1011
template <class Action> struct test_t : Private::test_t<Action> {
1112
/// Constructs a test from the given action.
@@ -27,3 +28,6 @@ test_t<std::remove_cvref_t<Action>> test(Action &&action);
2728
void verify(bool result);
2829

2930
} // namespace testing_v1
31+
32+
/// Runs all tests.
33+
int main();

provides/library/test.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void testing_v1::verify(bool ok) {
1414
}
1515

1616
class testing_v1::Private::Static {
17-
friend void run_all();
17+
friend int ::main();
1818
friend class test_base_t;
1919

2020
using tests_t = std::vector<test_base_t *>;
@@ -30,8 +30,6 @@ class testing_v1::Private::Static {
3030
}
3131
};
3232

33-
void testing_v1::run_all() { Private::Static::run_all(); }
34-
3533
testing_v1::Private::test_base_t::test_base_t() {
3634
Static::tests().push_back(this);
3735
}
@@ -46,6 +44,6 @@ testing_v1::Private::test_base_t::~test_base_t() {
4644
}
4745

4846
int main() {
49-
testing_v1::run_all();
47+
testing_v1::Private::Static::run_all();
5048
return 0;
5149
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy