mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-13 08:01:17 +01:00
This commit is contained in:
parent
8463ce21c2
commit
c12723cfb7
60 changed files with 63 additions and 17 deletions
|
@ -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 ..
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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,7 +65,8 @@ void TestRunner::run(int ac, const char **av)
|
|||
{
|
||||
if((*it).first == testCase)
|
||||
{
|
||||
cout << (*it).first << std::endl;
|
||||
if(verbose_)
|
||||
cout << (*it).first << std::endl;
|
||||
testToRun = (*it).second;
|
||||
run(testToRun);
|
||||
}
|
||||
|
@ -71,12 +81,13 @@ 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)
|
||||
{
|
||||
cout << (*it).first << std::endl;
|
||||
if(verbose_)
|
||||
cout << (*it).first << std::endl;
|
||||
run((*it).second);
|
||||
}
|
||||
return;
|
||||
|
@ -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
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
class TestRunner
|
||||
{
|
||||
protected:
|
||||
bool verbose_;
|
||||
bool m_wait;
|
||||
std::vector<std::pair<std::string,Test *> > m_mappings;
|
||||
|
|
@ -9,22 +9,23 @@ using namespace std;
|
|||
void TextTestResult::addError (Test *test, CppUnitException *e)
|
||||
{
|
||||
TestResult::addError (test, e);
|
||||
cerr << "E" << endl;
|
||||
if(verbose_)
|
||||
cerr << "E" << endl;
|
||||
|
||||
}
|
||||
|
||||
void TextTestResult::addFailure (Test *test, CppUnitException *e)
|
||||
{
|
||||
TestResult::addFailure (test, e);
|
||||
cerr << "F" << endl;
|
||||
|
||||
if(verbose_)
|
||||
cerr << "F" << endl;
|
||||
}
|
||||
|
||||
void TextTestResult::startTest (Test *test)
|
||||
{
|
||||
TestResult::startTest (test);
|
||||
cerr << ".";
|
||||
|
||||
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
|
|
@ -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_;
|
||||
};
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -8,3 +8,9 @@ endif
|
|||
|
||||
install:
|
||||
echo "Nothing to install here"
|
||||
|
||||
test:
|
||||
@for p in $(SUBDIRS); do \
|
||||
cd $$p && make test; \
|
||||
cd ..; \
|
||||
done
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in a new issue