Belle II Software light-2406-ragdoll
test_main.cc File Reference

Main function to unit test executables. More...

#include "gtest/gtest.h"
#include "framework/core/RandomNumbers.h"
#include <framework/logging/LogSystem.h>
#include <framework/logging/LogConfig.h>
#include <framework/dbobjects/MagneticField.h>
#include <framework/dbobjects/MagneticFieldComponentConstant.h>
#include <mdst/dbobjects/CollisionInvariantMass.h>
#include <mdst/dbobjects/CollisionBoostVector.h>
#include <mdst/dbobjects/CollisionAxisCMS.h>
#include <mdst/dbobjects/BeamSpot.h>
#include <framework/database/DBStore.h>
Include dependency graph for test_main.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 Run all tests.
 

Detailed Description

Main function to unit test executables.

This file contains basically a copy of the gtest_main.cc provided by the gtest framework but extends it with a custom event listener to set the random state before each test to a well defined state.

Definition in file test_main.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Run all tests.

Definition at line 91 of file test_main.cc.

92{
93 ::testing::InitGoogleTest(&argc, argv);
94 ::testing::UnitTest& unit_test = *::testing::UnitTest::GetInstance();
95 bool debug{false};
96 for (int i = 1; i < argc; ++i) {
97 if (std::string(argv[i]) == "--debug") debug = true;
98 }
99 unit_test.listeners().Append(new TestEventListener(debug));
100 return RUN_ALL_TESTS();
101}