Added fix for TeX includes with same name as subdirs.
[scons.git] / test / Object.py
index b5ebcf72887bd0a640178cf5db8e9003d6121e5a..406c2c11839df0927a67742f91584fee5a72640d 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (c) 2001, 2002 Steven Knight
+# __COPYRIGHT__
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -37,18 +37,20 @@ test = TestSCons.TestSCons()
 test.write('SConstruct', """
 env = Environment()
 f1 = env.Object(target = 'f1', source = 'f1.c')
-f2 = env.Object(target = 'f2', source = 'f2.cpp')
+f2 = Object(target = 'f2', source = 'f2.cpp')
 f3 = env.Object(target = 'f3', source = 'f3.c')
-env.Program(target = 'prog1', source = Split('f1%s f2%s f3%s prog.cpp'))
-env.Program(target = 'prog2', source = [f1, f2, f3, 'prog.cpp'])
+mult_o = env.Object(['f4.c', 'f5.c'])
+env.Program(target = 'prog1', source = Split('f1%s f2%s f3%s f4%s prog.cpp'))
+env.Program(target = 'prog2', source = mult_o + [f1, f2, f3, 'prog.cpp'])
 env.Program(target = 'prog3', source = ['f1%s', f2, 'f3%s', 'prog.cpp'])
-""" % (_obj, _obj, _obj, _obj, _obj))
+""" % (_obj, _obj, _obj, _obj, _obj, _obj))
 
 test.write('f1.c', r"""
+#include <stdio.h>
 void
 f1(void)
 {
-       printf("f1.c\n");
+        printf("f1.c\n");
 }
 """)
 
@@ -58,15 +60,34 @@ test.write('f2.cpp', r"""
 void
 f2(void)
 {
-       printf("f2.c\n");
+        printf("f2.c\n");
 }
 """)
 
 test.write('f3.c', r"""
+#include <stdio.h>
 void
 f3(void)
 {
-       printf("f3.c\n");
+        printf("f3.c\n");
+}
+""")
+
+test.write('f4.c', r"""
+#include <stdio.h>
+void
+f4(void)
+{
+        printf("f4.c\n");
+}
+""")
+
+test.write('f5.c', r"""
+#include <stdio.h>
+void
+f5(void)
+{
+        printf("f5.c\n");
 }
 """)
 
@@ -79,12 +100,12 @@ extern "C" void f3(void);
 int
 main(int argc, char *argv[])
 {
-       argv[argc++] = "--";
-       f1();
-       f2();
-       f3();
-       printf("prog.c\n");
-       return 0;
+        argv[argc++] = (char *)"--";
+        f1();
+        f2();
+        f3();
+        printf("prog.c\n");
+        return 0;
 }
 """)
 
@@ -99,3 +120,9 @@ test.run(program = test.workpath('prog2'), stdout = stdout)
 test.run(program = test.workpath('prog3'), stdout = stdout)
 
 test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: