2d7378a676de2db887a2dac2bdd59766990200d4
[cvc5.git] / test / unit / util / configuration_black.h
1 /********************* */
2 /*! \file configuration_black.h
3 ** \verbatim
4 ** Original author: Morgan Deters
5 ** Major contributors: none
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2014 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
11 **
12 ** \brief Black box testing of CVC4::Configuration.
13 **
14 ** Black box testing of CVC4::Configuration.
15 **/
16
17 #include <cxxtest/TestSuite.h>
18
19 #include "util/configuration.h"
20
21 using namespace CVC4;
22 using namespace std;
23
24 class ConfigurationBlack : public CxxTest::TestSuite {
25
26 public:
27
28 void testStaticFlags() {
29 const bool debug =
30 #ifdef CVC4_DEBUG
31 true;
32 #else /* CVC4_DEBUG */
33 false;
34 #endif /* CVC4_DEBUG */
35
36 const bool tracing =
37 #ifdef CVC4_TRACING
38 true;
39 #else /* CVC4_TRACING */
40 false;
41 #endif /* CVC4_TRACING */
42
43 const bool muzzled =
44 #ifdef CVC4_MUZZLE
45 true;
46 #else /* CVC4_MUZZLE */
47 false;
48 #endif /* CVC4_MUZZLE */
49
50 const bool assertions =
51 #ifdef CVC4_ASSERTIONS
52 true;
53 #else /* CVC4_ASSERTIONS */
54 false;
55 #endif /* CVC4_ASSERTIONS */
56
57 const bool coverage =
58 #ifdef CVC4_COVERAGE
59 true;
60 #else /* CVC4_COVERAGE */
61 false;
62 #endif /* CVC4_COVERAGE */
63
64 const bool profiling =
65 #ifdef CVC4_PROFILING
66 true;
67 #else /* CVC4_PROFILING */
68 false;
69 #endif /* CVC4_PROFILING */
70
71 TS_ASSERT( Configuration::isDebugBuild() == debug );
72 TS_ASSERT( Configuration::isTracingBuild() == tracing );
73 TS_ASSERT( Configuration::isMuzzledBuild() == muzzled );
74 TS_ASSERT( Configuration::isAssertionBuild() == assertions );
75 TS_ASSERT( Configuration::isCoverageBuild() == coverage );
76 TS_ASSERT( Configuration::isProfilingBuild() == profiling );
77 }
78
79 void testPackageName() {
80 TS_ASSERT( Configuration::getPackageName() == "cvc4" );
81 }
82
83 void testVersions() {
84 // just test that the functions exist
85 Configuration::getVersionString();
86 Configuration::getVersionMajor();
87 Configuration::getVersionMinor();
88 Configuration::getVersionRelease();
89 }
90
91 void testAbout() {
92 // just test that the function exists
93 Configuration::about();
94 }
95
96 };