diff options
author | William Deegan <bill@baddogconsulting.com> | 2020-06-15 21:09:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 21:09:47 (GMT) |
commit | bb795ab3b64f9c0b9309d153a8effd146dfd7ce0 (patch) | |
tree | 582aecf9689a3792b59efc73f5fcf4032bdd91fa /test/CompilationDatabase/basic.py | |
parent | 1b283809124ef39b130045eb6e00c8e8b1cce781 (diff) | |
parent | 0944be440ce687d828ff7838d5925c54ded2a48a (diff) | |
download | SCons-bb795ab3b64f9c0b9309d153a8effd146dfd7ce0.zip SCons-bb795ab3b64f9c0b9309d153a8effd146dfd7ce0.tar.gz SCons-bb795ab3b64f9c0b9309d153a8effd146dfd7ce0.tar.bz2 |
Merge pull request #3698 from bdbaddog/fix_broken_fixture_mylink
Fix fake mylink.py was broken on win32.
Diffstat (limited to 'test/CompilationDatabase/basic.py')
-rw-r--r-- | test/CompilationDatabase/basic.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/test/CompilationDatabase/basic.py b/test/CompilationDatabase/basic.py index 21c883b..2f76752 100644 --- a/test/CompilationDatabase/basic.py +++ b/test/CompilationDatabase/basic.py @@ -27,15 +27,13 @@ and values of COMPILATIONDB_USE_ABSPATH """ import sys +import os +import os.path import TestSCons test = TestSCons.TestSCons() -if sys.platform == 'win32': - test.file_fixture('mylink_win32.py', 'mylink.py') -else: - test.file_fixture('mylink.py') - +test.file_fixture('mylink.py') test.file_fixture('mygcc.py') test.verbose_set(1) @@ -67,23 +65,30 @@ example_rel_file = """[ } ]""" % (sys.executable, test.workdir) +if sys.platform == 'win32': + example_rel_file = example_rel_file.replace('\\', '\\\\') + for f in rel_files: # print("Checking:%s" % f) test.must_exist(f) - test.must_match(f, example_rel_file) + test.must_match(f, example_rel_file, mode='r') example_abs_file = """[ { "command": "%s mygcc.py cc -o test_main.o -c test_main.c", "directory": "%s", - "file": "%s/test_main.c", - "output": "%s/test_main.o" + "file": "%s", + "output": "%s" } -]""" % (sys.executable, test.workdir, test.workdir, test.workdir) +]""" % (sys.executable, test.workdir, os.path.join(test.workdir, 'test_main.c'), os.path.join(test.workdir, 'test_main.o')) + +if sys.platform == 'win32': + example_abs_file = example_abs_file.replace('\\', '\\\\') + for f in abs_files: test.must_exist(f) - test.must_match(f, example_abs_file) + test.must_match(f, example_abs_file, mode='r') test.pass_test() |