Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions unit-tests/DmrRoundTripTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

#include "config.h"

#include <cppunit/TextTestRunner.h>
#include <cppunit/extensions/HelperMacros.h>

#include <sstream>

#include "Array.h"
Expand All @@ -45,23 +42,6 @@
#include "testFile.h"
#include "test_config.h"

static bool debug2 = false;

#undef DBG
#define DBG(x) \
do { \
if (debug) { \
x; \
} \
} while (false)
#undef DBG2
#define DBG2(x) \
do { \
if (debug2) { \
x; \
} \
} while (false)

using namespace CppUnit;
using namespace std;
using namespace libdap;
Expand Down
36 changes: 23 additions & 13 deletions unit-tests/run_tests_cppunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ bool debug = false;
#define DBG(x) \
do { \
if (debug) \
(x); \
x; \
} while (false)

bool debug2 = false;

#undef DBG2
#define DBG2(x) \
do { \
if (debug2) \
x; \
} while (false)

/**
Expand All @@ -68,7 +77,7 @@ template <class CLASS> bool run_tests(int argc, char *argv[]) {
debug = true; // debug is a global
break;
case 'D':
debug = true; // debug is a global
debug2 = true; // debug is a global
break;
case 'h': { // help - show test names
std::cerr << "Usage: the following tests can be run individually or in combination:" << std::endl;
Expand All @@ -86,19 +95,20 @@ template <class CLASS> bool run_tests(int argc, char *argv[]) {
argc -= optind;
argv += optind;

if (0 == argc) { // run them all
if (0 == argc) {
// run them all
return runner.run("");
} else {
bool wasSuccessful = true;
int i = 0;
while (i < argc) {
std::string test = CLASS::suite()->getName().append("::").append(argv[i++]);
if (debug)
std::cerr << "Running " << test << std::endl;
wasSuccessful = wasSuccessful && runner.run(test);
}
return wasSuccessful;
}

bool wasSuccessful = true;
int i = 0;
while (i < argc) {
std::string test = CLASS::suite()->getName().append("::").append(argv[i++]);
if (debug)
std::cerr << "Running " << test << std::endl;
wasSuccessful = wasSuccessful && runner.run(test);
}
return wasSuccessful;
}

#endif // HYRAX_GIT_RUN_TESTS_CPPUNIT_H
Loading