48 _returnCode = result->
failed() > 0 ? 1 : 0;
54 function_pointer(
this, &Entrypoint::on_suite_complete);
57 int main(
int argc,
char** argv) {
58 cxxopts::Options options(
"Specs.cpp",
"Specs.cpp command line options");
59 options.allow_unrecognised_options();
82 (
"h,help",
"Print usage");
84 auto result = options.parse(argc, argv);
85 if (result.count(
"help")) {
86 std::cout << options.help() << std::endl;
129 if (result.unmatched().size() > 0) {
130 std::cout <<
"Unrecognized options:" << std::endl;
131 for (
auto& option : result.unmatched()) std::cout <<
" " << option << std::endl;
140 &_stdExceptionExceptionHandler
161 _reporters.
add(
"debug", &_reporter);
162 _runner.
run(_specs.
root_group(), &_reporters,
nullptr, &_onSuiteComplete);
164 if (_totalTests == 0) {
165 std::cout <<
"No tests found.\n" << std::endl;
166 std::cout << options.help() << std::endl;
int main(int argc, char **argv)
static GlobalSpecCodeBlocks & instance()
void set(ISpecEnvironment *environment)
static GlobalSpecGroup & instance()
ISpecGroup * root_group() const override
ILocalSpecExceptionHandlerCollection * local_exception_handlers() const override
void add(const char *name, ISpecReporter *reporter) override
void run(ISpecGroup *group, ISpecReporterCollection *reporters, ISpecRunOptions *options, ISpecSuiteRunResultCallbackFn *callback) override
GlobalSpecEnvironment & global_spec_environment()
virtual void register_exception_handler(ILocalSpecExceptionHandler *)=0
virtual void merge(ISpecGroup *)=0
virtual std::uint32_t not_run() const =0
virtual std::uint32_t failed() const =0
virtual std::uint32_t timed_out() const =0
virtual std::uint32_t passed() const =0