On Mon, Aug 5, 2013 at 5:56 AM, Pavel Sanda <sa...@lyx.org> wrote:
> Scott Kostyshak wrote:
>> > Sorry, I meant "This is also a test for lyx2lyx, isn't it?"
>>
>> My opinion is that we should update those documents. I agree that it
>
> attic is just garbage and it is somewhat absurd that test should fail
> because of some contents in there. Please create proper tests for
> things you want to test and do not impose some future maintenance
> burden like "we should keep stuff in attic up-to-date".

OK. Attached is a patch.

Scott
From 46813b3f83f7fc9c5200e02305370cc9d1fa46b7 Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Mon, 5 Aug 2013 07:53:24 -0400
Subject: [PATCH] CMake tests: do not test 'attic' files

If we want to test something that is in the attic,
we should test it directly.
---
 development/autotests/CMakeLists.txt | 42 +++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/development/autotests/CMakeLists.txt 
b/development/autotests/CMakeLists.txt
index ecb49b5..b680a1d 100644
--- a/development/autotests/CMakeLists.txt
+++ b/development/autotests/CMakeLists.txt
@@ -143,35 +143,37 @@ foreach(libsubfolder doc examples templates)
   endforeach()
   file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/revertedTests" revertedTests)
   foreach(f ${nolang_lyx_files} ${lang_lyx_files})
-    # Strip extension
-    string(REGEX REPLACE "\\.lyx$" "" f ${f})
-    set(TestName "export/${libsubfolder}/${f}_lyx16")
-    getreverted(TestName reverted revertedTests)
-    add_test(NAME ${TestName}
-      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
-      COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
-          -Dlyx=$<TARGET_FILE:${_lyx}>
-          -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
-          -Dformat=lyx16x
-          -Dextension=16.lyx
-          -Dfile=${f}
-          -Dreverted=${reverted}
-          -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
-    getoutputformats("${LIBSUB_SRC_DIR}/${f}.lyx" formatlist)
-    foreach(format ${formatlist})
-      set(TestName "export/${libsubfolder}/${f}_${format}")
+    if(NOT f MATCHES "attic/")
+      # Strip extension
+      string(REGEX REPLACE "\\.lyx$" "" f ${f})
+      set(TestName "export/${libsubfolder}/${f}_lyx16")
       getreverted(TestName reverted revertedTests)
       add_test(NAME ${TestName}
         WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
         COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
             -Dlyx=$<TARGET_FILE:${_lyx}>
             -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
-            -Dformat=${format}
-            -Dextension=${format}
+            -Dformat=lyx16x
+            -Dextension=16.lyx
             -Dfile=${f}
             -Dreverted=${reverted}
             -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
-    endforeach()
+      getoutputformats("${LIBSUB_SRC_DIR}/${f}.lyx" formatlist)
+      foreach(format ${formatlist})
+        set(TestName "export/${libsubfolder}/${f}_${format}")
+        getreverted(TestName reverted revertedTests)
+        add_test(NAME ${TestName}
+          WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
+          COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
+              -Dlyx=$<TARGET_FILE:${_lyx}>
+              -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
+              -Dformat=${format}
+              -Dextension=${format}
+              -Dfile=${f}
+              -Dreverted=${reverted}
+              -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
+      endforeach()
+    endif()
   endforeach()
 endforeach()
 
-- 
1.8.1.2

Reply via email to