blob: f193480c60c2beb1867cef4766980a7a5e145966 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
if(NOT (TARGET libc.src.__support.threads.mutex) OR LIBC_TARGET_ARCHITECTURE_IS_GPU)
# Not all platforms have a mutex implementation. If mutex is unvailable,
# we just skip everything about files. The GPU does not currently support
# files as well.
return()
endif()
add_libc_test(
file_test
SUITE
libc-support-tests
SRCS
file_test.cpp
LINK_LIBRARIES
LibcMemoryHelpers
DEPENDS
libc.include.errno
libc.include.stdio
libc.include.stdlib
libc.src.__support.CPP.new
libc.src.__support.File.file
)
add_libc_test(
platform_file_test
SUITE
libc-support-tests
SRCS
platform_file_test.cpp
DEPENDS
libc.src.__support.File.file
libc.src.__support.File.platform_file
libc.include.stdio
)
set(platform_stream_targets "platform_stdout;platform_stdin;platform_stderr")
foreach(target IN LISTS platform_file_targets)
if(TARGET libc.src.__support.File.${target})
add_libc_test(
${target}_test
HERMETIC_TEST_ONLY
SUITE
libc-support-tests
SRCS
${target}_test.cpp
DEPENDS
libc.src.__support.File.file
libc.src.__support.File.${target}
libc.include.stdio
)
endif()
endforeach()
add_subdirectory(testdata)
|