summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2021-03-19 18:39:59 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2021-03-19 18:39:59 (GMT)
commit364cb87cb322dc1ba08d7cbfdcf36d70c72d27bf (patch)
tree61ca040d0e40e22b051331b2cb12448646a76eb7
parent0573abe24319cae16b5f607fd801903b384363be (diff)
downloadSCons-364cb87cb322dc1ba08d7cbfdcf36d70c72d27bf.zip
SCons-364cb87cb322dc1ba08d7cbfdcf36d70c72d27bf.tar.gz
SCons-364cb87cb322dc1ba08d7cbfdcf36d70c72d27bf.tar.bz2
Fix test to no longer need factory or scanner specified. Flesh out the fixture with actual dirs and files. Also add SOURCE.relpath, so singular case is also tested
-rw-r--r--test/File/File-relpath.py12
-rw-r--r--test/File/fixture/SConstruct-relpath16
-rw-r--r--test/File/fixture/relpath/base/SConstruct15
-rw-r--r--test/File/fixture/relpath/base/build/file10
-rw-r--r--test/File/fixture/relpath/base/src/file0
5 files changed, 22 insertions, 21 deletions
diff --git a/test/File/File-relpath.py b/test/File/File-relpath.py
index e3569dc..48c862b 100644
--- a/test/File/File-relpath.py
+++ b/test/File/File-relpath.py
@@ -36,11 +36,13 @@ test = TestSCons.TestSCons()
test.subdir('src', ['src', 'dir'])
-test.file_fixture('fixture/SConstruct-relpath', 'SConstruct')
-
-test.run('-Q', status=0, stdout="""\
+test.dir_fixture('fixture/relpath')
+test.run('-Q', chdir='base', status=0, stdout="""\
../foo/dir build/file1
%s %s
-src
+src/file
+%s
+src/file
%s
-""" % (os.path.abspath('../foo/dir'), os.path.abspath('build/file1'), os.path.abspath('src')))
+""" % (os.path.abspath('base/../foo/dir'), os.path.abspath('base/build/file1'), os.path.abspath('base/src/file'),
+ os.path.abspath('base/src/file')))
diff --git a/test/File/fixture/SConstruct-relpath b/test/File/fixture/SConstruct-relpath
deleted file mode 100644
index 16a6e8f..0000000
--- a/test/File/fixture/SConstruct-relpath
+++ /dev/null
@@ -1,16 +0,0 @@
-import os
-
-import SCons.Defaults
-
-DefaultEnvironment(tools=[])
-Echo = Builder(action=['@echo ${TARGETS.relpath}',
- 'echo ${TARGETS.abspath}',
- 'echo ${SOURCES.relpath}',
- 'echo ${SOURCES.abspath}'],
- target_scanner=SCons.Defaults.DirEntryScanner,
- target_factory=Entry,
- source_factory=Entry
- )
-
-env = Environment(tools=[], BUILDERS={'Echo': Echo})
-env.Echo(['../foo/dir', 'build/file1'], ['src'])
diff --git a/test/File/fixture/relpath/base/SConstruct b/test/File/fixture/relpath/base/SConstruct
new file mode 100644
index 0000000..af2459e
--- /dev/null
+++ b/test/File/fixture/relpath/base/SConstruct
@@ -0,0 +1,15 @@
+# Testcase to check that .relpath works on SOURCES,TARGETS, and the singular SOURCE
+# This is the SConstruct for test/File/File-relpath.py
+#
+DefaultEnvironment(tools=[])
+Echo = Builder(action=['@echo ${TARGETS.relpath}',
+ '@echo ${TARGETS.abspath}',
+ '@echo ${SOURCES.relpath}',
+ '@echo ${SOURCES.abspath}',
+ '@echo ${SOURCE.relpath}',
+ '@echo ${SOURCE.abspath}'
+ ],
+ )
+
+env = Environment(tools=[], BUILDERS={'Echo': Echo})
+env.Echo(['../foo/dir', 'build/file1'], ['src/file'])
diff --git a/test/File/fixture/relpath/base/build/file1 b/test/File/fixture/relpath/base/build/file1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/File/fixture/relpath/base/build/file1
diff --git a/test/File/fixture/relpath/base/src/file b/test/File/fixture/relpath/base/src/file
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/File/fixture/relpath/base/src/file