summaryrefslogtreecommitdiffstats
path: root/test/Repository/Program.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Repository/Program.py')
-rw-r--r--test/Repository/Program.py198
1 files changed, 99 insertions, 99 deletions
diff --git a/test/Repository/Program.py b/test/Repository/Program.py
index 1eb18d8..75860a7 100644
--- a/test/Repository/Program.py
+++ b/test/Repository/Program.py
@@ -32,25 +32,24 @@ if sys.platform == 'win32':
else:
_exe = ''
-test = TestSCons.TestSCons()
-
-
-
-# First, test a single repository.
-test.subdir('repository', 'work1')
-
-repository = test.workpath('repository')
-repository_foo_c = test.workpath('repository', 'foo.c')
-work1_foo = test.workpath('work1', 'foo' + _exe)
-work1_foo_c = test.workpath('work1', 'foo.c')
-
-test.write(['work1', 'SConstruct'], r"""
+for implicit_deps in ['0', '1', '"all"']:
+ # First, test a single repository.
+ test = TestSCons.TestSCons()
+ test.verbose_set(1)
+ test.subdir('repository', 'work1')
+ repository = test.workpath('repository')
+ repository_foo_c = test.workpath('repository', 'foo.c')
+ work1_foo = test.workpath('work1', 'foo' + _exe)
+ work1_foo_c = test.workpath('work1', 'foo.c')
+
+ test.write(['work1', 'SConstruct'], r"""
+DefaultEnvironment(tools=[])
Repository(r'%s')
-env = Environment()
+env = Environment(IMPLICIT_COMMAND_DEPENDENCIES=%s)
env.Program(target= 'foo', source = Split('aaa.c bbb.c foo.c'))
-""" % repository)
+""" % (repository, implicit_deps))
-test.write(['repository', 'aaa.c'], r"""
+ test.write(['repository', 'aaa.c'], r"""
#include <stdio.h>
void
aaa(void)
@@ -59,7 +58,7 @@ aaa(void)
}
""")
-test.write(['repository', 'bbb.c'], r"""
+ test.write(['repository', 'bbb.c'], r"""
#include <stdio.h>
void
bbb(void)
@@ -68,7 +67,7 @@ bbb(void)
}
""")
-test.write(['repository', 'foo.c'], r"""
+ test.write(['repository', 'foo.c'], r"""
#include <stdio.h>
#include <stdlib.h>
@@ -85,21 +84,21 @@ main(int argc, char *argv[])
}
""")
-# Make the entire repository non-writable, so we'll detect
-# if we try to write into it accidentally.
-test.writable('repository', 0)
+ # Make the entire repository non-writable, so we'll detect
+ # if we try to write into it accidentally.
+ test.writable('repository', 0)
-test.run(chdir = 'work1', arguments = '.')
+ test.run(chdir = 'work1', arguments = '.')
-test.run(program = work1_foo, stdout = """repository/aaa.c
+ test.run(program = work1_foo, stdout = """repository/aaa.c
repository/bbb.c
repository/foo.c
""")
-test.up_to_date(chdir = 'work1', arguments = '.')
+ test.up_to_date(chdir = 'work1', arguments = '.')
-#
-test.write(['work1', 'bbb.c'], r"""
+ #
+ test.write(['work1', 'bbb.c'], r"""
#include <stdio.h>
void
bbb(void)
@@ -108,17 +107,17 @@ bbb(void)
}
""")
-test.run(chdir = 'work1', arguments = '.')
+ test.run(chdir = 'work1', arguments = '.')
-test.run(program = work1_foo, stdout = """repository/aaa.c
+ test.run(program = work1_foo, stdout = """repository/aaa.c
work1/bbb.c
repository/foo.c
""")
-test.up_to_date(chdir = 'work1', arguments = '.')
+ test.up_to_date(chdir = 'work1', arguments = '.')
-#
-test.write(['work1', 'aaa.c'], r"""
+ #
+ test.write(['work1', 'aaa.c'], r"""
#include <stdio.h>
void
aaa(void)
@@ -127,7 +126,7 @@ aaa(void)
}
""")
-test.write(['work1', 'foo.c'], r"""
+ test.write(['work1', 'foo.c'], r"""
#include <stdio.h>
#include <stdlib.h>
extern void aaa(void);
@@ -143,57 +142,58 @@ main(int argc, char *argv[])
}
""")
-test.run(chdir = 'work1', arguments = '.')
+ test.run(chdir = 'work1', arguments = '.')
-test.run(program = work1_foo, stdout = """work1/aaa.c
+ test.run(program = work1_foo, stdout = """work1/aaa.c
work1/bbb.c
work1/foo.c
""")
-test.up_to_date(chdir = 'work1', arguments = '.')
+ test.up_to_date(chdir = 'work1', arguments = '.')
-#
-test.unlink(['work1', 'aaa.c'])
+ #
+ test.unlink(['work1', 'aaa.c'])
-test.run(chdir = 'work1', arguments = '.')
+ test.run(chdir = 'work1', arguments = '.')
-test.run(program = work1_foo, stdout = """repository/aaa.c
+ test.run(program = work1_foo, stdout = """repository/aaa.c
work1/bbb.c
work1/foo.c
""")
-test.up_to_date(chdir = 'work1', arguments = '.')
+ test.up_to_date(chdir = 'work1', arguments = '.')
-#
-test.unlink(['work1', 'bbb.c'])
-test.unlink(['work1', 'foo.c'])
+ #
+ test.unlink(['work1', 'bbb.c'])
+ test.unlink(['work1', 'foo.c'])
-test.run(chdir = 'work1', arguments = '.')
+ test.run(chdir = 'work1', arguments = '.')
-test.run(program = work1_foo, stdout = """repository/aaa.c
+ test.run(program = work1_foo, stdout = """repository/aaa.c
repository/bbb.c
repository/foo.c
""")
-test.up_to_date(chdir = 'work1', arguments = '.')
+ test.up_to_date(chdir = 'work1', arguments = '.')
-# Now, test multiple repositories.
-test.subdir('repository.new', 'repository.old', 'work2')
+ # Now, test multiple repositories.
+ test.subdir('repository.new', 'repository.old', 'work2')
-repository_new = test.workpath('repository.new')
-repository_old = test.workpath('repository.old')
-work2_foo = test.workpath('work2', 'foo' + _exe)
+ repository_new = test.workpath('repository.new')
+ repository_old = test.workpath('repository.old')
+ work2_foo = test.workpath('work2', 'foo' + _exe)
-test.write(['work2', 'SConstruct'], r"""
+ test.write(['work2', 'SConstruct'], r"""
+DefaultEnvironment(tools=[])
Repository(r'%s')
Repository(r'%s')
env = Environment()
env.Program(target= 'foo', source = Split('aaa.c bbb.c foo.c'))
""" % (repository_new, repository_old))
-test.write(['repository.old', 'aaa.c'], r"""
+ test.write(['repository.old', 'aaa.c'], r"""
#include <stdio.h>
void
aaa(void)
@@ -202,7 +202,7 @@ aaa(void)
}
""")
-test.write(['repository.old', 'bbb.c'], r"""
+ test.write(['repository.old', 'bbb.c'], r"""
#include <stdio.h>
void
bbb(void)
@@ -211,7 +211,7 @@ bbb(void)
}
""")
-test.write(['repository.old', 'foo.c'], r"""
+ test.write(['repository.old', 'foo.c'], r"""
#include <stdio.h>
#include <stdlib.h>
extern void aaa(void);
@@ -227,24 +227,24 @@ main(int argc, char *argv[])
}
""")
-# Make both repositories non-writable, so we'll detect
-# if we try to write into it accidentally.
-test.writable('repository.new', 0)
-test.writable('repository.old', 0)
+ # Make both repositories non-writable, so we'll detect
+ # if we try to write into it accidentally.
+ test.writable('repository.new', 0)
+ test.writable('repository.old', 0)
-test.run(chdir = 'work2', arguments = '.')
+ test.run(chdir = 'work2', arguments = '.')
-test.run(program = work2_foo, stdout = """repository.old/aaa.c
+ test.run(program = work2_foo, stdout = """repository.old/aaa.c
repository.old/bbb.c
repository.old/foo.c
""")
-test.up_to_date(chdir = 'work2', arguments = '.')
+ test.up_to_date(chdir = 'work2', arguments = '.')
-#
-test.writable('repository.new', 1)
+ #
+ test.writable('repository.new', 1)
-test.write(['repository.new', 'aaa.c'], r"""
+ test.write(['repository.new', 'aaa.c'], r"""
#include <stdio.h>
#include <stdlib.h>
void
@@ -254,7 +254,7 @@ aaa(void)
}
""")
-test.write(['work2', 'bbb.c'], r"""
+ test.write(['work2', 'bbb.c'], r"""
#include <stdio.h>
#include <stdlib.h>
void
@@ -264,20 +264,20 @@ bbb(void)
}
""")
-#
-test.writable('repository.new', 0)
+ #
+ test.writable('repository.new', 0)
-test.run(chdir = 'work2', arguments = '.')
+ test.run(chdir = 'work2', arguments = '.')
-test.run(program = work2_foo, stdout = """repository.new/aaa.c
+ test.run(program = work2_foo, stdout = """repository.new/aaa.c
work2/bbb.c
repository.old/foo.c
""")
-test.up_to_date(chdir = 'work2', arguments = '.')
+ test.up_to_date(chdir = 'work2', arguments = '.')
-#
-test.write(['work2', 'aaa.c'], r"""
+ #
+ test.write(['work2', 'aaa.c'], r"""
#include <stdio.h>
#include <stdlib.h>
void
@@ -287,7 +287,7 @@ aaa(void)
}
""")
-test.write(['work2', 'foo.c'], r"""
+ test.write(['work2', 'foo.c'], r"""
#include <stdio.h>
#include <stdlib.h>
extern void aaa(void);
@@ -303,59 +303,59 @@ main(int argc, char *argv[])
}
""")
-#
-test.run(chdir = 'work2', arguments = '.')
+ #
+ test.run(chdir = 'work2', arguments = '.')
-test.run(program = work2_foo, stdout = """work2/aaa.c
+ test.run(program = work2_foo, stdout = """work2/aaa.c
work2/bbb.c
work2/foo.c
""")
-test.up_to_date(chdir = 'work2', arguments = '.')
+ test.up_to_date(chdir = 'work2', arguments = '.')
-#
-test.unlink(['work2', 'aaa.c'])
-test.unlink(['work2', 'bbb.c'])
+ #
+ test.unlink(['work2', 'aaa.c'])
+ test.unlink(['work2', 'bbb.c'])
-#
-test.run(chdir = 'work2', arguments = '.')
+ #
+ test.run(chdir = 'work2', arguments = '.')
-test.run(program = work2_foo, stdout = """repository.new/aaa.c
+ test.run(program = work2_foo, stdout = """repository.new/aaa.c
repository.old/bbb.c
work2/foo.c
""")
-test.up_to_date(chdir = 'work2', arguments = '.')
+ test.up_to_date(chdir = 'work2', arguments = '.')
-#
-test.unlink(['work2', 'foo.c'])
+ #
+ test.unlink(['work2', 'foo.c'])
-#
-test.run(chdir = 'work2', arguments = '.')
+ #
+ test.run(chdir = 'work2', arguments = '.')
-test.run(program = work2_foo, stdout = """repository.new/aaa.c
+ test.run(program = work2_foo, stdout = """repository.new/aaa.c
repository.old/bbb.c
repository.old/foo.c
""")
-test.up_to_date(chdir = 'work2', arguments = '.')
+ test.up_to_date(chdir = 'work2', arguments = '.')
-#
-test.writable('repository.new', 1)
+ #
+ test.writable('repository.new', 1)
-test.unlink(['repository.new', 'aaa.c'])
+ test.unlink(['repository.new', 'aaa.c'])
-test.writable('repository.new', 0)
+ test.writable('repository.new', 0)
-#
-test.run(chdir = 'work2', arguments = '.')
+ #
+ test.run(chdir = 'work2', arguments = '.')
-test.run(program = work2_foo, stdout = """repository.old/aaa.c
+ test.run(program = work2_foo, stdout = """repository.old/aaa.c
repository.old/bbb.c
repository.old/foo.c
""")
-test.up_to_date(chdir = 'work2', arguments = '.')
+ test.up_to_date(chdir = 'work2', arguments = '.')
#