LCOV - code coverage report
Current view: top level - buildbot/coverage/build/test/unit/util - configuration_black.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 21 21 100.0 %
Date: 2026-04-13 10:42:08 Functions: 16 16 100.0 %
Branches: 14 28 50.0 %

           Branch data     Line data    Source code
       1                 :            : /******************************************************************************
       2                 :            :  * This file is part of the cvc5 project.
       3                 :            :  *
       4                 :            :  * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS
       5                 :            :  * in the top-level source directory and their institutional affiliations.
       6                 :            :  * All rights reserved.  See the file COPYING in the top-level source
       7                 :            :  * directory for licensing information.
       8                 :            :  * ****************************************************************************
       9                 :            :  *
      10                 :            :  * Black box testing of cvc5::Configuration.
      11                 :            :  */
      12                 :            : 
      13                 :            : #include "base/configuration.h"
      14                 :            : #include "test.h"
      15                 :            : 
      16                 :            : namespace cvc5::internal {
      17                 :            : namespace test {
      18                 :            : 
      19                 :            : class TestUtilBlackConfiguration : public TestInternal
      20                 :            : {
      21                 :            : };
      22                 :            : 
      23                 :          4 : TEST_F(TestUtilBlackConfiguration, static_flags)
      24                 :            : {
      25                 :          1 :   const bool debug =
      26                 :            : #ifdef CVC5_DEBUG
      27                 :            :       true;
      28                 :            : #else  /* CVC5_DEBUG */
      29                 :            :       false;
      30                 :            : #endif /* CVC5_DEBUG */
      31                 :            : 
      32                 :          1 :   const bool tracing =
      33                 :            : #ifdef CVC5_TRACING
      34                 :            :       true;
      35                 :            : #else  /* CVC5_TRACING */
      36                 :            :       false;
      37                 :            : #endif /* CVC5_TRACING */
      38                 :            : 
      39                 :          1 :   const bool muzzled =
      40                 :            : #ifdef CVC5_MUZZLE
      41                 :            :       true;
      42                 :            : #else  /* CVC5_MUZZLE */
      43                 :            :       false;
      44                 :            : #endif /* CVC5_MUZZLE */
      45                 :            : 
      46                 :          1 :   const bool assertions =
      47                 :            : #ifdef CVC5_ASSERTIONS
      48                 :            :       true;
      49                 :            : #else  /* CVC5_ASSERTIONS */
      50                 :            :       false;
      51                 :            : #endif /* CVC5_ASSERTIONS */
      52                 :            : 
      53                 :          1 :   const bool coverage =
      54                 :            : #ifdef CVC5_COVERAGE
      55                 :            :       true;
      56                 :            : #else  /* CVC5_COVERAGE */
      57                 :            :       false;
      58                 :            : #endif /* CVC5_COVERAGE */
      59                 :            : 
      60                 :          1 :   const bool profiling =
      61                 :            : #ifdef CVC5_PROFILING
      62                 :            :       true;
      63                 :            : #else  /* CVC5_PROFILING */
      64                 :            :       false;
      65                 :            : #endif /* CVC5_PROFILING */
      66                 :            : 
      67 [ -  + ][ +  - ]:          1 :   ASSERT_EQ(Configuration::isDebugBuild(), debug);
      68 [ -  + ][ +  - ]:          1 :   ASSERT_EQ(Configuration::isTracingBuild(), tracing);
      69 [ -  + ][ +  - ]:          1 :   ASSERT_EQ(Configuration::isMuzzledBuild(), muzzled);
      70 [ -  + ][ +  - ]:          1 :   ASSERT_EQ(Configuration::isAssertionBuild(), assertions);
      71 [ -  + ][ +  - ]:          1 :   ASSERT_EQ(Configuration::isCoverageBuild(), coverage);
      72 [ -  + ][ +  - ]:          1 :   ASSERT_EQ(Configuration::isProfilingBuild(), profiling);
      73                 :            : }
      74                 :            : 
      75                 :          4 : TEST_F(TestUtilBlackConfiguration, package_name)
      76                 :            : {
      77 [ -  + ][ +  - ]:          2 :   ASSERT_EQ(Configuration::getPackageName(), "cvc5");
      78                 :            : }
      79                 :            : 
      80                 :          4 : TEST_F(TestUtilBlackConfiguration, versions)
      81                 :            : {
      82                 :            :   // just test that the functions exist
      83                 :          1 :   Configuration::getVersionString();
      84                 :          1 : }
      85                 :            : 
      86                 :          4 : TEST_F(TestUtilBlackConfiguration, about)
      87                 :            : {
      88                 :            :   // just test that the function exists
      89                 :          1 :   Configuration::about();
      90                 :          1 : }
      91                 :            : }  // namespace test
      92                 :            : }  // namespace cvc5::internal

Generated by: LCOV version 1.14