[UCRTBASE_WINETEST] Fix and add to build

This commit is contained in:
Timo Kreuzer 2024-10-26 19:45:55 +03:00
parent 5c47607ab2
commit 9ab89bd8fa
6 changed files with 113 additions and 0 deletions

View file

@ -115,6 +115,7 @@ add_subdirectory(spoolss)
add_subdirectory(sti)
add_subdirectory(sxs)
add_subdirectory(twain_32)
add_subdirectory(ucrtbase)
add_subdirectory(urlmon)
add_subdirectory(user32)
add_subdirectory(userenv)

View file

@ -0,0 +1,74 @@
# Hack until we support globally defining _DEBUG
if(DBG)
#add_compile_definitions(_DEBUG)
endif()
# Generate threaddll.dll
spec2def(threaddll.dll threaddll.spec)
add_library(threaddll SHARED
threaddll.c
threaddll.def
)
set_entrypoint(threaddll DllMain 12)
if(MSVC)
target_link_libraries(threaddll runtmchk)
endif()
add_importlibs(threaddll ucrtbase kernel32)
# Hacks to make it work with MSVC IDE / MSBUILD
if(MSVC_IDE)
if(DBG)
set(THREADDLL_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
else()
set(THREADDLL_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
endif()
message(STATUS "threaddll.dll output directory: ${THREADDLL_OUTPUT_DIR}")
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /I${THREADDLL_OUTPUT_DIR}")
endif()
# Hack to replace the old CRT include directory with the UCRT include directory
get_property(INCLUDE_DIRS DIRECTORY . PROPERTY INCLUDE_DIRECTORIES)
list(REMOVE_ITEM INCLUDE_DIRS "${REACTOS_SOURCE_DIR}/sdk/include/crt")
set_property(DIRECTORY . PROPERTY INCLUDE_DIRECTORIES ${INCLUDE_DIRS})
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/ucrt)
add_definitions(
-DUSE_WINE_TODOS
-D_USE_MATH_DEFINES
-DWINETEST_USE_DBGSTR_LONGLONG
-D_finddata64_t=__finddata64_t
)
list(APPEND SOURCE
cpp.c
environ.c
file.c
misc.c
printf.c
scanf.c
string.c
thread.c
testlist.c
ucrtbase_winetest.rc
)
set_source_files_properties(ucrtbase_winetest.rc OBJECT_DEPENDS threaddll)
add_executable(ucrtbase_winetest ${SOURCE})
if(NOT MSVC)
#set_target_properties(ucrtbase_winetest PROPERTIES LINK_FLAGS "-Wl,--major-os-version,6")
target_compile_options(ucrtbase_winetest PRIVATE -Wno-format)
endif()
set_module_type(ucrtbase_winetest win32cui)
target_link_libraries(ucrtbase_winetest wine oldnames ${PSEH_LIB} chkstk)
if(NOT MSVC)
# Add this manually here, so it can link to ucrtbase.dll and vcstartup
target_link_libraries(ucrtbase_winetest -lgcc)
endif()
add_importlibs(ucrtbase_winetest ucrtbase kernel32 ntdll)
add_dependencies(ucrtbase_winetest threaddll)
add_rostests_file(TARGET ucrtbase_winetest)

View file

@ -30,6 +30,11 @@
#include <winbase.h>
#include <winnls.h>
#include "wine/test.h"
#include <corecrt_io.h>
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
static void test_std_stream_buffering(void)
{

View file

@ -0,0 +1,28 @@
/* Automatically generated file; DO NOT EDIT!! */
#define STANDALONE
#include <wine/test.h>
extern void func_cpp(void);
extern void func_environ(void);
extern void func_file(void);
extern void func_misc(void);
extern void func_printf(void);
extern void func_scanf(void);
extern void func_string(void);
extern void func_thread(void);
const struct test winetest_testlist[] =
{
{ "cpp", func_cpp },
{ "environ", func_environ },
{ "file", func_file },
{ "misc", func_misc },
{ "printf", func_printf },
{ "scanf", func_scanf },
{ "string", func_string },
{ "thread", func_thread },
{ 0, 0 }
};

View file

@ -26,6 +26,9 @@
#include "threaddll.h"
typedef void (__cdecl *_beginthread_start_routine_t)(void *);
typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
enum beginthread_method
{
use_beginthread,

View file

@ -0,0 +1,2 @@
threaddll.dll TESTDLL "threaddll.dll"