Boost logo

Boost Users :

Subject: [Boost-users] Redirecting test output to an XML file
From: Stephen Torri (storri_at_[hidden])
Date: 2009-10-30 20:13:28


I have the following code that I am using to regression test part of my
library. The project uses automake and autoconf to build the Makefiles
then runs the tests via 'make check'. I would like to see all the test
result output written as XML files in the directory where the test files
reside. That way I can use a script to gather them up and craft a web
page off of them.

My question: How to redirect Boost Test output to an XML file?

I see I can use --log_format=XML to make an XML file but not quite sure
how to incorporate that into automake and autoconf.

Stephen

----------------------------------------
#include "Elf_arc_utils.h"

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Suites
#include <boost/test/unit_test.hpp>

#include <string>

BOOST_AUTO_TEST_SUITE(getType)

BOOST_AUTO_TEST_CASE(getTypeMin)
{
  using namespace libreverse::elf_module;

  BOOST_TEST_CHECKPOINT("getType minimum case");
  std::string result = arc::ElfArcUtils::getType(arc::E_ARC_MACH_ARC5);
  BOOST_CHECK_EQUAL ( result, "R_ARC_NONE");
}

BOOST_AUTO_TEST_CASE(getTypeMax)
{
  using namespace libreverse::elf_module;

  std::string result = arc::ElfArcUtils::getType(arc::E_ARC_MACH_ARC8);
  BOOST_CHECK_EQUAL ( result, "R_ARC_B22_PCREL");
}

BOOST_AUTO_TEST_CASE(expectedUnknown)
{
  using namespace libreverse::elf_module;

  std::string result = arc::ElfArcUtils::getType(4);
  BOOST_CHECK_EQUAL ( result, "unknown");
}

BOOST_AUTO_TEST_CASE(negativeValue)
{
  using namespace libreverse::elf_module;

  std::string result = arc::ElfArcUtils::getType(-1);
  BOOST_CHECK_EQUAL ( result, "unknown");
}

BOOST_AUTO_TEST_SUITE_END()


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net