Branch data Line data Source code
1 : : // ***************************************************************************** 2 : : /*! 3 : : \file src/Main/UnitTestDriver.cpp 4 : : \copyright 2012-2015 J. Bakosi, 5 : : 2016-2018 Los Alamos National Security, LLC., 6 : : 2019-2021 Triad National Security, LLC. 7 : : All rights reserved. See the LICENSE file for details. 8 : : \brief Unit test driver 9 : : \details Unit test driver. 10 : : */ 11 : : // ***************************************************************************** 12 : : 13 : : #include "UnitTestDriver.hpp" 14 : : #include "UnitTest/CmdLine/CmdLine.hpp" 15 : : #include "WalkerConfig.hpp" 16 : : #include "NoWarning/tutsuite.decl.h" 17 : : #include "TaggedTupleDeepPrint.hpp" 18 : : #include "Writer.hpp" 19 : : 20 : : using unittest::UnitTestDriver; 21 : : 22 : : namespace unittest { 23 : : 24 : : extern CProxy_TUTSuite g_suiteProxy; 25 : : 26 : : } // unittest:: 27 : : 28 : 1 : UnitTestDriver::UnitTestDriver( const ctr::CmdLine& cmdline, int ) 29 : : // ***************************************************************************** 30 : : // Constructor 31 : : //! \param[in] cmdline Command line object storing data parsed from the command 32 : : //! line arguments 33 : : // ***************************************************************************** 34 : : { 35 : : // Output command line object to file 36 [ + - ]: 1 : auto logfilename = tk::unittest_executable() + "_input.log"; 37 [ + - ]: 1 : tk::Writer log( logfilename ); 38 [ + - ][ + - ]: 2 : tk::print( log.stream(), "cmdline", cmdline ); [ + - ] 39 : : 40 : : // Instantiate (on PE 0 ) and run unit test suite. We only support Template 41 : : // Unit Test suites at this point, so no factory instantiation, simply fire up 42 : : // a Charm++ chare TUTSuite, which fires up and evaluates all unit tests 43 : : // included in Main/UnitTest.C. Store proxy handle in global-scope to make it 44 : : // available to individual unit tests that fire up Charm++ chares so they can 45 : : // call back to the test suite. Since this is called inside the main chare 46 : : // constructor, the Charm++ runtime system distributes the handle along with 47 : : // all other global-scope data. 48 [ + - ]: 2 : g_suiteProxy = CProxy_TUTSuite::ckNew( cmdline, 0 ); 49 : 1 : }