LCOV - code coverage report
Current view: top level - tests - catch_main.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 13 13 100.0 %
Date: 2023-06-11 18:21:25 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // Copyright (c) 2019-2023  Made to Order Software Corp.  All Rights Reserved
       2             : //
       3             : // https://snapwebsites.org/project/safepasswords
       4             : // contact@m2osw.com
       5             : //
       6             : // This program is free software: you can redistribute it and/or modify
       7             : // it under the terms of the GNU General Public License as published by
       8             : // the Free Software Foundation, either version 3 of the License, or
       9             : // (at your option) any later version.
      10             : //
      11             : // This program is distributed in the hope that it will be useful,
      12             : // but WITHOUT ANY WARRANTY; without even the implied warranty of
      13             : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14             : // GNU General Public License for more details.
      15             : //
      16             : // You should have received a copy of the GNU General Public License
      17             : // along with this program.  If not, see <https://www.gnu.org/licenses/>.
      18             : 
      19             : // Tell catch we want it to add the runner code in this file.
      20             : #define CATCH_CONFIG_RUNNER
      21             : 
      22             : // self
      23             : //
      24             : #include    "catch_main.h"
      25             : 
      26             : 
      27             : // prinbee
      28             : //
      29             : #include    <prinbee/version.h>
      30             : 
      31             : 
      32             : // libexcept
      33             : //
      34             : #include    <libexcept/exception.h>
      35             : 
      36             : 
      37             : // snaplogger
      38             : //
      39             : #include    <snaplogger/logger.h>
      40             : 
      41             : 
      42             : // snapdev
      43             : //
      44             : #include    <snapdev/not_used.h>
      45             : 
      46             : 
      47             : // C++
      48             : //
      49             : #include    <fstream>
      50             : 
      51             : 
      52             : // C
      53             : //
      54             : #include    <sys/stat.h>
      55             : #include    <sys/types.h>
      56             : 
      57             : 
      58             : 
      59             : namespace SNAP_CATCH2_NAMESPACE
      60             : {
      61             : 
      62             : 
      63             : 
      64             : 
      65             : 
      66           2 : void init_callback()
      67             : {
      68           2 :     libexcept::set_collect_stack(libexcept::collect_stack_t::COLLECT_STACK_NO);
      69           2 : }
      70             : 
      71             : 
      72           1 : int init_tests(Catch::Session & session)
      73             : {
      74           1 :     snapdev::NOT_USED(session);
      75             : 
      76           1 :     snaplogger::logger::pointer_t l(snaplogger::logger::get_instance());
      77           1 :     l->add_console_appender();
      78           1 :     l->set_severity(snaplogger::severity_t::SEVERITY_ALL);
      79             : 
      80             :     // to test that the logger works as expected
      81             :     //SNAP_LOG_ERROR
      82             :     //    << "This is an error through the logger..."
      83             :     //    << SNAP_LOG_SEND;
      84             : 
      85           1 :     return 0;
      86           1 : }
      87             : 
      88             : 
      89             : }
      90             : 
      91             : 
      92             : 
      93           2 : int main(int argc, char * argv[])
      94             : {
      95           2 :     return SNAP_CATCH2_NAMESPACE::snap_catch2_main(
      96             :               "safepasswords"
      97             :             , PRINBEE_VERSION_STRING
      98             :             , argc
      99             :             , argv
     100             :             , SNAP_CATCH2_NAMESPACE::init_callback
     101             :             , nullptr
     102             :             , SNAP_CATCH2_NAMESPACE::init_tests
     103           2 :         );
     104             : }
     105             : 
     106             : 
     107             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.14