Xyst test code coverage report
Current view: top level - UnitTest - TUTTest.hpp (source / functions) Hit Total Coverage
Commit: e489e3468f2b950872163df1285c13fa7a355e8c Lines: 5 5 100.0 %
Date: 2024-11-20 18:31:06 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 9 22 40.9 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/UnitTest/TUTTest.hpp
       4                 :            :   \copyright 2012-2015 J. Bakosi,
       5                 :            :              2016-2018 Los Alamos National Security, LLC.,
       6                 :            :              2019-2021 Triad National Security, LLC.,
       7                 :            :              2022-2024 J. Bakosi
       8                 :            :              All rights reserved. See the LICENSE file for details.
       9                 :            :   \brief     Template Unit Test unit test class declaration
      10                 :            :   \details   Template Unit Test unit test class declaration.
      11                 :            : */
      12                 :            : // *****************************************************************************
      13                 :            : #ifndef TUTTest_h
      14                 :            : #define TUTTest_h
      15                 :            : 
      16                 :            : #include <string>
      17                 :            : #include <iosfwd>
      18                 :            : 
      19                 :            : #include "NoWarning/tut.hpp"
      20                 :            : #include "NoWarning/tuttest.decl.h"
      21                 :            : 
      22                 :            : namespace unittest {
      23                 :            : 
      24                 :            : extern tut::test_runner_singleton g_runner;
      25                 :            : 
      26                 :            : //! \brief Generic Charm++ chare class for unit tests utilizing the Template
      27                 :            : //!    Unit Test library
      28                 :            : template< class Proxy >
      29                 :            : class TUTTest : public CBase_TUTTest< Proxy > {
      30                 :            : 
      31                 :            :   public:
      32                 :            :     //! Constructor: run test then call back to host proxy to evaluate it
      33                 :            :     //! \param[in] proxy Host proxy to call back to after test has been run
      34                 :            :     //! \param[in] groupname Name of the group the test belongs to
      35                 :            :     //! \param[in] t Test number in test group
      36                 :       2500 :     explicit TUTTest( Proxy&& proxy, const std::string& groupname, int t ) {
      37                 :       2500 :       tut::test_result tr;
      38         [ +  - ]:       2500 :       g_runner.get().run_test( groupname, t, tr );
      39 [ +  - ][ +  - ]:      15000 :       proxy.evaluateTest( { tr.group, tr.name, std::to_string(tr.result),
         [ +  + ][ -  - ]
      40                 :            :                             tr.message, tr.exception_typeid } );
      41 [ +  - ][ +  - ]:       5000 :     }
         [ +  - ][ +  - ]
         [ -  - ][ -  - ]
      42                 :            : };
      43                 :            : 
      44                 :            : } // unittest::
      45                 :            : 
      46                 :            : #define CK_TEMPLATES_ONLY
      47                 :            : #include "NoWarning/tuttest.def.h"
      48                 :            : #undef CK_TEMPLATES_ONLY
      49                 :            : 
      50                 :            : #endif // TUTTest_h

Generated by: LCOV version 1.16