summaryrefslogtreecommitdiffstats
path: root/test cases/windows/15 resource scripts with duplicate filenames
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/windows/15 resource scripts with duplicate filenames')
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/a/meson.build1
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc1
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/b/meson.build2
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc1
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/c/meson.build2
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc1
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe3/meson.build5
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c10
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/version.rc11
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c3
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/version.rc11
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe4/meson.build5
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c10
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/version.rc11
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c3
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/version.rc11
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/meson.build21
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc1
-rw-r--r--test cases/windows/15 resource scripts with duplicate filenames/verify.c25
19 files changed, 135 insertions, 0 deletions
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/a/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/a/meson.build
new file mode 100644
index 0000000..73f18c8
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/a/meson.build
@@ -0,0 +1 @@
+a = win.compile_resources('rsrc.rc')
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc
new file mode 100644
index 0000000..1997b8e
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc
@@ -0,0 +1 @@
+a RCDATA { "a" }
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/b/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/b/meson.build
new file mode 100644
index 0000000..d0b0aab
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/b/meson.build
@@ -0,0 +1,2 @@
+bf = files('rsrc.rc')
+b = win.compile_resources(bf)
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc
new file mode 100644
index 0000000..a8e3b27
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc
@@ -0,0 +1 @@
+b RCDATA { "b" }
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/c/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/c/meson.build
new file mode 100644
index 0000000..a7b7e30
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/c/meson.build
@@ -0,0 +1,2 @@
+cf = files('rsrc.rc')
+c = win.compile_resources(cf)
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc
new file mode 100644
index 0000000..1fa2c1c
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc
@@ -0,0 +1 @@
+c RCDATA { "c" }
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe3/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/exe3/meson.build
new file mode 100644
index 0000000..1b97435
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe3/meson.build
@@ -0,0 +1,5 @@
+dll_res = win.compile_resources('src_dll/version.rc')
+shared_library('lib3', 'src_dll/main.c', dll_res)
+
+exe_res = win.compile_resources('src_exe/version.rc')
+executable('exe3', 'src_exe/main.c', exe_res)
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c
new file mode 100644
index 0000000..2bd8cd2
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c
@@ -0,0 +1,10 @@
+#include <windows.h>
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ // avoid unused argument error while matching template
+ ((void)hinstDLL);
+ ((void)fdwReason);
+ ((void)lpvReserved);
+ return TRUE;
+}
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/version.rc b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/version.rc
new file mode 100644
index 0000000..abdbaaa
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/version.rc
@@ -0,0 +1,11 @@
+ #include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+BEGIN
+END
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c
new file mode 100644
index 0000000..9b6bdc2
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c
@@ -0,0 +1,3 @@
+int main(void) {
+ return 0;
+}
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/version.rc b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/version.rc
new file mode 100644
index 0000000..abdbaaa
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/version.rc
@@ -0,0 +1,11 @@
+ #include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+BEGIN
+END
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe4/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/exe4/meson.build
new file mode 100644
index 0000000..2ae3a71
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe4/meson.build
@@ -0,0 +1,5 @@
+dll_res = win.compile_resources(files('src_dll/version.rc'))
+shared_library('lib4', 'src_dll/main.c', dll_res)
+
+exe_res = win.compile_resources(files('src_exe/version.rc'))
+executable('exe4', 'src_exe/main.c', exe_res)
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c
new file mode 100644
index 0000000..2bd8cd2
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c
@@ -0,0 +1,10 @@
+#include <windows.h>
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ // avoid unused argument error while matching template
+ ((void)hinstDLL);
+ ((void)fdwReason);
+ ((void)lpvReserved);
+ return TRUE;
+}
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/version.rc b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/version.rc
new file mode 100644
index 0000000..abdbaaa
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/version.rc
@@ -0,0 +1,11 @@
+ #include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+BEGIN
+END
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c
new file mode 100644
index 0000000..9b6bdc2
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c
@@ -0,0 +1,3 @@
+int main(void) {
+ return 0;
+}
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/version.rc b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/version.rc
new file mode 100644
index 0000000..abdbaaa
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/version.rc
@@ -0,0 +1,11 @@
+ #include <windows.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+BEGIN
+END
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/meson.build
new file mode 100644
index 0000000..9fa3525
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/meson.build
@@ -0,0 +1,21 @@
+project('foobar', 'c')
+
+win = import('windows')
+
+subdir('a')
+subdir('b')
+subdir('c')
+subdir('exe3')
+subdir('exe4')
+
+main = win.compile_resources('rsrc.rc')
+
+testa = executable('testa', 'verify.c', a)
+testb = executable('testb', 'verify.c', b)
+testc = executable('testc', 'verify.c', c)
+testmain = executable('testmain', 'verify.c', main)
+
+test('a', testa, args: 'a')
+test('b', testb, args: 'b')
+test('c', testc, args: 'c')
+test('main', testmain, args: 'main')
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc
new file mode 100644
index 0000000..8f6aa1f
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc
@@ -0,0 +1 @@
+main RCDATA { "main" }
diff --git a/test cases/windows/15 resource scripts with duplicate filenames/verify.c b/test cases/windows/15 resource scripts with duplicate filenames/verify.c
new file mode 100644
index 0000000..8f5b88e
--- /dev/null
+++ b/test cases/windows/15 resource scripts with duplicate filenames/verify.c
@@ -0,0 +1,25 @@
+#include <assert.h>
+#include <windows.h>
+
+int main(int argc, char *argv[])
+{
+ // verify that the expected resource exists and has the expected contents
+ HRSRC hRsrc;
+ unsigned int size;
+ HGLOBAL hGlobal;
+ void* data;
+
+ ((void)argc);
+
+ hRsrc = FindResource(NULL, argv[1], RT_RCDATA);
+ assert(hRsrc);
+
+ size = SizeofResource(NULL, hRsrc);
+ hGlobal = LoadResource(NULL, hRsrc);
+ data = LockResource(hGlobal);
+
+ assert(size == strlen(argv[1]));
+ assert(memcmp(data, argv[1], size) == 0);
+
+ return 0;
+}