summaryrefslogtreecommitdiffstats
path: root/test/Dir/PyPackageDir/image
diff options
context:
space:
mode:
Diffstat (limited to 'test/Dir/PyPackageDir/image')
-rw-r--r--test/Dir/PyPackageDir/image/SConstruct29
-rw-r--r--test/Dir/PyPackageDir/image/sconstest.skip0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/sconstest.skip0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/submod1/__init__.py0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/submod1/sconstest.skip0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/submod1/submod2/__init__.py0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/submod1/submod2/sconstest.skip0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/submod1/submod2/testmod4.py0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/submod1/testmod3.py0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/testmod1/__init__.py0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/testmod1/sconstest.skip0
-rw-r--r--test/Dir/PyPackageDir/image/syspath/testmod2.py0
12 files changed, 29 insertions, 0 deletions
diff --git a/test/Dir/PyPackageDir/image/SConstruct b/test/Dir/PyPackageDir/image/SConstruct
new file mode 100644
index 0000000..90d2a80
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/SConstruct
@@ -0,0 +1,29 @@
+import sys, os
+
+oldsyspath = sys.path
+dir_path = Dir('.').srcnode().abspath
+dir_path = os.path.join(dir_path, 'syspath')
+sys.path.append(dir_path)
+
+def TestPyPackageDir(env, modname):
+ packagepath = env.PyPackageDir(modname).abspath
+ # Convert from an absolute path back to a relative one for testing
+ commonprefix = os.path.commonprefix([dir_path, packagepath])
+ relpath = os.path.relpath(packagepath, commonprefix)
+ relpath = relpath.replace(os.sep, '/')
+ print(relpath)
+
+print("Test identification of directory for a given python package")
+env = Environment()
+TestPyPackageDir(env, 'testmod1')
+TestPyPackageDir(env, 'testmod2')
+TestPyPackageDir(env, 'submod1.testmod3')
+TestPyPackageDir(env, 'submod1.submod2.testmod4')
+
+print("Test parameter substitution")
+env = Environment(FOO = 'submod1.submod2.testmod4')
+TestPyPackageDir(env, '${FOO}')
+env = Environment(FOO = 'submod1.submod2', BAR = 'testmod4')
+TestPyPackageDir(env, '${FOO}.${BAR}')
+
+sys.path = oldsyspath
diff --git a/test/Dir/PyPackageDir/image/sconstest.skip b/test/Dir/PyPackageDir/image/sconstest.skip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/sconstest.skip
diff --git a/test/Dir/PyPackageDir/image/syspath/sconstest.skip b/test/Dir/PyPackageDir/image/syspath/sconstest.skip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/sconstest.skip
diff --git a/test/Dir/PyPackageDir/image/syspath/submod1/__init__.py b/test/Dir/PyPackageDir/image/syspath/submod1/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/submod1/__init__.py
diff --git a/test/Dir/PyPackageDir/image/syspath/submod1/sconstest.skip b/test/Dir/PyPackageDir/image/syspath/submod1/sconstest.skip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/submod1/sconstest.skip
diff --git a/test/Dir/PyPackageDir/image/syspath/submod1/submod2/__init__.py b/test/Dir/PyPackageDir/image/syspath/submod1/submod2/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/submod1/submod2/__init__.py
diff --git a/test/Dir/PyPackageDir/image/syspath/submod1/submod2/sconstest.skip b/test/Dir/PyPackageDir/image/syspath/submod1/submod2/sconstest.skip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/submod1/submod2/sconstest.skip
diff --git a/test/Dir/PyPackageDir/image/syspath/submod1/submod2/testmod4.py b/test/Dir/PyPackageDir/image/syspath/submod1/submod2/testmod4.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/submod1/submod2/testmod4.py
diff --git a/test/Dir/PyPackageDir/image/syspath/submod1/testmod3.py b/test/Dir/PyPackageDir/image/syspath/submod1/testmod3.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/submod1/testmod3.py
diff --git a/test/Dir/PyPackageDir/image/syspath/testmod1/__init__.py b/test/Dir/PyPackageDir/image/syspath/testmod1/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/testmod1/__init__.py
diff --git a/test/Dir/PyPackageDir/image/syspath/testmod1/sconstest.skip b/test/Dir/PyPackageDir/image/syspath/testmod1/sconstest.skip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/testmod1/sconstest.skip
diff --git a/test/Dir/PyPackageDir/image/syspath/testmod2.py b/test/Dir/PyPackageDir/image/syspath/testmod2.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Dir/PyPackageDir/image/syspath/testmod2.py