From 6fa20055c60d92f7edd30daf3fcd6f4ef290ed18 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 18 May 2015 16:34:01 -0700 Subject: Generate XML reports when running on Jenkins If we detect a Jenkins environment using the environment variable JASMINE_JUNIT_REPORTS_DIR that we set in the job's configuration, then generate XML test reports for each Jasmine unit test. [endlessm/eos-sdk#3172] --- configure.ac | 10 ++++++++++ test/Makefile.am.inc | 1 + 2 files changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index c71973e..4bc10e6 100644 --- a/configure.ac +++ b/configure.ac @@ -201,6 +201,16 @@ AM_COND_IF([ENABLE_JS_DOC], [], [can_make_dist=no]) AM_CONDITIONAL([CAN_MAKE_DIST], [test "x$can_make_dist" = "xyes"]) AC_MSG_RESULT([$can_make_dist]) +# JASMINE_JUNIT_REPORTS_DIR: Where to put test reports +AC_MSG_CHECKING([where to put test reports]) +AC_ARG_VAR([JASMINE_JUNIT_REPORTS_DIR], [Where to put test reports]) +AS_IF([test -n "$JASMINE_JUNIT_REPORTS_DIR"], + [JASMINE_REPORT_ARGUMENT="--junit $JASMINE_JUNIT_REPORTS_DIR/\$\${log/%.log/.js.xml}" + AC_MSG_RESULT([in $JASMINE_JUNIT_REPORTS_DIR])], + [JASMINE_REPORT_ARGUMENT= + AC_MSG_RESULT([nowhere])]) +AC_SUBST([JASMINE_REPORT_ARGUMENT]) + # Required libraries # ------------------ PKG_CHECK_MODULES([EOS_SDK], [ diff --git a/test/Makefile.am.inc b/test/Makefile.am.inc index dc90227..11e4dea 100644 --- a/test/Makefile.am.inc +++ b/test/Makefile.am.inc @@ -64,6 +64,7 @@ AM_JS_LOG_FLAGS = \ --include-path=$(top_srcdir)/webhelper \ --include-path=$(top_srcdir) \ --tap \ + @JASMINE_REPORT_ARGUMENT@ \ --no-config \ $(NULL) LOG_COMPILER = gtester -- cgit v1.2.3