summaryrefslogtreecommitdiffstats
path: root/test/Library.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-04-02 05:15:17 (GMT)
committerSteven Knight <knight@baldmt.com>2004-04-02 05:15:17 (GMT)
commita0dce6cc7c4d6323f0fa9fde76d43761d30ee358 (patch)
treee01f6f7a9f49e22157c9d1d6c60c097e61439ef3 /test/Library.py
parente7b9c76212c0330af15c6ae04b1583d8c9b3cb5e (diff)
downloadSCons-a0dce6cc7c4d6323f0fa9fde76d43761d30ee358.zip
SCons-a0dce6cc7c4d6323f0fa9fde76d43761d30ee358.tar.gz
SCons-a0dce6cc7c4d6323f0fa9fde76d43761d30ee358.tar.bz2
Allow environment substitutions when referencing libraries. (Chad Austin)
Diffstat (limited to 'test/Library.py')
-rw-r--r--test/Library.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Library.py b/test/Library.py
index 37641a8..f22172c 100644
--- a/test/Library.py
+++ b/test/Library.py
@@ -126,4 +126,32 @@ test.run(arguments = '.')
test.run(program = test.workpath('prog'),
stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.cpp\nprog.c\n")
+# Tests whether you can reference libraries with substitutions.
+
+test.write('SConstruct', r"""
+# nrd = not referenced directly :)
+Library('nrd', 'nrd.c')
+p = Program('uses-nrd', 'uses-nrd.c', NRD='nrd', LIBPATH=['.'], LIBS=['$NRD'])
+Default(p)
+""")
+
+test.write('nrd.c', r"""
+#include <stdio.h>
+void nrd() {
+ puts("nrd");
+}
+""")
+
+test.write('uses-nrd.c', r"""
+void nrd();
+int main() {
+ nrd();
+ return 0;
+}
+""")
+
+test.run()
+test.run(program = test.workpath('uses-nrd'),
+ stdout = "nrd\n")
+
test.pass_test()