summaryrefslogtreecommitdiffstats
path: root/tester/covoar/CoverageFactory.cc
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-05-11 14:24:11 +1200
committerChris Johns <chrisj@rtems.org>2018-06-18 12:26:16 +1000
commit881824f766937a47fb494f97f4ebcd44c99135cc (patch)
tree0af3d9422ba8e0eae6df8458cc08d4aafacff301 /tester/covoar/CoverageFactory.cc
parentlinkers/exe-info: Add DWARF support to gather and check producer details. (diff)
downloadrtems-tools-881824f766937a47fb494f97f4ebcd44c99135cc.tar.bz2
tester/covoar: Remove all exit() calls and throw an rld::error exception.
Add a suitable catch to covoar's main.
Diffstat (limited to 'tester/covoar/CoverageFactory.cc')
-rw-r--r--tester/covoar/CoverageFactory.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/tester/covoar/CoverageFactory.cc b/tester/covoar/CoverageFactory.cc
index 8b30371..991ba8f 100644
--- a/tester/covoar/CoverageFactory.cc
+++ b/tester/covoar/CoverageFactory.cc
@@ -10,6 +10,8 @@
#include <stdlib.h>
#include <string.h>
+#include <rld.h>
+
#include "CoverageFactory.h"
#include "CoverageReaderQEMU.h"
#include "CoverageReaderRTEMS.h"
@@ -35,13 +37,10 @@ Coverage::CoverageFormats_t Coverage::CoverageFormatToEnum(
if (!strcmp( format, "TSIM" ))
return COVERAGE_FORMAT_TSIM;
- fprintf(
- stderr,
- "ERROR: %s is an unknown coverage format "
- "(supported formats - QEMU, RTEMS, Skyeye and TSIM)\n",
- format
- );
- exit( 1 );
+ std::ostringstream what;
+ what << format << " is an unknown coverage format "
+ << "(supported formats - QEMU, RTEMS, Skyeye and TSIM)";
+ throw rld::error( what, "Coverage" );
}
Coverage::CoverageReaderBase* Coverage::CreateCoverageReader(