diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-04-09 16:25:32 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-04-09 16:25:32 +0000 |
commit | e390a4207d3858927354b3d4b40d540c00f8064c (patch) | |
tree | 589fd13ed8f6ba835cd79a2894092860b66b7696 /test/unit/util/configuration_black.h | |
parent | c3a6ff8c6e4a0c743cd33eb29931f837eeb2959e (diff) |
added experimental "make lcov" target (it runs only unit tests); better coverage for util and context classes; implemented some output functionality that was missing; reclassified some tests white -> black or black -> public; other minor fixes
Diffstat (limited to 'test/unit/util/configuration_black.h')
-rw-r--r-- | test/unit/util/configuration_black.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/test/unit/util/configuration_black.h b/test/unit/util/configuration_black.h new file mode 100644 index 000000000..5ee4cf095 --- /dev/null +++ b/test/unit/util/configuration_black.h @@ -0,0 +1,95 @@ +/********************* */ +/** configuration_black.h + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Courant Institute of Mathematical Sciences + ** New York University + ** See the file COPYING in the top-level source directory for licensing + ** information. + ** + ** Black box testing of CVC4::Configuration. + **/ + +#include <cxxtest/TestSuite.h> + +#include "util/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(); + } + +}; |