summaryrefslogtreecommitdiffstats
path: root/SCons/SConfTests.py
diff options
context:
space:
mode:
authorJoseph Brill <48932340+jcbrill@users.noreply.github.com>2023-12-12 15:35:03 (GMT)
committerJoseph Brill <48932340+jcbrill@users.noreply.github.com>2023-12-12 15:35:03 (GMT)
commit5ffe87e43ebd3c607084c745de702ed7ede0b8be (patch)
tree21a2fd6fb276e121b1fce86d471dc083a3b5ae5e /SCons/SConfTests.py
parent72e3a7553372e03d823253e31fdaf2f5c9138f63 (diff)
downloadSCons-5ffe87e43ebd3c607084c745de702ed7ede0b8be.zip
SCons-5ffe87e43ebd3c607084c745de702ed7ede0b8be.tar.gz
SCons-5ffe87e43ebd3c607084c745de702ed7ede0b8be.tar.bz2
Add additional CheckFunc test cases and update change notice for CheckFunc.
Changes: * add additional CheckFunc test cases to SCons/SConfTests.py * add paragraph tags around change notice for CheckFunc funcargs argument in doc/man/scons.xml
Diffstat (limited to 'SCons/SConfTests.py')
-rw-r--r--SCons/SConfTests.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/SCons/SConfTests.py b/SCons/SConfTests.py
index 6e9aa62..08ef25e 100644
--- a/SCons/SConfTests.py
+++ b/SCons/SConfTests.py
@@ -671,12 +671,25 @@ int main(void) {
log_file=self.test.workpath('config.log'))
try:
- # CheckFunc()
+ # look for function using default heading
r = sconf.CheckFunc('strcpy')
assert r, "did not find strcpy"
+ # no default heading, supply dummy signature
r = sconf.CheckFunc('strcpy', '/* header */ char strcpy();')
assert r, "did not find strcpy"
+ # ... supply complete signature, and function args
r = sconf.CheckFunc('strcpy', header='/* header */ char *strcpy(char *dest, char *src);', funcargs='"", ""')
+ # ... supply standard header for prototype, and function args
+ assert r, "did not find strcpy"
+ r = sconf.CheckFunc('strcpy', header='#include <string.h>', funcargs='"", ""')
+ # also try in C++ mode
+ cpp_header = """\
+#ifdef __cplusplus
+extern "C"
+#endif
+char *strcpy(char *dest, char *src);
+"""
+ r = sconf.CheckFunc('strcpy', header=cpp_header, funcargs='"", ""', language="C++")
assert r, "did not find strcpy"
r = sconf.CheckFunc('hopefullynofunction')
assert not r, "unexpectedly found hopefullynofunction"