Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added specific test for Compilation Database to reproduce issue #4275… #9

Conversation

TZe-0xff
Copy link

Added specific test for Compilation Database to reproduce issue SCons#4275 with TempFileMunge

This new test allows to reproduce issue SCons#4275 in a platform independent way.
The only drawback is that I needed to disable actual build of output since I didn't find a way to execute command line from file using python.

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt (and read the README.rst)
  • I have updated the appropriate documentation

@TZe-0xff
Copy link
Author

By the way, runtest outputs with your fix reverted :

zeisslt@OBELZEISSLT MINGW64 /c/Data/Workspaces/Python/Scons/scons (fix_4275_comp_db_with_TEMPFILE_test|REVERTING)
$ python runtest.py test/CompilationDatabase/*
1/3 (33.33%) C:\Python37-32\python.exe test/CompilationDatabase/basic.py
C:\Python37-32\python.exe "C:\Data\Workspaces\Python\Scons\scons\scripts\scons.py"
PASSED
2/3 (66.67%) C:\Python37-32\python.exe test/CompilationDatabase/tmpfile.py
C:\Python37-32\python.exe "C:\Data\Workspaces\Python\Scons\scons\scripts\scons.py"
FAILED test of C:\Data\Workspaces\Python\Scons\scons\scripts\scons.py
        at line 522 of C:\Data\Workspaces\Python\Scons\scons\testing\framework\TestCommon.py (must_match)
        from line 75 of test/CompilationDatabase/tmpfile.py
Unexpected contents of `compile_commands_only_arg.json'
contents =======================================================================
3c3
<         "command": "C:\\Python37-32\\python.exe mygcc.py cc -o test_main.o -c test_main.c",
---
>         "command": "C:\\Python37-32\\python.exe @C:\\Users\\zeisslt\\AppData\\Local\\Temp\\tmphyugqbx1.lnk",
3/3 (100.00%) C:\Python37-32\python.exe test/CompilationDatabase/variant_dir.py
C:\Python37-32\python.exe "C:\Data\Workspaces\Python\Scons\scons\scripts\scons.py"
PASSED

Failed the following test:
        test/CompilationDatabase/tmpfile.py

And then with your fix :

zeisslt@OBELZEISSLT MINGW64 /c/Data/Workspaces/Python/Scons/scons (fix_4275_comp_db_with_TEMPFILE_test)
$ python runtest.py test/CompilationDatabase/*
1/3 (33.33%) C:\Python37-32\python.exe test/CompilationDatabase/basic.py
C:\Python37-32\python.exe "C:\Data\Workspaces\Python\Scons\scons\scripts\scons.py"
PASSED
2/3 (66.67%) C:\Python37-32\python.exe test/CompilationDatabase/tmpfile.py
C:\Python37-32\python.exe "C:\Data\Workspaces\Python\Scons\scons\scripts\scons.py"
PASSED
3/3 (100.00%) C:\Python37-32\python.exe test/CompilationDatabase/variant_dir.py
C:\Python37-32\python.exe "C:\Data\Workspaces\Python\Scons\scons\scripts\scons.py"
PASSED

@bdbaddog
Copy link
Owner

Merging. I'll likely make a few tweaks once I merge into my branch.

@bdbaddog bdbaddog merged commit 53e6925 into bdbaddog:fix_4275_comp_db_with_TEMPFILE Dec 19, 2022
@TZe-0xff TZe-0xff deleted the fix_4275_comp_db_with_TEMPFILE_test branch December 19, 2022 07:54
bdbaddog pushed a commit that referenced this pull request Jun 20, 2023
Changed to YACC_GRAPH_FILE_SUFFIX. and some other changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants