If a .lyx file has no 'default_output_format' property
(that is, not even 'default'), then it is malformed and
the test should fail.

Before this patch, we guess that the correct format to test with is 'pdf'.

Comments?

Scott
From 9ec76ee7f68037f900c458b25fc3510ec8b78e3f Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Thu, 1 Aug 2013 17:50:29 -0400
Subject: [PATCH 1/2] CMake: tests now fail if no default_output_format

If a .lyx file has no 'default_output_format' property
(that is, not even 'default'), then it is malformed and
the test should fail.
---
 development/autotests/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/development/autotests/CMakeLists.txt 
b/development/autotests/CMakeLists.txt
index 1a7f711..2e67dc2 100644
--- a/development/autotests/CMakeLists.txt
+++ b/development/autotests/CMakeLists.txt
@@ -99,7 +99,9 @@ endif()
 
 macro(getoutputformats filepath varname)
   file(STRINGS "${filepath}" lines)
-  set(${varname} "pdf") # try at least this one
+  # If no 'default_output_format' is found, the .lyx file is malformed.
+  # When the test is run, we want LyX to fail because of a non-existent format.
+  set(${varname} "noDefaultProperty")
   foreach(_l ${lines})
     if(_l MATCHES "^\\\\default_output_format +\([^ ]+\)")
       if(CMAKE_MATCH_1 STREQUAL "default")
-- 
1.8.1.2

Reply via email to