summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-27 08:38:55 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-02-27 08:38:55 +0000
commita7cc5b6a5d793746772a3bb2e9e12f5e08ad9bc3 (patch)
tree83b3aad236307790a8f3e99bc643c47c7912ac2c
parentac1dfd466205956a2c173e2dbe4b45eb124ed989 (diff)
[trunk] simplify code using for loop
-rw-r--r--tests/unit/CMakeLists.txt21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
index a22d00a1..ae47b88e 100644
--- a/tests/unit/CMakeLists.txt
+++ b/tests/unit/CMakeLists.txt
@@ -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()