summaryrefslogtreecommitdiff
path: root/test/unit/util/configuration_black.cpp
blob: 0b54af43ab25e297ee33f60befed50af833ea7e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/******************************************************************************
 * Top contributors (to current version):
 *   Morgan Deters, Aina Niemetz
 *
 * This file is part of the cvc5 project.
 *
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
 * in the top-level source directory and their institutional affiliations.
 * All rights reserved.  See the file COPYING in the top-level source
 * directory for licensing information.
 * ****************************************************************************
 *
 * Black box testing of cvc5::Configuration.
 */

#include "base/configuration.h"
#include "test.h"

namespace cvc5 {
namespace test {

class TestUtilBlackConfiguration : public TestInternal
{
};

TEST_F(TestUtilBlackConfiguration, static_flags)
{
  const bool debug =
#ifdef CVC5_DEBUG
      true;
#else  /* CVC5_DEBUG */
      false;
#endif /* CVC5_DEBUG */

  const bool tracing =
#ifdef CVC5_TRACING
      true;
#else  /* CVC5_TRACING */
      false;
#endif /* CVC5_TRACING */

  const bool muzzled =
#ifdef CVC5_MUZZLE
      true;
#else  /* CVC5_MUZZLE */
      false;
#endif /* CVC5_MUZZLE */

  const bool assertions =
#ifdef CVC5_ASSERTIONS
      true;
#else  /* CVC5_ASSERTIONS */
      false;
#endif /* CVC5_ASSERTIONS */

  const bool coverage =
#ifdef CVC5_COVERAGE
      true;
#else  /* CVC5_COVERAGE */
      false;
#endif /* CVC5_COVERAGE */

  const bool profiling =
#ifdef CVC5_PROFILING
      true;
#else  /* CVC5_PROFILING */
      false;
#endif /* CVC5_PROFILING */

  ASSERT_EQ(Configuration::isDebugBuild(), debug);
  ASSERT_EQ(Configuration::isTracingBuild(), tracing);
  ASSERT_EQ(Configuration::isMuzzledBuild(), muzzled);
  ASSERT_EQ(Configuration::isAssertionBuild(), assertions);
  ASSERT_EQ(Configuration::isCoverageBuild(), coverage);
  ASSERT_EQ(Configuration::isProfilingBuild(), profiling);
}

TEST_F(TestUtilBlackConfiguration, package_name)
{
  ASSERT_EQ(Configuration::getPackageName(), "cvc5");
}

TEST_F(TestUtilBlackConfiguration, versions)
{
  // just test that the functions exist
  Configuration::getVersionString();
  Configuration::getVersionMajor();
  Configuration::getVersionMinor();
  Configuration::getVersionRelease();
}

TEST_F(TestUtilBlackConfiguration, about)
{
  // just test that the function exists
  Configuration::about();
}
}  // namespace test
}  // namespace cvc5
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback