summaryrefslogtreecommitdiff
path: root/test/unit/util/configuration_black.h
blob: f0776359539b200aeaef3e82f3de4639ee72c9d5 (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
/*********************                                                        */
/*! \file configuration_black.h
 ** \verbatim
 ** Original author: Morgan Deters
 ** Major contributors: none
 ** Minor contributors (to current version): none
 ** This file is part of the CVC4 project.
 ** Copyright (c) 2009-2014  New York University and The University of Iowa
 ** See the file COPYING in the top-level source directory for licensing
 ** information.\endverbatim
 **
 ** \brief Black box testing of CVC4::Configuration.
 **
 ** Black box testing of CVC4::Configuration.
 **/

#include <cxxtest/TestSuite.h>

#include "base/configuration.h"

using namespace CVC4;
using namespace std;

class ConfigurationBlack : public CxxTest::TestSuite {

public:

  void testStaticFlags() {
    const bool debug =
#ifdef CVC4_DEBUG
      true;
#else /* CVC4_DEBUG */
      false;
#endif /* CVC4_DEBUG */

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

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

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

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

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

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

  void testPackageName() {
    TS_ASSERT( Configuration::getPackageName() == "cvc4" );
  }

  void testVersions() {
    // just test that the functions exist
    Configuration::getVersionString();
    Configuration::getVersionMajor();
    Configuration::getVersionMinor();
    Configuration::getVersionRelease();
  }

  void testAbout() {
    // just test that the function exists
    Configuration::about();
  }

};
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback