| 1 |
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. |
| 2 |
# See https://llvm.org/LICENSE.txt for license information. |
| 3 |
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 |
|
| 5 |
# Tests for LLVM libc stdio.h functions. |
| 6 |
|
| 7 |
load("//libc/test:libc_test_rules.bzl", "libc_test") |
| 8 |
|
| 9 |
package(default_visibility = ["//visibility:public"]) |
| 10 |
|
| 11 |
licenses(["notice"]) |
| 12 |
|
| 13 |
libc_test( |
| 14 |
name = "printf_parser_test", |
| 15 |
srcs = ["printf_core/parser_test.cpp"], |
| 16 |
deps = [ |
| 17 |
"//libc:__support_arg_list", |
| 18 |
"//libc:__support_cpp_bit", |
| 19 |
"//libc:__support_cpp_string_view", |
| 20 |
"//libc:printf_core_structs", |
| 21 |
"//libc:printf_parser", |
| 22 |
"//libc/test/UnitTest:printf_matcher", |
| 23 |
], |
| 24 |
) |
| 25 |
|
| 26 |
libc_test( |
| 27 |
name = "printf_writer_test", |
| 28 |
srcs = ["printf_core/writer_test.cpp"], |
| 29 |
deps = [ |
| 30 |
"//libc:__support_arg_list", |
| 31 |
"//libc:__support_cpp_string_view", |
| 32 |
"//libc:printf_core_structs", |
| 33 |
"//libc:printf_writer", |
| 34 |
"//libc:string_memory_utils", |
| 35 |
], |
| 36 |
) |
| 37 |
|
| 38 |
libc_test( |
| 39 |
name = "printf_converter_test", |
| 40 |
srcs = ["printf_core/converter_test.cpp"], |
| 41 |
deps = [ |
| 42 |
"//libc:__support_arg_list", |
| 43 |
"//libc:__support_cpp_string_view", |
| 44 |
"//libc:printf_converter", |
| 45 |
"//libc:printf_core_structs", |
| 46 |
"//libc:printf_writer", |
| 47 |
], |
| 48 |
) |
| 49 |
|
| 50 |
libc_test( |
| 51 |
name = "sprintf_test", |
| 52 |
srcs = ["sprintf_test.cpp"], |
| 53 |
deps = [ |
| 54 |
"//libc:__support_fputil_fp_bits", |
| 55 |
"//libc:sprintf", |
| 56 |
"//libc/test/UnitTest:fp_test_helpers", |
| 57 |
], |
| 58 |
) |
| 59 |
|
| 60 |
libc_test( |
| 61 |
name = "snprintf_test", |
| 62 |
srcs = ["snprintf_test.cpp"], |
| 63 |
deps = [ |
| 64 |
"//libc:snprintf", |
| 65 |
], |
| 66 |
) |
| 67 |
|
| 68 |
libc_test( |
| 69 |
name = "printf_test", |
| 70 |
srcs = ["printf_test.cpp"], |
| 71 |
deps = [ |
| 72 |
"//libc:printf", |
| 73 |
], |
| 74 |
) |
| 75 |
|
| 76 |
libc_test( |
| 77 |
name = "fprintf_test", |
| 78 |
srcs = ["fprintf_test.cpp"], |
| 79 |
deps = [ |
| 80 |
"//libc:fprintf", |
| 81 |
], |
| 82 |
) |
| 83 |
|
| 84 |
libc_test( |
| 85 |
name = "vsprintf_test", |
| 86 |
srcs = ["vsprintf_test.cpp"], |
| 87 |
deps = [ |
| 88 |
"//libc:vsprintf", |
| 89 |
], |
| 90 |
) |
| 91 |
|
| 92 |
libc_test( |
| 93 |
name = "vsnprintf_test", |
| 94 |
srcs = ["vsnprintf_test.cpp"], |
| 95 |
deps = [ |
| 96 |
"//libc:vsnprintf", |
| 97 |
], |
| 98 |
) |
| 99 |
|
| 100 |
libc_test( |
| 101 |
name = "vprintf_test", |
| 102 |
srcs = ["vprintf_test.cpp"], |
| 103 |
deps = [ |
| 104 |
"//libc:vprintf", |
| 105 |
], |
| 106 |
) |
| 107 |
|
| 108 |
libc_test( |
| 109 |
name = "vfprintf_test", |
| 110 |
srcs = ["vfprintf_test.cpp"], |
| 111 |
deps = [ |
| 112 |
"//libc:vfprintf", |
| 113 |
], |
| 114 |
) |
| 115 |
|
| 116 |
libc_test( |
| 117 |
name = "remove_test", |
| 118 |
srcs = ["remove_test.cpp"], |
| 119 |
deps = [ |
| 120 |
"//libc:access", |
| 121 |
"//libc:close", |
| 122 |
"//libc:mkdirat", |
| 123 |
"//libc:open", |
| 124 |
"//libc:remove", |
| 125 |
"//libc/test/UnitTest:errno_test_helpers", |
| 126 |
], |
| 127 |
) |
| 128 |
|
| 129 |
libc_test( |
| 130 |
name = "sscanf_test", |
| 131 |
srcs = ["sscanf_test.cpp"], |
| 132 |
deps = [ |
| 133 |
"//libc:__support_cpp_limits", |
| 134 |
"//libc:__support_fputil_fp_bits", |
| 135 |
"//libc:hdr_stdio_macros", |
| 136 |
"//libc:sscanf", |
| 137 |
"//libc/test/UnitTest:fp_test_helpers", |
| 138 |
], |
| 139 |
) |
| 140 |
|
| 141 |
libc_test( |
| 142 |
name = "fscanf_test", |
| 143 |
srcs = ["fscanf_test.cpp"], |
| 144 |
deps = [ |
| 145 |
"//libc:__support_cpp_string_view", |
| 146 |
"//libc:fscanf", |
| 147 |
], |
| 148 |
) |
| 149 |
|
| 150 |
libc_test( |
| 151 |
name = "vsscanf_test", |
| 152 |
srcs = ["vsscanf_test.cpp"], |
| 153 |
deps = [ |
| 154 |
"//libc:vsscanf", |
| 155 |
], |
| 156 |
) |
| 157 |
|
| 158 |
libc_test( |
| 159 |
name = "vfscanf_test", |
| 160 |
srcs = ["vfscanf_test.cpp"], |
| 161 |
deps = [ |
| 162 |
"//libc:__support_cpp_string_view", |
| 163 |
"//libc:vfscanf", |
| 164 |
], |
| 165 |
) |