summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2020-01-07 11:09:40 -0800
committerSiva Chandra Reddy <sivachandra@google.com>2020-01-07 23:04:52 -0800
commit880734aebb396891d8e6596ae85d597ca43359b1 (patch)
treee73943473fa60e446e9713fa63aa888019de3ea9 /libc
parent44f78f368c2cafd9dfce5d65f5e2ebfcfb30105a (diff)
downloadbcm5719-llvm-880734aebb396891d8e6596ae85d597ca43359b1.tar.gz
bcm5719-llvm-880734aebb396891d8e6596ae85d597ca43359b1.zip
[libc] Add a convenience CMake rule to add testsuites.
Summary: This rule helps avoid repeated setting of check-libc's dependency on the various testsuites. Reviewers: abrachet Subscribers: mgorny, MaskRay, tschuett, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D72353
Diffstat (limited to 'libc')
-rw-r--r--libc/cmake/modules/LLVMLibCRules.cmake5
-rw-r--r--libc/test/CMakeLists.txt2
-rw-r--r--libc/test/config/CMakeLists.txt2
-rw-r--r--libc/test/config/linux/CMakeLists.txt5
-rw-r--r--libc/test/config/linux/x86_64/CMakeLists.txt5
-rw-r--r--libc/test/src/errno/CMakeLists.txt3
-rw-r--r--libc/test/src/string/CMakeLists.txt3
-rw-r--r--libc/test/src/sys/mman/CMakeLists.txt3
8 files changed, 13 insertions, 15 deletions
diff --git a/libc/cmake/modules/LLVMLibCRules.cmake b/libc/cmake/modules/LLVMLibCRules.cmake
index ae186c59bde..c7aac7a9296 100644
--- a/libc/cmake/modules/LLVMLibCRules.cmake
+++ b/libc/cmake/modules/LLVMLibCRules.cmake
@@ -371,3 +371,8 @@ function(add_libc_unittest target_name)
)
endif()
endfunction(add_libc_unittest)
+
+function(add_libc_testsuite suite_name)
+ add_custom_target(${suite_name})
+ add_dependencies(check-libc ${suite_name})
+endfunction(add_libc_testsuite)
diff --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt
index fa7f29e1d2a..8f5f0bb6d7e 100644
--- a/libc/test/CMakeLists.txt
+++ b/libc/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_custom_target(check_libc)
+add_custom_target(check-libc)
add_subdirectory(config)
add_subdirectory(src)
diff --git a/libc/test/config/CMakeLists.txt b/libc/test/config/CMakeLists.txt
index a1034f99547..52824d27058 100644
--- a/libc/test/config/CMakeLists.txt
+++ b/libc/test/config/CMakeLists.txt
@@ -1 +1 @@
-add_subdirectory(linux)
+add_subdirectory(${LIBC_TARGET_OS})
diff --git a/libc/test/config/linux/CMakeLists.txt b/libc/test/config/linux/CMakeLists.txt
index 5a20f90881f..7dc887c8c2a 100644
--- a/libc/test/config/linux/CMakeLists.txt
+++ b/libc/test/config/linux/CMakeLists.txt
@@ -1,4 +1,3 @@
-add_custom_target(libc_linux_tests)
-add_dependencies(check_libc libc_linux_tests)
+add_libc_testsuite(libc_linux_tests)
-add_subdirectory(x86_64)
+add_subdirectory(${LIBC_TARGET_MACHINE})
diff --git a/libc/test/config/linux/x86_64/CMakeLists.txt b/libc/test/config/linux/x86_64/CMakeLists.txt
index 370073cd1cf..9f9d21251c6 100644
--- a/libc/test/config/linux/x86_64/CMakeLists.txt
+++ b/libc/test/config/linux/x86_64/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_custom_target(libc_linux_x86_64_tests)
-add_dependencies(libc_linux_tests libc_linux_x86_64_tests)
-
add_libc_unittest(
libc_linux_x86_64_syscall_unittest
- SUITE libc_linux_x86_64_tests
+ SUITE libc_linux_tests
SRCS syscall_test.cpp
DEPENDS
syscall_impl_h
diff --git a/libc/test/src/errno/CMakeLists.txt b/libc/test/src/errno/CMakeLists.txt
index 6c21da5701b..1e361790e20 100644
--- a/libc/test/src/errno/CMakeLists.txt
+++ b/libc/test/src/errno/CMakeLists.txt
@@ -1,5 +1,4 @@
-add_custom_target(libc_errno_unittests)
-add_dependencies(check_libc libc_errno_unittests)
+add_libc_testsuite(libc_errno_unittests)
add_libc_unittest(
errno_test
diff --git a/libc/test/src/string/CMakeLists.txt b/libc/test/src/string/CMakeLists.txt
index bc5c088d169..152bcbbc2ae 100644
--- a/libc/test/src/string/CMakeLists.txt
+++ b/libc/test/src/string/CMakeLists.txt
@@ -1,5 +1,4 @@
-add_custom_target(libc_string_unittests)
-add_dependencies(check_libc libc_string_unittests)
+add_libc_testsuite(libc_string_unittests)
add_libc_unittest(
strcat_test
diff --git a/libc/test/src/sys/mman/CMakeLists.txt b/libc/test/src/sys/mman/CMakeLists.txt
index 3e153eb1134..b2f378387a6 100644
--- a/libc/test/src/sys/mman/CMakeLists.txt
+++ b/libc/test/src/sys/mman/CMakeLists.txt
@@ -1,5 +1,4 @@
-add_custom_target(libc_sys_mman_unittests)
-add_dependencies(check_libc libc_sys_mman_unittests)
+add_libc_testsuite(libc_sys_mman_unittests)
add_libc_unittest(
mmap_test
OpenPOWER on IntegriCloud