From 912af4ea2bebda7b6d930aaec92fe73d183b6971 Mon Sep 17 00:00:00 2001 From: Saikari Date: Fri, 6 Feb 2026 10:17:33 +0300 Subject: Move project to `tests/projects/windows/` --- .../projects/windows/test_windows_links/src/foo.c | 8 ++++++++ .../projects/windows/test_windows_links/src/main.c | 24 ++++++++++++++++++++++ .../projects/windows/test_windows_links/xmake.lua | 19 +++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 tests/projects/windows/test_windows_links/src/foo.c create mode 100644 tests/projects/windows/test_windows_links/src/main.c create mode 100644 tests/projects/windows/test_windows_links/xmake.lua (limited to 'tests/projects/windows') diff --git a/tests/projects/windows/test_windows_links/src/foo.c b/tests/projects/windows/test_windows_links/src/foo.c new file mode 100644 index 000000000..b399bc175 --- /dev/null +++ b/tests/projects/windows/test_windows_links/src/foo.c @@ -0,0 +1,8 @@ +#include + +#ifdef _WIN32 +__declspec(dllexport) +#endif +void foo() { + printf("foo called\n"); +} diff --git a/tests/projects/windows/test_windows_links/src/main.c b/tests/projects/windows/test_windows_links/src/main.c new file mode 100644 index 000000000..8f9578202 --- /dev/null +++ b/tests/projects/windows/test_windows_links/src/main.c @@ -0,0 +1,24 @@ +#include +#include +#include + +#ifdef _WIN32 +__declspec(dllimport) void foo(); +#else +void foo(); +#endif + +int main() { + PROCESS_MEMORY_COUNTERS pmc; + printf("Calling GetProcessMemoryInfo...\n"); + if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) { + printf("PageFaultCount: %lu\n", pmc.PageFaultCount); + printf("WorkingSetSize: %lu\n", pmc.WorkingSetSize); + } else { + printf("GetProcessMemoryInfo failed (%lu)\n", GetLastError()); + } + printf("Calling foo...\n"); + foo(); + printf("Done.\n"); + return 0; +} diff --git a/tests/projects/windows/test_windows_links/xmake.lua b/tests/projects/windows/test_windows_links/xmake.lua new file mode 100644 index 000000000..2f01a3c88 --- /dev/null +++ b/tests/projects/windows/test_windows_links/xmake.lua @@ -0,0 +1,19 @@ +add_rules("mode.debug", "mode.release") + +set_policy("run.gui_error_dialogs", false) + +target("foo") + set_kind("shared") + add_files("src/foo.c") + +target("test_mingw_dll") + set_kind("binary") + add_files("src/main.c") + add_deps("foo") + add_syslinks("psapi") + after_build(function (target) + local foo = target:dep("foo") + if foo then + os.tryrm(foo:targetfile()) + end + end) -- cgit v1.3.1