From 7ecbb0688861e8ea912108b9725aa121d48a6b35 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sun, 16 Mar 2014 09:57:31 +0100 Subject: [PATCH] cmake export tests. Define new policy of what export formats to check. Depending on default_output_format default or unset xhtml, dvi*, pdf* xhtml xhtml any of pfd variants xhtml, pdf* any of dvi variants xhtml, dvi* each other (like eps3) as specified --- development/autotests/CMakeLists.txt | 35 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/development/autotests/CMakeLists.txt b/development/autotests/CMakeLists.txt index 6321c122a0..6c438ca2bb 100644 --- a/development/autotests/CMakeLists.txt +++ b/development/autotests/CMakeLists.txt @@ -103,28 +103,37 @@ endif() find_package(Perl) +if(PERL_FOUND) + set(DVI_FORMATS "dvi" "dvi3") + set(PDF_FORMATS "pdf" "pdf2" "pdf3" "pdf4" "pdf5") +else() + set(DVI_FORMATS "dvi") + set(PDF_FORMATS "pdf" "pdf2" "pdf3") +endif() + macro(getoutputformats filepath varname) file(STRINGS "${filepath}" lines) - set(out_formats "xhtml" "dvi" "dvi3" "pdf" "pdf2" "pdf3" "pdf4" "pdf5") - if(NOT PERL_FOUND) - list(REMOVE_ITEM out_formats "dvi3" "pdf4" "pdf5") - endif() - set(${varname} ${out_formats}) + # What should we test, if default_output_format is not defined? + # For now we test everything ... + set(out_formats "xhtml" ${DVI_FORMATS} ${PDF_FORMATS}) foreach(_l ${lines}) if(_l MATCHES "^\\\\default_output_format +\([^ ]+\)") - if(CMAKE_MATCH_1 STREQUAL "default") - set(found ${out_formats}) - elseif(CMAKE_MATCH_1 STREQUAL "pdf2") - set(found "pdf2" "pdf4" "pdf5") - elseif(CMAKE_MATCH_1 STREQUAL "xhtml") - set(found "xhtml") + set(_format ${CMAKE_MATCH_1}) + if(_format STREQUAL "default") + set(out_formats "xhtml" ${DVI_FORMATS} ${PDF_FORMATS}) + elseif(_format MATCHES "pdf") + set(found "xhtml" ${PDF_FORMATS}) + elseif(_format MATCHES "dvi") + set(out_formats "xhtml" ${DVI_FORMATS}) else() - set(found "xhtml" ${CMAKE_MATCH_1}) + # Respect all other output formats + # like "eps3", "xhtml" + set(out_formats ${_format}) endif() - set(${varname} ${found}) break() endif() endforeach() + set(${varname} ${out_formats}) endmacro() macro(maketestname testname reverted listreverted listignored) -- 2.39.5