GCC Code Coverage Report
Directory: . Exec Total Coverage
File: test/unit/util/configuration_black.cpp Lines: 26 26 100.0 %
Date: 2021-05-22 Branches: 30 116 25.9 %

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