diff options
author | Tom Rondeau <trondeau@vt.edu> | 2010-09-30 16:08:53 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2010-09-30 16:08:53 -0400 |
commit | 036a42c08eadbd0a2c462ca61d9d883996be8042 (patch) | |
tree | d81b162793427d25fd190da528afb8207be3ca88 | |
parent | c81312cee781a6912eb87f430096f3757e056b28 (diff) |
Adding an XML outputter for the CPP Unit tests. This is to a) store the output information but also b) for integration with Hudson for logging and displaying the results during the build stages. This only covers a few cases so far and I need to define a better place to save the output files.
-rw-r--r-- | gnuradio-core/src/tests/test_all.cc | 6 | ||||
-rw-r--r-- | gnuradio-core/src/tests/test_filter.cc | 6 | ||||
-rw-r--r-- | gnuradio-core/src/tests/test_general.cc | 10 | ||||
-rw-r--r-- | gnuradio-core/src/tests/test_runtime.cc | 6 | ||||
-rw-r--r-- | gruel/src/lib/test_gruel.cc | 6 |
5 files changed, 27 insertions, 7 deletions
diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc index 6dc1a26f83..35bc0a049e 100644 --- a/gnuradio-core/src/tests/test_all.cc +++ b/gnuradio-core/src/tests/test_all.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,6 +21,7 @@ */ #include <cppunit/TextTestRunner.h> +#include <cppunit/XmlOutputter.h> #include <qa_runtime.h> #include <qa_general.h> @@ -34,11 +35,14 @@ main (int argc, char **argv) { CppUnit::TextTestRunner runner; + std::ofstream xmlfile("cppunit_test_all.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_runtime::suite ()); runner.addTest (qa_general::suite ()); runner.addTest (qa_filter::suite ()); // runner.addTest (qa_atsc::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 56e9452386..1e67b71801 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,6 +21,7 @@ */ #include <cppunit/TextTestRunner.h> +#include <cppunit/XmlOutputter.h> #include <qa_filter.h> int @@ -28,8 +29,11 @@ main (int argc, char **argv) { CppUnit::TextTestRunner runner; + std::ofstream xmlfile("cppunit_test_filter.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_filter::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc index 063e2ee45c..bc89c0b6b2 100644 --- a/gnuradio-core/src/tests/test_general.cc +++ b/gnuradio-core/src/tests/test_general.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,15 +21,19 @@ */ #include <cppunit/TextTestRunner.h> +#include <cppunit/XmlOutputter.h> #include <qa_general.h> int main (int argc, char **argv) { - - CppUnit::TextTestRunner runner; + CppUnit::TextTestRunner runner; + + std::ofstream xmlfile("cppunit_test_general.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_general::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc index 8549f2a9b8..1efd9a0c0e 100644 --- a/gnuradio-core/src/tests/test_runtime.cc +++ b/gnuradio-core/src/tests/test_runtime.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,6 +21,7 @@ */ #include <cppunit/TextTestRunner.h> +#include <cppunit/XmlOutputter.h> #include <qa_runtime.h> int @@ -28,8 +29,11 @@ main (int argc, char **argv) { CppUnit::TextTestRunner runner; + std::ofstream xmlfile("cppunit_test_runtime.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_runtime::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); diff --git a/gruel/src/lib/test_gruel.cc b/gruel/src/lib/test_gruel.cc index 669303447c..cb5f2d36bc 100644 --- a/gruel/src/lib/test_gruel.cc +++ b/gruel/src/lib/test_gruel.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2009 Free Software Foundation, Inc. + * Copyright 2006,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,6 +21,7 @@ */ #include <cppunit/TextTestRunner.h> +#include <cppunit/XmlOutputter.h> #include "pmt/qa_pmt.h" int @@ -28,8 +29,11 @@ main(int argc, char **argv) { CppUnit::TextTestRunner runner; + std::ofstream xmlfile("cppunit_gruel.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest(qa_pmt::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run("", false); |