summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-02-06 10:17:33 +0300
committerSaikari <[email protected]>2026-02-06 10:17:33 +0300
commit912af4ea2bebda7b6d930aaec92fe73d183b6971 (patch)
tree31ab4bcadf271c4e853119a0ff579bed96bbd9b6 /tests
parentb51f3b5f386c18504be698ea9c14953c8b289605 (diff)
Move project to `tests/projects/windows/`
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/windows/test_windows_links/src/foo.c8
-rw-r--r--tests/projects/windows/test_windows_links/src/main.c24
-rw-r--r--tests/projects/windows/test_windows_links/xmake.lua19
3 files changed, 51 insertions, 0 deletions
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 <stdio.h>
+
+#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 <windows.h>
+#include <psapi.h>
+#include <stdio.h>
+
+#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)