summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2016-07-21 19:26:12 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-08-09 13:33:29 +0000
commit3011a704d9ff8ddd052165150a5cd91166fad69d (patch)
tree2791fd2ccd3865c19acff94935ce3dcc57604369
parent5cb52cf97d04859c0c730cf03430254041d6388b (diff)
officeotron usage in export tests without external dependencies
officeotron is a OOXML documents validator which can be used for verification of export files in tests. Previously it was possible to use it only from external repository with extra build steps. Change-Id: Iae6ec3695fdfaf738d180405047ff04b2024c906 Reviewed-on: https://gerrit.libreoffice.org/27388 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--.gitignore1
-rw-r--r--Makefile.fetch1
-rw-r--r--bin/officeotron.sh.in2
-rw-r--r--configure.ac55
-rw-r--r--download.lst1
5 files changed, 37 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index de258c9e43e1..aac380dda2c1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,6 +57,7 @@
/lo.xcent
/bin/bffvalidator.sh
/bin/odfvalidator.sh
+/bin/officeotron.sh
/Makefile
/NEWS
/TODO
diff --git a/Makefile.fetch b/Makefile.fetch
index f69521952c6c..bd96f123fdc3 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -216,6 +216,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
$(call fetch_Optional,DBGHELP,DBGHELP_DLL) \
$(call fetch_Optional,ODK,UNOWINREG_DLL) \
$(call fetch_Optional,ODFVALIDATOR,ODFVALIDATOR_JAR) \
+ $(call fetch_Optional,OFFICEOTRON,OFFICEOTRON_JAR) \
,$(call fetch_Download_item,http://dev-www.libreoffice.org/extern,$(item)))
$(foreach item, \
$(call fetch_Optional_pack,BARCODE_EXTENSION_PACK) \
diff --git a/bin/officeotron.sh.in b/bin/officeotron.sh.in
new file mode 100644
index 000000000000..7281f1bcd17c
--- /dev/null
+++ b/bin/officeotron.sh.in
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+java -jar @TARFILE_LOCATION@/@OFFICEOTRON_JAR@ "$@"
diff --git a/configure.ac b/configure.ac
index 8346458d0629..5759408774e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2756,39 +2756,46 @@ if test "$with_export_validation" = yes; then
if test -z "$ODFVALIDATOR_JAR"; then
AC_MSG_ERROR([odfvalidator jar location is not determined (--with-export-validation)])
fi
-
- if test "$build_os" = "cygwin"; then
- # In case of CygWin it will be executed from Windows,
- # so we need to run bash and absolute path to validator
- # so instead of "odfvalidator" it will be
- # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
- ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
- fi
fi
- AC_SUBST(ODFVALIDATOR)
-
if test "$build_os" = "cygwin"; then
# In case of CygWin it will be executed from Windows,
# so we need to run bash and absolute path to validator
- # so instead of "officeotron" it will be
- # something like "bash.exe C:\cygwin\opt\lo\bin\officeotron"
- AC_PATH_PROGS(OFFICEOTRON, officeotron)
- if test -z "$OFFICEOTRON"; then
- AC_MSG_ERROR([officeotron not found, but required by --with-export-validation])
+ # so instead of "odfvalidator" it will be
+ # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
+ ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
+ fi
+ AC_SUBST(ODFVALIDATOR)
+
+
+ AC_PATH_PROGS(OFFICEOTRON, officeotron)
+ if test -z "$OFFICEOTRON"; then
+ # remember to download the officeotron with validator later
+ AC_MSG_NOTICE([no officeotron found, will download it])
+ BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
+ OFFICEOTRON="bin/officeotron.sh"
+
+ # and fetch name of officeotron jar name from download.lst
+ OFFICEOTRON_JAR=`sed -ne "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" download.lst`
+ AC_SUBST(OFFICEOTRON_JAR)
+
+ if test -z "$OFFICEOTRON_JAR"; then
+ AC_MSG_ERROR([officeotron jar location is not determined (--with-export-validation)])
fi
- OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
else
- AC_CHECK_PROGS(OFFICEOTRON, officeotron)
- if test -z "$OFFICEOTRON"; then
- AC_MSG_ERROR([officeotron not found, but required by --with-export-validation])
+ # check version of existing officeotron
+ OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
+ if test 0"$OFFICEOTRON_VER" -lt 704; then
+ AC_MSG_ERROR([officeotron too old])
fi
fi
- OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
- if test 0"$OFFICEOTRON_VER" -lt 704; then
- AC_MSG_ERROR([officeotron too old])
+ if test "$build_os" = "cygwin"; then
+ # In case of CygWin it will be executed from Windows,
+ # so we need to run bash and absolute path to validator
+ # so instead of "odfvalidator" it will be
+ # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
+ OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
fi
AC_SUBST(OFFICEOTRON)
-
else
AC_MSG_RESULT([no])
fi
@@ -4677,6 +4684,7 @@ if test "$cross_compiling" = "yes"; then
lo.xcent.in \
bin/bffvalidator.sh.in \
bin/odfvalidator.sh.in \
+ bin/officeotron.sh.in \
instsetoo_native/util/openoffice.lst.in \
config_host/*.in \
sysui/desktop/macosx/Info.plist.in \
@@ -13018,6 +13026,7 @@ AC_CONFIG_FILES([config_host.mk
lo.xcent
bin/bffvalidator.sh
bin/odfvalidator.sh
+ bin/officeotron.sh
instsetoo_native/util/openoffice.lst
sysui/desktop/macosx/Info.plist
ios/lo.xcconfig])
diff --git a/download.lst b/download.lst
index 6f716d0f21aa..457f08d94daa 100644
--- a/download.lst
+++ b/download.lst
@@ -115,6 +115,7 @@ export ODFGEN_MD5SUM := 32572ea48d9021bbd6fa317ddb697abc
export ODFGEN_VERSION_MICRO := 6
export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.bz2
export ODFVALIDATOR_JAR := e7f181c1d969dbd553644b191cb0a6d3-odfvalidator-1.1.8-incubating-SNAPSHOT-jar-with-dependencies.jar
+export OFFICEOTRON_JAR := c038af04c1431525e3fdee57d32b865e-officeotron-0.7.4-master.jar
export OPENCOLLADA_MD5SUM := 4ca8a6ef0afeefc864e9ef21b9f14bd6
export OPENCOLLADA_TARBALL := OpenCOLLADA-master-6509aa13af.tar.bz2
export OPENLDAP_TARBALL := 804c6cb5698db30b75ad0ff1c25baefd-openldap-2.4.31.tgz