diff options
Diffstat (limited to 'test/toolpath/nested')
29 files changed, 109 insertions, 21 deletions
diff --git a/test/toolpath/nested/image/tools/subdir1/Toolpath_TestTool1.py b/test/toolpath/nested/image/Libs/tools_example/Toolpath_TestTool1.py index 072daf0..072daf0 100644 --- a/test/toolpath/nested/image/tools/subdir1/Toolpath_TestTool1.py +++ b/test/toolpath/nested/image/Libs/tools_example/Toolpath_TestTool1.py diff --git a/test/toolpath/nested/image/tools/subdir1/subdir2/Toolpath_TestTool2.py b/test/toolpath/nested/image/Libs/tools_example/Toolpath_TestTool2/__init__.py index f4ccefe..f4ccefe 100644 --- a/test/toolpath/nested/image/tools/subdir1/subdir2/Toolpath_TestTool2.py +++ b/test/toolpath/nested/image/Libs/tools_example/Toolpath_TestTool2/__init__.py diff --git a/test/toolpath/nested/image/tools/subdir1/subdir2/sconstest.skip b/test/toolpath/nested/image/Libs/tools_example/Toolpath_TestTool2/sconstest.skip index e69de29..e69de29 100644 --- a/test/toolpath/nested/image/tools/subdir1/subdir2/sconstest.skip +++ b/test/toolpath/nested/image/Libs/tools_example/Toolpath_TestTool2/sconstest.skip diff --git a/test/toolpath/nested/image/tools/subdir1/subdir2/__init__.py b/test/toolpath/nested/image/Libs/tools_example/__init__.py index e69de29..e69de29 100644 --- a/test/toolpath/nested/image/tools/subdir1/subdir2/__init__.py +++ b/test/toolpath/nested/image/Libs/tools_example/__init__.py diff --git a/test/toolpath/nested/image/tools/subdir1/sconstest.skip b/test/toolpath/nested/image/Libs/tools_example/sconstest.skip index e69de29..e69de29 100644 --- a/test/toolpath/nested/image/tools/subdir1/sconstest.skip +++ b/test/toolpath/nested/image/Libs/tools_example/sconstest.skip diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Site_TestTool2.py b/test/toolpath/nested/image/Libs/tools_example/subdir1/Toolpath_TestTool1_1.py index adae55b..2a70e67 100644 --- a/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Site_TestTool2.py +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/Toolpath_TestTool1_1.py @@ -1,4 +1,4 @@ def generate(env):
- env['Site_TestTool2'] = 1
+ env['Toolpath_TestTool1_1'] = 1
def exists(env):
return 1
diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Site_TestTool3/__init__.py b/test/toolpath/nested/image/Libs/tools_example/subdir1/Toolpath_TestTool1_2/__init__.py index 60bbd02..424991f 100644 --- a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Site_TestTool3/__init__.py +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/Toolpath_TestTool1_2/__init__.py @@ -1,4 +1,4 @@ def generate(env):
- env['Site_TestTool3'] = 1
+ env['Toolpath_TestTool1_2'] = 1
def exists(env):
return 1
diff --git a/test/toolpath/nested/image/tools/subdir1/Toolpath_TestTool3/sconstest.skip b/test/toolpath/nested/image/Libs/tools_example/subdir1/Toolpath_TestTool1_2/sconstest.skip index e69de29..e69de29 100644 --- a/test/toolpath/nested/image/tools/subdir1/Toolpath_TestTool3/sconstest.skip +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/Toolpath_TestTool1_2/sconstest.skip diff --git a/test/toolpath/nested/image/tools/subdir1/__init__.py b/test/toolpath/nested/image/Libs/tools_example/subdir1/__init__.py index e69de29..e69de29 100644 --- a/test/toolpath/nested/image/tools/subdir1/__init__.py +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/__init__.py diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Site_TestTool3/sconstest.skip b/test/toolpath/nested/image/Libs/tools_example/subdir1/sconstest.skip index e69de29..e69de29 100644 --- a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Site_TestTool3/sconstest.skip +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/sconstest.skip diff --git a/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_1.py b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_1.py new file mode 100644 index 0000000..13d0496 --- /dev/null +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_1.py @@ -0,0 +1,4 @@ +def generate(env):
+ env['Toolpath_TestTool2_1'] = 1
+def exists(env):
+ return 1
diff --git a/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_2/__init__.py b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_2/__init__.py new file mode 100644 index 0000000..3f8fd5e --- /dev/null +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_2/__init__.py @@ -0,0 +1,4 @@ +def generate(env):
+ env['Toolpath_TestTool2_2'] = 1
+def exists(env):
+ return 1
diff --git a/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_2/sconstest.skip b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_2/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/Toolpath_TestTool2_2/sconstest.skip diff --git a/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/__init__.py b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/__init__.py diff --git a/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/sconstest.skip b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/Libs/tools_example/subdir1/subdir2/sconstest.skip diff --git a/test/toolpath/nested/image/SConstruct b/test/toolpath/nested/image/SConstruct index 284f21c..b20d8e6 100644 --- a/test/toolpath/nested/image/SConstruct +++ b/test/toolpath/nested/image/SConstruct @@ -1,15 +1,62 @@ -# Test where tools are located under site_scons/site_tools
-env1 = Environment(tools=['subdir1.Site_TestTool1', 'subdir1.subdir2.Site_TestTool2', 'subdir1.Site_TestTool3'])
-print("env1['Site_TestTool1'] =", env1.get('Site_TestTool1'))
-print("env1['Site_TestTool2'] =", env1.get('Site_TestTool2'))
-print("env1['Site_TestTool3'] =", env1.get('Site_TestTool3'))
-
-# Test where toolpath is set in the env constructor
-env2 = Environment(tools=['subdir1.Toolpath_TestTool1', 'subdir1.subdir2.Toolpath_TestTool2', 'subdir1.Toolpath_TestTool3'], toolpath=['tools'])
+import sys, os
+
+toollist = ['Toolpath_TestTool1',
+ 'Toolpath_TestTool2',
+ 'subdir1.Toolpath_TestTool1_1',
+ 'subdir1.Toolpath_TestTool1_2',
+ 'subdir1.subdir2.Toolpath_TestTool2_1',
+ 'subdir1.subdir2.Toolpath_TestTool2_2',
+ ]
+
+print('Test where tools are located under site_scons/site_tools')
+env1 = Environment(tools=toollist)
+print("env1['Toolpath_TestTool1'] =", env1.get('Toolpath_TestTool1'))
+print("env1['Toolpath_TestTool2'] =", env1.get('Toolpath_TestTool2'))
+print("env1['Toolpath_TestTool1_1'] =", env1.get('Toolpath_TestTool1_1'))
+print("env1['Toolpath_TestTool1_2'] =", env1.get('Toolpath_TestTool1_2'))
+print("env1['Toolpath_TestTool2_1'] =", env1.get('Toolpath_TestTool2_1'))
+print("env1['Toolpath_TestTool2_2'] =", env1.get('Toolpath_TestTool2_2'))
+
+print('Test where toolpath is set in the env constructor')
+env2 = Environment(tools=toollist, toolpath=['Libs/tools_example'])
print("env2['Toolpath_TestTool1'] =", env2.get('Toolpath_TestTool1'))
print("env2['Toolpath_TestTool2'] =", env2.get('Toolpath_TestTool2'))
-print("env2['Toolpath_TestTool3'] =", env2.get('Toolpath_TestTool3'))
+print("env2['Toolpath_TestTool1_1'] =", env2.get('Toolpath_TestTool1_1'))
+print("env2['Toolpath_TestTool1_2'] =", env2.get('Toolpath_TestTool1_2'))
+print("env2['Toolpath_TestTool2_1'] =", env2.get('Toolpath_TestTool2_1'))
+print("env2['Toolpath_TestTool2_2'] =", env2.get('Toolpath_TestTool2_2'))
+
+print('Test a Clone')
+base = Environment(tools=[], toolpath=['Libs/tools_example'])
+derived = base.Clone(tools=['subdir1.Toolpath_TestTool1_1'])
+print("derived['Toolpath_TestTool1_1'] =", derived.get('Toolpath_TestTool1_1'))
+
+
+print('Test using syspath as the toolpath')
+print('Lets pretend that tools_example within Libs is actually a module installed via pip')
+oldsyspath = sys.path
+dir_path = Dir('.').srcnode().abspath
+dir_path = os.path.join(dir_path, 'Libs')
+sys.path.append(dir_path)
+
+toollist = ['tools_example.Toolpath_TestTool1',
+ 'tools_example.Toolpath_TestTool2',
+ 'tools_example.subdir1.Toolpath_TestTool1_1',
+ 'tools_example.subdir1.Toolpath_TestTool1_2',
+ 'tools_example.subdir1.subdir2.Toolpath_TestTool2_1',
+ 'tools_example.subdir1.subdir2.Toolpath_TestTool2_2',
+ ]
+
+env3 = Environment(tools=toollist, toolpath=sys.path)
+print("env3['Toolpath_TestTool1'] =", env3.get('Toolpath_TestTool1'))
+print("env3['Toolpath_TestTool2'] =", env3.get('Toolpath_TestTool2'))
+print("env3['Toolpath_TestTool1_1'] =", env3.get('Toolpath_TestTool1_1'))
+print("env3['Toolpath_TestTool1_2'] =", env3.get('Toolpath_TestTool1_2'))
+print("env3['Toolpath_TestTool2_1'] =", env3.get('Toolpath_TestTool2_1'))
+print("env3['Toolpath_TestTool2_2'] =", env3.get('Toolpath_TestTool2_2'))
+
+sys.path = oldsyspath
-base = Environment(tools=[], toolpath=['tools'])
-derived = base.Clone(tools=['subdir1.Toolpath_TestTool1'])
-print("derived['Toolpath_TestTool1'] =", derived.get('Toolpath_TestTool1'))
+# TODO
+# 1. add docs for below
+# 3. redo test output capture
diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Site_TestTool1.py b/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool1.py index d4a19a8..072daf0 100644 --- a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Site_TestTool1.py +++ b/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool1.py @@ -1,4 +1,4 @@ def generate(env):
- env['Site_TestTool1'] = 1
+ env['Toolpath_TestTool1'] = 1
def exists(env):
return 1
diff --git a/test/toolpath/nested/image/tools/subdir1/Toolpath_TestTool3/__init__.py b/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool2/__init__.py index 26bc748..f4ccefe 100644 --- a/test/toolpath/nested/image/tools/subdir1/Toolpath_TestTool3/__init__.py +++ b/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool2/__init__.py @@ -1,4 +1,4 @@ def generate(env):
- env['Toolpath_TestTool3'] = 1
+ env['Toolpath_TestTool2'] = 1
def exists(env):
return 1
diff --git a/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool2/sconstest.skip b/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool2/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool2/sconstest.skip diff --git a/test/toolpath/nested/image/site_scons/site_tools/__init__.py b/test/toolpath/nested/image/site_scons/site_tools/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/__init__.py diff --git a/test/toolpath/nested/image/site_scons/site_tools/sconstest.skip b/test/toolpath/nested/image/site_scons/site_tools/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/sconstest.skip diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_1.py b/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_1.py new file mode 100644 index 0000000..2a70e67 --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_1.py @@ -0,0 +1,4 @@ +def generate(env):
+ env['Toolpath_TestTool1_1'] = 1
+def exists(env):
+ return 1
diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_2/__init__.py b/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_2/__init__.py new file mode 100644 index 0000000..424991f --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_2/__init__.py @@ -0,0 +1,4 @@ +def generate(env):
+ env['Toolpath_TestTool1_2'] = 1
+def exists(env):
+ return 1
diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_2/sconstest.skip b/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_2/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/subdir1/Toolpath_TestTool1_2/sconstest.skip diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_1.py b/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_1.py new file mode 100644 index 0000000..13d0496 --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_1.py @@ -0,0 +1,4 @@ +def generate(env):
+ env['Toolpath_TestTool2_1'] = 1
+def exists(env):
+ return 1
diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_2/__init__.py b/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_2/__init__.py new file mode 100644 index 0000000..3f8fd5e --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_2/__init__.py @@ -0,0 +1,4 @@ +def generate(env):
+ env['Toolpath_TestTool2_2'] = 1
+def exists(env):
+ return 1
diff --git a/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_2/sconstest.skip b/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_2/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/site_scons/site_tools/subdir1/subdir2/Toolpath_TestTool2_2/sconstest.skip diff --git a/test/toolpath/nested/image/testsrc1.txt b/test/toolpath/nested/image/testsrc1.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/toolpath/nested/image/testsrc1.txt diff --git a/test/toolpath/nested/nested.py b/test/toolpath/nested/nested.py index 7304dd5..a736d58 100644 --- a/test/toolpath/nested/nested.py +++ b/test/toolpath/nested/nested.py @@ -33,13 +33,30 @@ test.dir_fixture('image') test.run(arguments = '.', stdout = """\ scons: Reading SConscript files ... -env1['Site_TestTool1'] = 1 -env1['Site_TestTool2'] = 1 -env1['Site_TestTool3'] = 1 +Test where tools are located under site_scons/site_tools +env1['Toolpath_TestTool1'] = 1 +env1['Toolpath_TestTool2'] = 1 +env1['Toolpath_TestTool1_1'] = 1 +env1['Toolpath_TestTool1_2'] = 1 +env1['Toolpath_TestTool2_1'] = 1 +env1['Toolpath_TestTool2_2'] = 1 +Test where toolpath is set in the env constructor env2['Toolpath_TestTool1'] = 1 env2['Toolpath_TestTool2'] = 1 -env2['Toolpath_TestTool3'] = 1 -derived['Toolpath_TestTool1'] = 1 +env2['Toolpath_TestTool1_1'] = 1 +env2['Toolpath_TestTool1_2'] = 1 +env2['Toolpath_TestTool2_1'] = 1 +env2['Toolpath_TestTool2_2'] = 1 +Test a Clone +derived['Toolpath_TestTool1_1'] = 1 +Test using syspath as the toolpath +Lets pretend that tools_example within Libs is actually a module installed via pip +env3['Toolpath_TestTool1'] = 1 +env3['Toolpath_TestTool2'] = 1 +env3['Toolpath_TestTool1_1'] = 1 +env3['Toolpath_TestTool1_2'] = 1 +env3['Toolpath_TestTool2_1'] = 1 +env3['Toolpath_TestTool2_2'] = 1 scons: done reading SConscript files. scons: Building targets ... scons: `.' is up to date. |