diff options
author | Mats Wichmann <mats@linux.com> | 2020-06-18 00:49:48 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2020-06-19 18:45:48 (GMT) |
commit | fb051bdc215244d352c2067d93d30ea64200e71f (patch) | |
tree | bf329cb8d20466db9797b0e4b55a4348672e61df /test/AS | |
parent | df1e47c805c0fd1c6d5e60ea00b465188db6163e (diff) | |
download | SCons-fb051bdc215244d352c2067d93d30ea64200e71f.zip SCons-fb051bdc215244d352c2067d93d30ea64200e71f.tar.gz SCons-fb051bdc215244d352c2067d93d30ea64200e71f.tar.bz2 |
Fix testing subdir usage
Various tests called subdir several times with the same directory,
which is pointless. In previous code, this emitted a message
though it did not fail. Stop doing that.
The dir_fixture() method did some convoluted things to make sure
the directories to write to exist, change this around to simplify.
The subdir() method already combines the testdir, so dir_fixture
doesn't need to. Also handle more cleanly the case of the target
directory being an absolute path, which seems to have been intended,
but would not work.
Also clean up file_fixture() along the same principles.
Change the subdir() method to not need to be given an ordered
list of directories; instead call os.makedirs on each so
intermediate steps are made automatically. Along the way,
the print about making a directory that already existed vanishes.
Tests which did os.path.join on directory pieces when calling
file_fixture no longer do so, since file_fixture (and dir_fixture)
do joining on an arg which is a list of paths like many other scons
functions.
The testing doc was updated to fix some wording and reflect
the above changes.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/AS')
-rw-r--r-- | test/AS/AS.py | 2 | ||||
-rw-r--r-- | test/AS/ASFLAGS.py | 2 | ||||
-rw-r--r-- | test/AS/ASPP.py | 2 | ||||
-rw-r--r-- | test/AS/ASPPFLAGS.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/test/AS/AS.py b/test/AS/AS.py index 380afe3..56a1498 100644 --- a/test/AS/AS.py +++ b/test/AS/AS.py @@ -40,7 +40,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas.py')) +test.file_fixture(['fixture', 'myas.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/AS/ASFLAGS.py b/test/AS/ASFLAGS.py index 79fde8c..52f44af 100644 --- a/test/AS/ASFLAGS.py +++ b/test/AS/ASFLAGS.py @@ -35,7 +35,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas_args.py')) +test.file_fixture(['fixture', 'myas_args.py']) o = ' -x' o_c = ' -x -c' diff --git a/test/AS/ASPP.py b/test/AS/ASPP.py index 18c067f..64e1080 100644 --- a/test/AS/ASPP.py +++ b/test/AS/ASPP.py @@ -35,7 +35,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas.py')) +test.file_fixture(['fixture', 'myas.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/AS/ASPPFLAGS.py b/test/AS/ASPPFLAGS.py index 254a458..5dd9a38 100644 --- a/test/AS/ASPPFLAGS.py +++ b/test/AS/ASPPFLAGS.py @@ -35,7 +35,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas_args.py')) +test.file_fixture(['fixture', 'myas_args.py']) o = ' -x' o_c = ' -x -c' |