Skip to content

Commit

Permalink
[libc] Add a convenience CMake rule to add testsuites.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Siva Chandra Reddy committed Jan 8, 2020
1 parent 44f78f3 commit 880734a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
5 changes: 5 additions & 0 deletions libc/cmake/modules/LLVMLibCRules.cmake
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion libc/test/CMakeLists.txt
@@ -1,4 +1,4 @@
add_custom_target(check_libc)
add_custom_target(check-libc)

add_subdirectory(config)
add_subdirectory(src)
2 changes: 1 addition & 1 deletion libc/test/config/CMakeLists.txt
@@ -1 +1 @@
add_subdirectory(linux)
add_subdirectory(${LIBC_TARGET_OS})
5 changes: 2 additions & 3 deletions 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})
5 changes: 1 addition & 4 deletions 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
Expand Down
3 changes: 1 addition & 2 deletions 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
Expand Down
3 changes: 1 addition & 2 deletions 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
Expand Down
3 changes: 1 addition & 2 deletions 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
Expand Down

0 comments on commit 880734a

Please sign in to comment.