Cmake docbook tests: Add jing.jar to test created docbook files

Usefull only if tested with data from repository.
This means: The file 'jing.jar' is not part of the distribution.
This commit is contained in:
Kornel Benko 2020-10-10 12:43:17 +02:00
parent 384aa5916d
commit 667c0647a5
3 changed files with 19 additions and 0 deletions

View File

@ -28,6 +28,13 @@
find_package(Perl) find_package(Perl)
find_program(XMLLINT_EXECUTABLE xmllint) find_program(XMLLINT_EXECUTABLE xmllint)
find_program(JAVA_EXECUTABLE java)
set(jingjava)
if (JAVA_EXECUTABLE)
if (EXISTS "${TOP_SRC_DIR}/development/tools/jing.jar")
set(jingjava ${JAVA_EXECUTABLE})
endif()
endif()
if(PERL_FOUND) if(PERL_FOUND)
set(DVI_FORMATS "dvi" "dvi3") set(DVI_FORMATS "dvi" "dvi3")
@ -475,6 +482,7 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates lib/ta
"-DIgnoreErrorMessage=${missingLabels}" "-DIgnoreErrorMessage=${missingLabels}"
-DPERL_EXECUTABLE=${PERL_EXECUTABLE} -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
-DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE} -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
-DJAVA_EXECUTABLE=${jingjava}
-DENCODING=${_enc2} -DENCODING=${_enc2}
-P "${TOP_SRC_DIR}/development/autotests/export.cmake") -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
setmarkedtestlabel(${TestName} ${mytestlabel}) # check for suspended pdf/dvi exports setmarkedtestlabel(${TestName} ${mytestlabel}) # check for suspended pdf/dvi exports

View File

@ -27,6 +27,7 @@
# -DIgnoreErrorMessage=(ON/OFF) \ # -DIgnoreErrorMessage=(ON/OFF) \
# -DPERL_EXECUTABLE=${PERL_EXECUTABLE} \ # -DPERL_EXECUTABLE=${PERL_EXECUTABLE} \
# -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE} \ # -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE} \
# -DJAVA_EXECUTABLE=${JAVA_EXECUTABLE} \
# -DENCODING=xxx \ # -DENCODING=xxx \
# -P "${TOP_SRC_DIR}/development/autotests/export.cmake" # -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
# #
@ -279,6 +280,16 @@ else()
endif() endif()
endif() endif()
endif() endif()
if (NOT _err AND JAVA_EXECUTABLE)
# check with jing
message(STATUS "Calling: ${JAVA_EXECUTABLE} -jar \"${TOP_SRC_DIR}/development/tools/jing.jar\" https://docbook.org/xml/5.0.1/rng/docbook.rng \"${WORKDIR}/${result_file_name}\"")
execute_process(
COMMAND ${JAVA_EXECUTABLE} -jar "${TOP_SRC_DIR}/development/tools/jing.jar" "https://docbook.org/xml/5.2b09/rng/docbook.rng" "${WORKDIR}/${result_file_name}"
OUTPUT_VARIABLE jingout
RESULT_VARIABLE _err)
message(STATUS "_err = ${_err}, jingout = ${jingout}")
Summary(_err "CHecking for empty output of ${JAVA_EXECUTABLE} -jar \"${TOP_SRC_DIR}/development/tools/jing.jar\"")
endif()
endif() endif()
endif() endif()
endif() endif()

BIN
development/tools/jing.jar Normal file

Binary file not shown.