Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
suite.hpp
Go to the documentation of this file.
1/*
2 SUITE.hpp - helper class for running collections of tests
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
31#ifndef TESTHELPER_SUITE_H
32#define TESTHELPER_SUITE_H
33
34#include <vector>
35#include <string>
36#include <optional>
37
38
39
40namespace test {
41
42 using std::string;
43 using opt_uint64 = std::optional<uint64_t>;
44
45 // Forward declarations for run.hpp
46 class Test;
47 class Launcher;
48
49 using Arg = std::vector<string>&;
50
51
59 class Suite
60 {
61 string groupID_;
63
64 public:
65 Suite (string groupID, opt_uint64 seed);
66 bool run (Arg cmdline);
67 void describe ();
68 int getExitCode () const;
69 static void enrol (Launcher *test, string testID, string groups);
70
71 static const string ALLGROUP;
72 static const int TEST_OK;
73 static const int EXCEPTION_THROWN;
74 };
75
76
77} // namespace test
78#endif
interface: generic testcase creating functor.
Definition run.hpp:69
Enables running a collection of tests.
Definition suite.hpp:60
int exitCode_
Definition suite.hpp:62
static const int TEST_OK
Definition suite.hpp:72
void describe()
print to stdout an enumeration of all testcases in this suite, in a format suitable for use with Ceht...
Definition suite.cpp:299
static const int EXCEPTION_THROWN
exit code returned when any individual test threw
Definition suite.hpp:73
int getExitCode() const
Definition suite.cpp:176
string groupID_
Definition suite.hpp:61
static void enrol(Launcher *test, string testID, string groups)
register the given test-launcher, so it can be later accessed either as a member of one of the specif...
Definition suite.cpp:131
static const string ALLGROUP
"magic" groupID containing all registered testcases
Definition suite.hpp:71
bool run(Arg cmdline)
run all testcases contained in this Suite.
Definition suite.cpp:251
Abstract Base Class for all testcases.
Definition run.hpp:54
Test runner and basic definitions for tests.
std::vector< string > & Arg
Definition run.hpp:45
std::optional< uint64_t > opt_uint64
Definition suite.hpp:43