On Mon, Aug 5, 2013 at 7:34 AM, Kornel Benko <kor...@lyx.org> wrote: > Am Montag, 5. August 2013 um 07:07:58, schrieb Scott Kostyshak > <skost...@lyx.org> > >> On Mon, Aug 5, 2013 at 6:02 AM, Vincent van Ravesteijn <v...@lyx.org> >> wrote: > > [snip] > >> > As far as I see it, it cannot happen that there is no >> > default_output_format. > >> > >> > Only if there are lyx files with an old file format. In that case: > >> > > >> > - a) we should update all lyx docs to the latest format anyway; > >> > - b) we can just check for the fileformat to see whether it has the >> > latest > >> > format; > >> > - c) we can assume "default" when there is no "default_output_format". > >> > >> The attached patch implements c): If no 'default_output_format' is > >> found, then we assume 'default'. > >> > >> Is it OK? > > > > I would use a extra list-variable for this. > > set(out_formats "xhtml" "pdf" "pdf2" "pdf5") > > set(${varname} ${out_formats}) > > > > and reuse it > > if(CMAKE_MATCH_1 STREQUAL "default") > > set(found ${out_formats})
Thank you. Attached is the new patch. Scott
From 7e9acd98a6169037b8e8e87a07c051ef72b9768e Mon Sep 17 00:00:00 2001 From: Scott Kostyshak <skost...@lyx.org> Date: Mon, 5 Aug 2013 06:47:02 -0400 Subject: [PATCH] tests: 'default' 'default_output_format' if none When deciding which output formats to test, if we do not find a 'default_output_format' we assume it is set to 'default'. This should not happen anyway if all .lyx files are updated. For discussion, see: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg180536.html --- development/autotests/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/development/autotests/CMakeLists.txt b/development/autotests/CMakeLists.txt index e4720f4..ecb49b5 100644 --- a/development/autotests/CMakeLists.txt +++ b/development/autotests/CMakeLists.txt @@ -99,11 +99,12 @@ endif() macro(getoutputformats filepath varname) file(STRINGS "${filepath}" lines) - set(${varname} "pdf") # try at least this one + set(out_formats "xhtml" "pdf" "pdf2" "pdf5") + set(${varname} ${out_formats}) foreach(_l ${lines}) if(_l MATCHES "^\\\\default_output_format +\([^ ]+\)") if(CMAKE_MATCH_1 STREQUAL "default") - set(found "xhtml" "pdf" "pdf2" "pdf5") + set(found ${out_formats}) elseif(CMAKE_MATCH_1 STREQUAL "xhtml") set(found "xhtml") else() -- 1.8.1.2