commit 07084d0e761ee801ca143c2570c9037d9f8b0e32
Author: Kornel Benko <[email protected]>
Date: Sat Jul 7 11:25:36 2018 +0200
Cmake tests: Simplify creation of batch tests
---
development/batchtests/CMakeLists.txt | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/development/batchtests/CMakeLists.txt
b/development/batchtests/CMakeLists.txt
index 69b3181..7bf0aea 100644
--- a/development/batchtests/CMakeLists.txt
+++ b/development/batchtests/CMakeLists.txt
@@ -1,10 +1,16 @@
# Checking whether moving beamer slides through the document doesn't break its
structure.
# see also https://www.mail-archive.com/[email protected]/msg203281.html
-add_test(NAME "outline-beamer" COMMAND ${PERL_EXECUTABLE}
${CMAKE_BINARY_DIR}/lyx_batch.pl beamer_test)
-setmarkedtestlabel(outline-beamer "export" "batch")
+set(testlabel "batch")
+string(TOUPPER "${testlabel}_" testprefix)
+
+macro(add_batch_test testname testpar)
+ add_test(NAME "${testprefix}${testname}" COMMAND ${PERL_EXECUTABLE}
${CMAKE_BINARY_DIR}/lyx_batch.pl ${testpar})
+ setmarkedtestlabel(${testprefix}${testname} ${ARGN} "${testlabel}")
+endmacro()
+
+add_batch_test(outline-beamer beamer_test "export")
# Checking that info inset correctly fills up VCS information
# see also bug #10835
-add_test(NAME "vcs-info" COMMAND ${PERL_EXECUTABLE}
${CMAKE_BINARY_DIR}/lyx_batch.pl vcs_info_export)
-setmarkedtestlabel(vcs-info "batch")
-add_test(NAME "AMS-import" COMMAND ${PERL_EXECUTABLE}
${CMAKE_BINARY_DIR}/lyx_batch.pl ams-import)
-setmarkedtestlabel(AMS-import "tex2lyx" "batch")
+add_batch_test(vcs-info vcs_info_export)
+add_batch_test(AMS-import ams-import "tex2lyx")
+