@@ -1,13 +1,16 @@
*.d
*.gcda
*.gcno
+*.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
@@ -17,6 +17,9 @@ INCFLAGS = \
AM_CPPFLAGS = $(INCFLAGS)
AM_CFLAGS = $(CUNIT_CFLAGS)
+if cunit_out_xml
+AM_CFLAGS += -DTEST_CUNIT_XML
+endif
AM_LDFLAGS = -L$(LIB) -static
@@ -1,3 +1,4 @@
+
/* Copyright (c) 2014, Linaro Limited
* All rights reserved.
*
@@ -7,6 +8,7 @@
#include "config.h"
#include <string.h>
+#include <unistd.h>
#include <odp_api.h>
#include "odp_cunit_common.h"
#include <odp/helper/odph_api.h>
@@ -14,6 +16,7 @@
static odph_odpthread_t thread_tbl[MAX_WORKERS];
static odp_instance_t instance;
+extern const char *__progname;
/*
* global init/term functions which may be registered
* defaults to functions performing odp init/term.
@@ -291,13 +294,30 @@ static int cunit_update_suite(odp_suiteinfo_t *updated_sinfo)
int odp_cunit_run(void)
{
int ret;
+#ifdef TEST_CUNIT_XML
+ char name[255];
+#endif
printf("\tODP API version: %s\n", odp_version_api_str());
printf("\tODP implementation name: %s\n", odp_version_impl_name());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
+#ifdef TEST_CUNIT_XML
+ if (strlen(__progname)) {
+ snprintf(name, 255, "%s", __progname);
+ CU_set_output_filename(name);
+ } else {
+ /* forked processes do not have __progname */
+ ret = readlink("/proc/self/exe", name, sizeof(name) - 1);
+ name[ret] = 0;
+ CU_set_output_filename(basename(name));
+ }
+
+ CU_automated_run_tests();
+#else
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
+#endif
ret = CU_get_number_of_failure_records();
@@ -17,6 +17,9 @@
#include <inttypes.h>
#include "CUnit/Basic.h"
#include "CUnit/TestDB.h"
+#ifdef TEST_CUNIT_XML
+#include <CUnit/Automated.h>
+#endif
#include <odp_api.h>
#define MAX_WORKERS 32 /**< Maximum number of work threads */
@@ -19,6 +19,14 @@ AS_IF([test "x$cunit_support" != "xno"],
[cunit_support=no])
])])
+
+##########################################################################
+AC_ARG_ENABLE([cunit_out_xml],
+ [AS_HELP_STRING([--enable-cunit_out_xml],
+ [include additional debugging code ]
+ [(set to 'full' to enable all --enable-*-debug-* options)])],
+ cunit_out_xml=yes, cunit_out_xml=no)
+
AS_IF([test "x$test_vald" = "xyes" -a "x$cunit_support" = "xno"],
[AC_MSG_ERROR([Validation testsuite requested, but CUnit was not found])],
[test "x$test_vald" = "xcheck" -a "x$cunit_support" = "xno"],
@@ -27,6 +35,7 @@ AS_IF([test "x$test_vald" = "xyes" -a "x$cunit_support" = "xno"],
[test "x$test_vald" != "xno"], [test_vald=yes])
AM_CONDITIONAL([cunit_support], [test "x$cunit_support" = "xyes"])
+AM_CONDITIONAL([cunit_out_xml], [test "x$cunit_out_xml" = "xyes"])
AM_CONDITIONAL([test_vald], [test "x$test_vald" = "xyes"])
AC_SUBST([CUNIT_CFLAGS])