summaryrefslogtreecommitdiffstats
path: root/test cases/common/37 has member/meson.build
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test cases/common/37 has member/meson.build21
1 files changed, 21 insertions, 0 deletions
diff --git a/test cases/common/37 has member/meson.build b/test cases/common/37 has member/meson.build
new file mode 100644
index 0000000..4e61956
--- /dev/null
+++ b/test cases/common/37 has member/meson.build
@@ -0,0 +1,21 @@
+project('has member', 'c', 'cpp')
+
+compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')]
+
+foreach cc : compilers
+ if not cc.has_member('struct tm', 'tm_sec', prefix : '#include<time.h>')
+ error('Did not detect member of "struct tm" that exists: "tm_sec"')
+ endif
+
+ if cc.has_member('struct tm', 'tm_nonexistent', prefix : '#include<time.h>')
+ error('Not existing member "tm_nonexistent" found.')
+ endif
+
+ if not cc.has_members('struct tm', 'tm_sec', 'tm_min', prefix : '#include<time.h>')
+ error('Did not detect members of "struct tm" that exist: "tm_sec" "tm_min"')
+ endif
+
+ if cc.has_members('struct tm', 'tm_sec', 'tm_nonexistent2', prefix : '#include<time.h>')
+ error('Not existing member "tm_nonexistent2" found.')
+ endif
+endforeach