diff options
author | Russel Winder <russel@winder.org.uk> | 2016-01-10 15:55:12 (GMT) |
---|---|---|
committer | Russel Winder <russel@winder.org.uk> | 2016-01-10 15:55:12 (GMT) |
commit | 31c24bc7e328fb2e8d75893c675f63e37dc2e6dc (patch) | |
tree | 3ad4fc61c687601f15569b7f36fc7611b2c9fe34 | |
parent | 2bffdfc4addbc1565c2f21f35b73ab09ef4f3105 (diff) | |
download | SCons-31c24bc7e328fb2e8d75893c675f63e37dc2e6dc.zip SCons-31c24bc7e328fb2e8d75893c675f63e37dc2e6dc.tar.gz SCons-31c24bc7e328fb2e8d75893c675f63e37dc2e6dc.tar.bz2 |
Refactor of test, but it still fails due to missing output from SCons.
-rw-r--r-- | test/Clean/mkfifo.py | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/test/Clean/mkfifo.py b/test/Clean/mkfifo.py index 0ef7662..01e4d98 100644 --- a/test/Clean/mkfifo.py +++ b/test/Clean/mkfifo.py @@ -38,35 +38,40 @@ test = TestSCons.TestSCons() if not hasattr(os, 'mkfifo'): test.skip_test('No os.mkfifo() function; skipping test\n') +test_dir_name = 'testdir' +pipe_path = os.path.join(test_dir_name, 'namedpipe') + test.write('SConstruct', """\ -Execute(Mkdir("testdir")) -dir = Dir("testdir") -Clean(dir, 'testdir') -""") +Execute(Mkdir("{0}")) +dir = Dir("{0}") +Clean(dir, '{0}') +""".format(test_dir_name)) + +test.run(arguments='-Q -q', stdout='Mkdir("{0}")\n'.format(test_dir_name)) -test.run(arguments='-Q -q', stdout='Mkdir("testdir")\n') +os.mkfifo(pipe_path) -os.mkfifo('testdir/namedpipe') +test.must_exist(test.workpath(pipe_path)) expect1 = """\ -Mkdir("testdir") -Path '%s' exists but isn't a file or directory. -scons: Could not remove 'testdir': Directory not empty -""" % os.path.join('testdir', 'namedpipe') +Mkdir("{0}") +Path '{1}' exists but isn't a file or directory. +scons: Could not remove '{0}': Directory not empty +""".format(test_dir_name, pipe_path) expect2 = """\ -Mkdir("testdir") -Path '%s' exists but isn't a file or directory. -scons: Could not remove 'testdir': File exists -""" % os.path.join('testdir', 'namedpipe') +Mkdir("{0}") +Path '{1}' exists but isn't a file or directory. +scons: Could not remove '{0}': File exists +""".format(test_dir_name, pipe_path) test.run(arguments='-c -Q -q') +test.must_exist(test.workpath(pipe_path)) + if test.stdout() not in [expect1, expect2]: test.diff(expect1, test.stdout(), 'STDOUT ') test.fail_test() - -test.must_exist(test.workpath('testdir/namedpipe')) test.pass_test() |