[master] cf20474 - CMake: Simplify adding test programs for developers

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] cf20474 - CMake: Simplify adding test programs for developers "Albrecht Schlosser" 10:17 Oct 06 top right image
 
commit cf20474d7c13aeeb59f0248e86a26143c500b47c
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Wed Oct 6 18:17:55 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Wed Oct 6 18:17:55 2021 +0200

    CMake: Simplify adding test programs for developers
    
    The intention is to make it more convenient for developers to add
    one or more test programs for their tests by editing only one
    variable (extra_tests).

 test/CMakeLists.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git test/CMakeLists.txt test/CMakeLists.txt
index 33df73a..160efe2 100644
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -47,6 +47,15 @@ include_directories(
 )
 
 #######################################################################
+# Define additional example programs for testing, for instance:
+#   set (extra_tests issue-276 str-1895)
+# Use the source file test/'name'.cxx for each additional program.
+# These test programs will be built with image and GL libraries.
+# Leave the variable 'extra_tests' empty to disable extra test programs.
+
+set (extra_tests)
+
+#######################################################################
 # Add the ANDROID_OK option if the example can be compiled for Android
 # as well as for other platforms.
 
@@ -134,6 +143,15 @@ CREATE_EXAMPLE (valuators valuators.fl fltk)
 CREATE_EXAMPLE (unittests unittests.cxx fltk)
 CREATE_EXAMPLE (windowfocus windowfocus.cxx fltk)
 
+# create additional test programs (used by developers for testing)
+if (extra_tests)
+  # message ("")
+  foreach (name ${extra_tests})
+    # message (STATUS "Will build additional test program ${name}")
+    create_example (${name} ${name}.cxx "fltk_images;fltk_gl;fltk")
+  endforeach ()
+endif ()
+
 # OpenGL demos...
 if (OPENGL_FOUND)
   CREATE_EXAMPLE (CubeView "CubeMain.cxx;CubeView.cxx;CubeViewUI.fl" "fltk_gl;fltk")
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.