llvm/libc/test/src/sched/CMakeLists.txt

add_custom_target(libc_sched_unittests)

add_libc_unittest(
  affinity_test
  SUITE
    libc_sched_unittests
  SRCS
    affinity_test.cpp
  DEPENDS
    libc.include.sched
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
    libc.src.sched.sched_getaffinity
    libc.src.sched.sched_setaffinity
    libc.test.UnitTest.ErrnoSetterMatcher
)

add_libc_unittest(
  yield_test
  SUITE
    libc_sched_unittests
  SRCS
    yield_test.cpp
  DEPENDS
    libc.src.errno.errno
    libc.src.sched.sched_yield
)

add_libc_unittest(
  get_priority_test
  SUITE
    libc_sched_unittests
  SRCS
    get_priority_test.cpp
  DEPENDS
    libc.include.sched
    libc.src.errno.errno
    libc.src.sched.sched_get_priority_min
    libc.src.sched.sched_get_priority_max
)

add_libc_unittest(
  scheduler_test
  SUITE
    libc_sched_unittests
  SRCS
    param_and_scheduler_test.cpp
  DEPENDS
    libc.include.sched
    libc.src.errno.errno
    libc.src.sched.sched_getscheduler
    libc.src.sched.sched_setscheduler
    libc.src.sched.sched_getparam
    libc.src.sched.sched_setparam
    libc.src.sched.sched_get_priority_min
    libc.src.sched.sched_get_priority_max
    libc.src.unistd.getuid
)

add_libc_unittest(
  sched_rr_get_interval_test
  SUITE
    libc_sched_unittests
  SRCS
    sched_rr_get_interval_test.cpp
  DEPENDS
    libc.include.sched
    libc.src.errno.errno
    libc.src.sched.sched_getscheduler
    libc.src.sched.sched_setscheduler
    libc.src.sched.sched_get_priority_min
    libc.src.sched.sched_rr_get_interval
    libc.src.unistd.getuid
)

add_libc_unittest(
  cpu_count_test
  SUITE
    libc_sched_unittests
  SRCS
    cpu_count_test.cpp
  DEPENDS
    libc.include.sched
    libc.include.sys_syscall
    libc.src.__support.OSUtil.osutil
    libc.src.errno.errno
    libc.src.sched.sched_getaffinity
    libc.src.sched.__sched_getcpucount
    libc.test.UnitTest.ErrnoSetterMatcher
)