]> granicus.if.org Git - openjpeg/commitdiff
[trunk] simplify code using for loop
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Thu, 27 Feb 2014 08:38:55 +0000 (08:38 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Thu, 27 Feb 2014 08:38:55 +0000 (08:38 +0000)
tests/unit/CMakeLists.txt

index a22d00a14d1de3779ac5f9dd6f18401e7509cf60..ae47b88e5ab26da053d05449cf73bba5028e15cb 100644 (file)
@@ -5,14 +5,13 @@ include_directories(
   ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
 )
 
-add_executable(testempty0 testempty0.c)
-add_executable(testempty1 testempty1.c)
-add_executable(testempty2 testempty2.c)
-
-target_link_libraries(testempty0 openjp2)
-target_link_libraries(testempty1 openjp2)
-target_link_libraries(testempty2 openjp2)
-
-add_test(NAME testempty0 COMMAND testempty0)
-add_test(NAME testempty1 COMMAND testempty1)
-add_test(NAME testempty2 COMMAND testempty2)
+set(unit_test
+  testempty0
+  testempty1
+  testempty2
+)
+foreach(ut ${unit_test})
+  add_executable(${ut} ${ut}.c)
+  target_link_libraries(${ut} openjp2)
+  add_test(NAME ${ut} COMMAND ${ut})
+endforeach()