Skip to content

Commit d18e497

Browse files
committed
Update catalyze.py to copy tests to catalyst source dir
This adds a flag to catalyze.py to copy the tests to the catalyzed source tree. If this flag is not present, then the script behaves exactly as it used to. Change-Id: I38f50ac6dddedf33e2b0046e43d02272d78d63b0
1 parent 97826b1 commit d18e497

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Catalyst/catalyze.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def _get_argument_parser():
3434
'The directory contain manifest.json and other resources')
3535
parser.add_argument('-o', dest='output_dir', action='store',
3636
help='the directory where the modified sources will be written')
37+
parser.add_argument('-t', dest='copy_tests', action='store_true',
38+
help='also copy over the test folders of the editions')
3739

3840
usage = "Usage: %prog [options]"
3941

@@ -346,6 +348,19 @@ def process(config):
346348

347349
create_cmake_script(config, all_manifests)
348350

351+
def copyTestTrees(config):
352+
all_dirs = config.input_dirs
353+
repo = config.repo
354+
testingDst = os.path.join(config.output_dir, 'Testing')
355+
os.makedirs(testingDst)
356+
for input_dir in all_dirs:
357+
testingSrc = os.path.join(input_dir, 'Testing')
358+
for f in os.listdir(testingSrc):
359+
print f
360+
src = os.path.join(testingSrc,f)
361+
dst = os.path.join(testingDst,f)
362+
copy_path(src,dst,[])
363+
349364
def main():
350365
parser = _get_argument_parser()
351366
config = parser.parse_args()
@@ -367,6 +382,8 @@ def main():
367382
shutil.rmtree(config.output_dir, ignore_errors=True)
368383

369384
process(config)
385+
if (config.copy_tests):
386+
copyTestTrees(config)
370387

371388
if __name__ == '__main__':
372389
main()

0 commit comments

Comments
 (0)