@@ -2,13 +2,16 @@
*.gcda
*.gcno
*.gcov
+*.trs
*.la
*.lo
+*.log
*.o
*.orig
*.patch
*.rej
*.swp
+*.xml
*~
.deps/
.dirstamp
@@ -383,6 +383,7 @@ AC_MSG_RESULT([
Deprecated APIs: ${deprecated}
debug: ${enable_debug}
cunit: ${cunit_support}
+ cunit xml output: ${cunit_out_xml}
test_vald: ${test_vald}
test_perf: ${test_perf}
test_perf_proc: ${test_perf_proc}
new file mode 100644
@@ -0,0 +1 @@
+!*.xml
@@ -1,3 +1,4 @@
+
/* Copyright (c) 2014, Linaro Limited
* All rights reserved.
*
@@ -7,12 +8,14 @@
#include "config.h"
#include <string.h>
+#include <unistd.h>
#include <odp_api.h>
#include "odp_cunit_common.h"
#include <odp/helper/odph_api.h>
/* Globals */
static odph_odpthread_t thread_tbl[MAX_WORKERS];
static odp_instance_t instance;
+static char *progname;
/*
* global init/term functions which may be registered
@@ -296,8 +299,13 @@ int odp_cunit_run(void)
printf("\tODP implementation name: %s\n", odp_version_impl_name());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
+#if TEST_CUNIT_XML
+ CU_set_output_filename(progname);
+ CU_automated_run_tests();
+#else
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
+#endif
ret = CU_get_number_of_failure_records();
@@ -371,5 +379,6 @@ int odp_cunit_register(odp_suiteinfo_t testsuites[])
*/
int odp_cunit_parse_options(int argc, char *argv[])
{
+ progname = argv[0];
return odph_parse_options(argc, argv, NULL, NULL);
}
@@ -17,6 +17,7 @@
#include <inttypes.h>
#include "CUnit/Basic.h"
#include "CUnit/TestDB.h"
+#include <CUnit/Automated.h>
#include <odp_api.h>
#define MAX_WORKERS 32 /**< Maximum number of work threads */
@@ -31,3 +31,13 @@ AM_CONDITIONAL([test_vald], [test "x$test_vald" = "xyes"])
AC_SUBST([CUNIT_CFLAGS])
AC_SUBST([CUNIT_LIBS])
+
+AC_ARG_ENABLE([cunit_out_xml],
+ [AS_HELP_STRING([--enable-cunit_out_xml],
+ [output to xml]
+ [(output test results to xml instead of plain text)])],
+ [cunit_out_xml=yes], [cunit_out_xml=no])
+AS_IF([test "x$cunit_out_xml" == "xyes"], [TEST_CUNIT_XML=1],
+ [TEST_CUNIT_XML=0])
+AC_DEFINE_UNQUOTED([TEST_CUNIT_XML], [$TEST_CUNIT_XML],
+ [Define to 1 to output to xml])