This commit is contained in:
jez 2006-10-11 22:51:04 +00:00
parent 8463ce21c2
commit c12723cfb7
60 changed files with 63 additions and 17 deletions

View file

@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS= src test examples
SUBDIRS= src tests examples
install-data-local:
@echo "------------------------------------------------------------"
@ -22,7 +22,7 @@ uninstall-local:
do rm -rf "$(includedir)/$$dir"; \
done
DIST_SUBDIRS= src test examples
DIST_SUBDIRS= src tests examples
EXTRA_DIST=vs7 \
include \
src/SAX/wrappers/saxexpat.cpp \
@ -36,3 +36,7 @@ dist-hook:
pkgconfigdir = src/pkgconfig
pkgconfig_DATA = arabica.pc
test:
cd tests && make test;
cd ..

View file

@ -22,10 +22,10 @@ ARABICA_CHECK_CODECVT_SPECIALISATIONS
AC_OUTPUT(Makefile \
arabica.pc \
src/Makefile \
test/Makefile \
test/DOM/Makefile \
test/SAX2DOM/Makefile \
test/XPath/Makefile \
tests/Makefile \
tests/DOM/Makefile \
tests/SAX2DOM/Makefile \
tests/XPath/Makefile \
examples/Makefile \
examples/SAX/Makefile \
examples/DOM/Makefile \

View file

@ -31,12 +31,21 @@ void TestRunner::run(int ac, const char **av)
{
string testCase;
int numberOfTests = 0;
int opt = 0;
for(int i = 1; i < ac; i++)
{
if(string(av[i]) == "-wait")
{
m_wait = true;
++opt;
continue;
}
if(string(av[i]) == "-q")
{
verbose_ = false;
++opt;
continue;
}
@ -56,6 +65,7 @@ void TestRunner::run(int ac, const char **av)
{
if((*it).first == testCase)
{
if(verbose_)
cout << (*it).first << std::endl;
testToRun = (*it).second;
run(testToRun);
@ -71,11 +81,12 @@ void TestRunner::run(int ac, const char **av)
}
} // for ...
if(ac == 1)
if((ac-opt) == 1)
{
// run everything
for(mappings::iterator it = m_mappings.begin(); it != m_mappings.end(); ++it)
{
if(verbose_)
cout << (*it).first << std::endl;
run((*it).second);
}
@ -105,8 +116,8 @@ TestRunner::~TestRunner ()
void TestRunner::run(Test *test)
{
TextTestResult result;
TextTestResult result(verbose_);
test->run (&result);
cout << result << endl;
cout << result;
} // run

View file

@ -7,6 +7,7 @@
class TestRunner
{
protected:
bool verbose_;
bool m_wait;
std::vector<std::pair<std::string,Test *> > m_mappings;

View file

@ -9,6 +9,7 @@ using namespace std;
void TextTestResult::addError (Test *test, CppUnitException *e)
{
TestResult::addError (test, e);
if(verbose_)
cerr << "E" << endl;
}
@ -16,15 +17,15 @@ void TextTestResult::addError (Test *test, CppUnitException *e)
void TextTestResult::addFailure (Test *test, CppUnitException *e)
{
TestResult::addFailure (test, e);
if(verbose_)
cerr << "F" << endl;
}
void TextTestResult::startTest (Test *test)
{
TestResult::startTest (test);
if(verbose_)
cerr << ".";
}
@ -87,14 +88,18 @@ void TextTestResult::print (ostream& stream)
printHeader (stream);
printErrors (stream);
printFailures (stream);
if(verbose_ || !wasSuccessful())
cout << endl;
}
void TextTestResult::printHeader (ostream& stream)
{
if (wasSuccessful ())
{
if(verbose_)
cout << endl << "OK (" << runTests () << " tests)" << endl;
}
else
cout << endl
<< "!!!FAILURES!!!" << endl

View file

@ -9,6 +9,7 @@
class TextTestResult : public TestResult
{
public:
TextTestResult(bool verbose) : verbose_(verbose) { }
virtual void addError (Test *test, CppUnitException *e);
virtual void addFailure (Test *test, CppUnitException *e);
virtual void startTest (Test *test);
@ -17,6 +18,8 @@ public:
virtual void printFailures (std::ostream& stream);
virtual void printHeader (std::ostream& stream);
private:
bool verbose_;
};

View file

@ -52,3 +52,9 @@ dom_test_wide_LDADD = $(LIBARABICA)
INCLUDES = -I$(top_srcdir)/include $(PARSER_HEADERS) $(BOOST_CPPFLAGS)
test:
@for p in $(bin_PROGRAMS); do \
echo Running $$p; \
./$$p -q; \
done

View file

@ -8,3 +8,9 @@ endif
install:
echo "Nothing to install here"
test:
@for p in $(SUBDIRS); do \
cd $$p && make test; \
cd ..; \
done

View file

@ -34,3 +34,8 @@ sax2dom_test_LDADD = $(LIBARABICA)
INCLUDES = -I$(top_srcdir)/include $(PARSER_HEADERS) $(BOOST_CPPFLAGS)
test:
@for p in $(bin_PROGRAMS); do \
echo Running $$p; \
./$$p -q; \
done

View file

@ -54,3 +54,8 @@ xpath_test_wide_LDADD = $(LIBARABICA)
INCLUDES = -I$(top_srcdir)/include $(PARSER_HEADERS) $(BOOST_CPPFLAGS)
test:
@for p in $(bin_PROGRAMS); do \
echo Running $$p; \
./$$p -q; \
done