-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Fix 2755: msvs tool, msvs tests, and msvc detection fixes #4453
Conversation
Updates: * Fix issue SCons#2755: the msvs tool no longer writes the OS environment SCONS_HOME value into the SCons environment when the SCONS_HOME variable already exists in the SCons environment. * Update the windows registry keys for detection of Visual Studio 2015 Express ('14.0Exp'): the VS2015 registry key ('WDExpress') appears to be different than the registry key ('VCExpress') for earlier Visual Studio express versions. * Fix the vs-6.0-exec.py test script: the msvs generated project is 'foo.dsp' and the command-line invocation of the Visual Studio development environment program was attempting to build 'test.dsp'. * Update the msvs project generation test scripts: the msvs project execution tests could produce a "false positive" test result when the test executable is correctly built via the SConstruct env.Program() call and the command-line invocation of the Visual Studio development environment program fails.
a6087b5
to
f9b68fe
Compare
test/MSVS/vs-10.0-exec.py
Outdated
@@ -90,6 +90,11 @@ | |||
|
|||
test.run(chdir='sub dir', arguments='.') | |||
|
|||
for filename in ('foo.exe', 'foo.obj', '.sconsign.dblite'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this into TestSConsMSVS
? rather than copy/pasting it into all the files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be a function that takes a list of files?
Something like:
test.remove_files(['foo.exe', 'foo.obj', 'sconsign.dblite'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does scons -c
not do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure it also removes the generated msvs project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the following be acceptable?
TestSConsMSVS.py
def unlink_files(self, filedir, filenames):
for filename in filenames:
filepath = self.workpath(filedir, filename)
if os.path.exists(filepath):
self.unlink(filepath)
test scripts:
test.unlink_files('sub dir', ['foo.exe', 'foo.obj', '.sconsign.dblite'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does scons -c not remove the files in question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that scons -c removes the generated msvs project which needs to be built from the command-line with the msdev binary. There will be no project to pass to the command-line after "scons -c" is run.
The sequence is:
- scons SConstruct (generates msvs project and builds program)
- delete program binaries
pathto\msdev.com foo.dsp
to build the program binaries via the generated workspace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha. ok so it's not about cleaning all the build products, but rather removing those which should be built when you have msvs run the created project file.
Ok. I'd add that method to TestCmd.py where there are currently other file handling functions, rather than TestSConsMSVS, as it could be useful for non MSVC tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes:
- Added rewritten
unlink_files
to TestCmd class with docstring and functionality consistent withunlink
method. - Replaced all msvs executable script deletion loops with single test method call.
- Reordered authors alphabetically in CHANGES.txt,
The following are all equivalent:
test.unlink_files('sub dir', ['foo.exe', 'foo.obj', '.sconsign.dblite'])
test.unlink_files(['sub dir'], ['foo.exe', 'foo.obj', '.sconsign.dblite'])
test.unlink_files('', [['sub dir', 'foo.exe'], ['sub dir', 'foo.obj'], ['sub dir', '.sconsign.dblite']])
test.unlink_files([''], [['sub dir', 'foo.exe'], ['sub dir', 'foo.obj'], ['sub dir', '.sconsign.dblite']])
test.unlink_files('.', [['sub dir', 'foo.exe'], ['sub dir', 'foo.obj'], ['sub dir', '.sconsign.dblite']])
test.unlink_files(['.'], [['sub dir', 'foo.exe'], ['sub dir', 'foo.obj'], ['sub dir', '.sconsign.dblite']])
…method calls in msvs executable test scripts, re-order CHANGES.txt.
No additional work is planned. |
Look good. Merging! |
Fixes:
SCONS_HOME
value into the SCons environment when theSCONS_HOME
variable already exists in the SCons environment.'14.0Exp'
): the VS2015 registry key (WDExpress
) appears to be different than the registry key (VCExpress
) for earlier Visual Studio express versions.vs-6.0-exec.py
test script: the msvs generated project isfoo.dsp
and the command-line invocation of the Visual Studio development environment program was attempting to buildtest.dsp
.env.Program()
call and the command-line invocation of the Visual Studio development environment program fails.unlink_files
toTestCmd
class that unlinks a list of files from a specified directory. Add test cases forunlink_files
toTestCmdtTests
.No documentation changes were necessary.
Contributor Checklist:
CHANGES.txt
(and read theREADME.rst
)