summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2015-05-18 16:34:01 -0700
committerPhilip Chimento <philip@endlessm.com>2015-05-20 12:26:54 -0700
commit6fa20055c60d92f7edd30daf3fcd6f4ef290ed18 (patch)
tree85f43ac8ce242d1acb60ba43a0edd8c77eaf9af3
parent8dacb1f51f02a86c7516cb4f2e3ed9556ce80d9e (diff)
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]
-rw-r--r--configure.ac10
-rw-r--r--test/Makefile.am.inc1
2 files changed, 11 insertions, 0 deletions
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