# This file is licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # Tests for LLVM libc unistd.h functions. load("//libc/test:libc_test_rules.bzl", "libc_test") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) libc_test( name = "access_test", srcs = ["access_test.cpp"], deps = [ "//libc:access", "//libc:close", "//libc:open", "//libc:unlink", ], ) libc_test( name = "dup_test", srcs = ["dup_test.cpp"], deps = [ "//libc:close", "//libc:dup", "//libc:open", "//libc:read", "//libc:unlink", "//libc:write", ], ) libc_test( name = "dup2_test", srcs = ["dup2_test.cpp"], deps = [ "//libc:close", "//libc:dup2", "//libc:open", "//libc:read", "//libc:unlink", "//libc:write", ], ) libc_test( name = "dup3_test", srcs = ["dup3_test.cpp"], deps = [ "//libc:close", "//libc:dup3", "//libc:open", "//libc:read", "//libc:unlink", "//libc:write", ], ) libc_test( name = "ftruncate_test", srcs = ["ftruncate_test.cpp"], deps = [ "//libc:__support_cpp_string_view", "//libc:close", "//libc:ftruncate", "//libc:open", "//libc:read", "//libc:unlink", "//libc:write", ], ) libc_test( name = "pread_pwrite_test", srcs = ["pread_pwrite_test.cpp"], deps = [ "//libc:close", "//libc:fsync", "//libc:open", "//libc:pread", "//libc:pwrite", "//libc:unlink", "//libc:write", ], ) libc_test( name = "read_write_test", srcs = ["read_write_test.cpp"], deps = [ "//libc:close", "//libc:fsync", "//libc:open", "//libc:read", "//libc:remove", "//libc:write", ], ) libc_test( name = "link_test", srcs = ["link_test.cpp"], deps = [ "//libc:close", "//libc:link", "//libc:open", "//libc:unlink", ], ) libc_test( name = "swab_test", srcs = ["swab_test.cpp"], deps = [ "//libc:string_utils", "//libc:swab", ], ) libc_test( name = "symlink_test", srcs = ["symlink_test.cpp"], deps = [ "//libc:close", "//libc:open", "//libc:symlink", "//libc:unlink", ], ) libc_test( name = "truncate_test", srcs = ["truncate_test.cpp"], deps = [ "//libc:__support_cpp_string_view", "//libc:close", "//libc:open", "//libc:read", "//libc:truncate", "//libc:unlink", "//libc:write", ], ) libc_test( name = "unlink_test", srcs = ["unlink_test.cpp"], deps = [ "//libc:close", "//libc:open", "//libc:unlink", ], ) libc_test( name = "getppid_test", srcs = ["getppid_test.cpp"], deps = [ "//libc:getppid", ], ) libc_test( name = "getuid_test", srcs = ["getuid_test.cpp"], deps = [ "//libc:getuid", ], ) libc_test( name = "isatty_test", srcs = ["isatty_test.cpp"], deps = [ "//libc:close", "//libc:isatty", "//libc:open", ], ) libc_test( name = "geteuid_test", srcs = ["geteuid_test.cpp"], deps = [ "//libc:geteuid", ], ) # TODO: add rules for functions modifying directories. #TODO: Enable once fullbuild is added to bazel, since this depends on a macro # definition in the public header # libc_test( # name = "syscall_test", # srcs = ["syscall_test.cpp"], # deps = [ # "//libc:syscall", # ], # ) # TODO: add once sysconf is complete # libc_test( # name = "sysconf_test", # srcs = ["sysconf_test.cpp"], # deps = [ # "//libc:sysconf", # ], # ) # TODO: add fopencookie and fflush # libc_test( # name = "getopt_test", # srcs = ["getopt_test.cpp"], # deps = [ # "//libc:__support_cpp_array", # "//libc:getopt", # "//libc:fopencookie", # "//libc:fflush", # ], # )