On Mon, Aug 5, 2013 at 6:02 AM, Vincent van Ravesteijn <v...@lyx.org> wrote: > Op 4-8-2013 22:23, Scott Kostyshak schreef: > >> On Sat, Aug 3, 2013 at 3:54 AM, Scott Kostyshak <skost...@lyx.org> wrote: >>> >>> On Fri, Aug 2, 2013 at 5:58 AM, Vincent van Ravesteijn <v...@lyx.org> >>> wrote: >>>> >>>> On Fri, Aug 2, 2013 at 11:45 AM, Kornel Benko <kor...@lyx.org> wrote: >>>>>> >>>>>> About the patch... why do we care about malformed LyX documents ? How >>>>>> can >>>>>> this happen ? Are there some documents in a very old fileformat. Then >>>>>> we >>>>>> should update those. >>>>> >>>>> >>>>> >>>>> At least now the tests will show it. >>>> >>>> >>>> >>>> If this is a valid argument, we can throw in a thousand of ad-hoc checks >>>> at >>>> random places, ... >>> >>> I don't consider this an ad-hoc check because I don't view it as a >>> test for the LyX documents (although as Kornel points out it might >>> have this extra benefit). I view it as a test of the assumption that >>> the export tests are making. The export tests depend on finding the >>> 'default_output_format' buffer param. For the tests to work correctly, >>> it is assumed that the buffer param exists. This patch tests that >>> assumption. >>> >>> Scott >> >> Vincent, do you have more comments on this? >> >> Scott > > > Well, I still didn't get an answer to my question why it is needed ?
Currently when no default_output_format is found we are assuming a default output format of 'pdf'. I tried to improve things by focusing on the "assuming" part of the previous statement, but I'm fine with improving the 'pdf' part of the assumption, as you suggest below. > 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? Scott
From c5bcacd26dfabb9d14d63efcf64bedc312e47daf 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/autotests/CMakeLists.txt b/development/autotests/CMakeLists.txt index e4720f4..9f6f7de 100644 --- a/development/autotests/CMakeLists.txt +++ b/development/autotests/CMakeLists.txt @@ -99,7 +99,7 @@ endif() macro(getoutputformats filepath varname) file(STRINGS "${filepath}" lines) - set(${varname} "pdf") # try at least this one + set(${varname} "xhtml" "pdf" "pdf2" "pdf5") foreach(_l ${lines}) if(_l MATCHES "^\\\\default_output_format +\([^ ]+\)") if(CMAKE_MATCH_1 STREQUAL "default") -- 1.8.1.2