Simplify CMakeFile.txt 56/200656/1
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 27 Feb 2019 12:13:48 +0000 (13:13 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 27 Feb 2019 12:42:07 +0000 (13:42 +0100)
Change-Id: I1d07b518a88c057c726f5a110a53620e3941741e

tests/system/CMakeLists.txt

index 9e1b977..fbe4129 100644 (file)
@@ -4,25 +4,24 @@ ADD_SUBDIRECTORY(utils)
 
 set_property(GLOBAL PROPERTY TMP_TESTS_LIST "")
 
+macro(CONFIGURE_TEST_FILE dir_name file_name)
+  configure_file("${dir_name}/${file_name}.sh.template" "${dir_name}/${file_name}.sh" @ONLY)
+  INSTALL(DIRECTORY ${dir_name}/ DESTINATION ${CRASH_SYSTEM_TESTS_PATH}/${dir_name} FILES_MATCHING PATTERN "*sh")
+endmacro()
+
 macro(CONFIGURE_TEST test_name)
   set_property(GLOBAL APPEND_STRING PROPERTY TMP_TESTS_LIST "\"${test_name}\" ")
 
-  set(file_name ${test_name})
-  set(extra_args ${ARGN})
-
-  list(LENGTH extra_args extra_args_count)
-  if (${extra_args_count} GREATER 0)
-    list(GET extra_args 0 optional_arg)
-    set(file_name ${optional_arg})
-  endif()
+  set(FILES_LIST ${test_name})
+  list(APPEND FILES_LIST ${ARGN})
 
-  configure_file("${test_name}/${file_name}.sh.template" "${test_name}/${file_name}.sh" @ONLY)
-  INSTALL(DIRECTORY ${test_name}/ DESTINATION ${CRASH_SYSTEM_TESTS_PATH}/${test_name} FILES_MATCHING PATTERN "*sh")
+  foreach(test ${FILES_LIST})
+    configure_test_file(${test_name} ${test})
+  endforeach()
 endmacro()
 
 configure_test("check_minicore_mem")
 configure_test("time_test")
-configure_test("cmp_backtraces")
 configure_test("cmp_backtraces" "cp")
 configure_test("critical_process")
 configure_test("wait_for_opt_usr")