4860cd225a65d82d18db0aa5bb212455ed1d2a6a
[reactos.git] / modules / rostests / apitests / ntdll / CMakeLists.txt
1
2 add_subdirectory(load_notifications)
3
4 include_directories($<TARGET_FILE_DIR:load_notifications>)
5 spec2def(ntdll_apitest.exe ntdll_apitest.spec)
6
7 list(APPEND SOURCE
8 LdrEnumResources.c
9 load_notifications.c
10 NtAcceptConnectPort.c
11 NtAllocateVirtualMemory.c
12 NtApphelpCacheControl.c
13 NtContinue.c
14 NtCreateFile.c
15 NtCreateKey.c
16 NtCreateThread.c
17 NtDeleteKey.c
18 NtFreeVirtualMemory.c
19 NtLoadUnloadKey.c
20 NtMapViewOfSection.c
21 NtMutant.c
22 NtOpenKey.c
23 NtOpenProcessToken.c
24 NtOpenThreadToken.c
25 NtProtectVirtualMemory.c
26 NtQueryInformationFile.c
27 NtQueryInformationProcess.c
28 NtQueryKey.c
29 NtQuerySystemEnvironmentValue.c
30 NtQuerySystemInformation.c
31 NtQueryVolumeInformationFile.c
32 NtReadFile.c
33 NtSaveKey.c
34 NtSetInformationFile.c
35 NtSetValueKey.c
36 NtSetVolumeInformationFile.c
37 NtWriteFile.c
38 RtlAllocateHeap.c
39 RtlBitmap.c
40 RtlCopyMappedMemory.c
41 RtlDeleteAce.c
42 RtlDetermineDosPathNameType.c
43 RtlDoesFileExists.c
44 RtlDosApplyFileIsolationRedirection_Ustr.c
45 RtlDosPathNameToNtPathName_U.c
46 RtlDosSearchPath_U.c
47 RtlDosSearchPath_Ustr.c
48 RtlFirstFreeAce.c
49 RtlGenerate8dot3Name.c
50 RtlGetFullPathName_U.c
51 RtlGetFullPathName_Ustr.c
52 RtlGetFullPathName_UstrEx.c
53 RtlGetLengthWithoutTrailingPathSeperators.c
54 RtlGetLongestNtPathLength.c
55 RtlHandle.c
56 RtlImageRvaToVa.c
57 RtlInitializeBitMap.c
58 RtlIsNameLegalDOS8Dot3.c
59 RtlMemoryStream.c
60 RtlNtPathNameToDosPathName.c
61 RtlpEnsureBufferSize.c
62 RtlQueryTimeZoneInfo.c
63 RtlReAllocateHeap.c
64 RtlUnicodeStringToAnsiString.c
65 RtlUpcaseUnicodeStringToCountedOemString.c
66 StackOverflow.c
67 SystemInfo.c
68 Timer.c
69 precomp.h)
70
71 if(ARCH STREQUAL "i386")
72 add_asm_files(ntdll_apitest_asm i386/NtContinue.S)
73 endif()
74
75 add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/load_notifications/load_notifications.dll)
76 add_executable(ntdll_apitest
77 ${SOURCE}
78 ${ntdll_apitest_asm}
79 testdata.rc
80 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_apitest.def
81 testlist.c)
82 target_link_libraries(ntdll_apitest wine uuid ${PSEH_LIB})
83 set_module_type(ntdll_apitest win32cui)
84 add_importlibs(ntdll_apitest msvcrt advapi32 kernel32 ntdll)
85 add_pch(ntdll_apitest precomp.h SOURCE)
86
87 if(NOT MSVC)
88 set_source_files_properties(RtlGetFullPathName_UstrEx.c PROPERTIES COMPILE_FLAGS "-Wno-format")
89
90 # Avoid "universal character names are only valid in C++ and C99" error.
91 set_property(TARGET ntdll_apitest PROPERTY C_STANDARD 99)
92 endif()
93
94 add_rostests_file(TARGET ntdll_apitest)
95 add_rostests_file(TARGET ntdll_apitest SUBDIR testdata)
96 # These are empty files
97 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata)
98 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata)
99 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata)
100 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata)
101 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/fil1.txt" SUBDIR testdata)
102
103 # Convenience target for running from IDE
104 if(MSVC_IDE)
105 set(NTDLL_APITEST_DATADIR $<TARGET_FILE_DIR:ntdll_apitest>/testdata/)
106 add_custom_command(TARGET ntdll_apitest
107 POST_BUILD
108 COMMAND "${CMAKE_COMMAND}" -E make_directory ${NTDLL_APITEST_DATADIR}
109 COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:ntdll_apitest> ${NTDLL_APITEST_DATADIR}
110 COMMAND "${CMAKE_COMMAND}" -E copy ntdll_apitest.exe.local ${NTDLL_APITEST_DATADIR}
111 COMMAND "${CMAKE_COMMAND}" -E copy shell32.dll ${NTDLL_APITEST_DATADIR}
112 COMMAND "${CMAKE_COMMAND}" -E copy test.dll ${NTDLL_APITEST_DATADIR}
113 COMMAND "${CMAKE_COMMAND}" -E copy ntdlltest.manifest ${NTDLL_APITEST_DATADIR}
114 COMMAND "${CMAKE_COMMAND}" -E copy fil1.txt ${NTDLL_APITEST_DATADIR}
115 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
116 endif()