MantisBT - CMake
View Issue Details
0013844CMakeCTestpublic2013-01-10 07:292016-06-10 14:31
Ingmar Voigt 
Kitware Robot 
normalminoralways
closedmoved 
WindowsXP SP1
CMake 2.8.3 
 
0013844: PurifyPlus 7.0.1-003 cannot properly interpret SAVETEXTDATA command line switch due to quotation marks
PROBLEM:
----------------------------

This started with PurifyPlus 7.0.1-003 - PurifyPlus 7.0.0 did not show such behaviour. The solution should however work for both

CTest 2.8.3 memchecker produces on Windows the following command line to execute Purify (extracted from my logs):

C:\Progra~1\IBM\RationalPurifyPlus\purify.exe "/SAVETEXTDATA=D:/MyBinDir/Testing/Temporary/MemoryChecker.log" "D:/MyBinDir/bin/Debug/MyTest.exe"

When executing this Purify 7.0.1-003 complains the following way:

Unable to find file /SAVETEXTDATA=D:/MyBinDir/Testing/Temporary/MemoryChecker.log.


The reason is the command line /SAVETEXTDATA=... is wrapped in quotation marks

"/SAVETEXTDATA=D:/MyBinFolder/Testing/Temporary/MemoryChecker.log"

the problem does not occur when changing the command line by shift the quotation mark after the equal sign:

/SAVETEXTDATA="D:/MyBinFolder/Testing/Temporary/MemoryChecker.log"

SOLUTION:
----------------------------
use

/SAVETEXTDATA="D:/MyBinFolder/Testing/Temporary/MemoryChecker.log"

instead of

"/SAVETEXTDATA=D:/MyBinFolder/Testing/Temporary/MemoryChecker.log"

i.e.

C:\Progra~1\IBM\RationalPurifyPlus\purify.exe /SAVETEXTDATA="D:/MyBinFolder/Testing/Temporary/MemoryChecker.log" "D:/MyBinFolder/bin/Debug/MyTest.exe"
Execute PurifyPlus 7.0.1-003

C:\Progra~1\IBM\RationalPurifyPlus\purify.exe "/SAVETEXTDATA=D:/MyBinFolder/Testing/Temporary/MemoryChecker.log" "D:/MyBinFolder/bin/Debug/MyTest.exe"

and try again with

C:\Progra~1\IBM\RationalPurifyPlus\purify.exe /SAVETEXTDATA="D:/MyBinFolder/Testing/Temporary/MemoryChecker.log" "D:/MyBinFolder/bin/Debug/MyTest.exe"
From the CTest logs:


Memory check command: C:\Progra~1\IBM\RationalPurifyPlus\purify.exe "/SAVETEXTDATA=D:/MyBinDir/Testing/Temporary/MemoryChecker.log"

149: MemCheck command: C:\Progra~1\IBM\RationalPurifyPlus\purify.exe "/SAVETEXTDATA=D:/MyBinDir/Testing/Temporary/MemoryChecker.log" "D:/MyBinDir/bin/Debug/MyTest.exe"
No tags attached.
? purify.bat (288) 2013-01-24 16:50
https://public.kitware.com/Bug/file/4625/purify.bat
Issue History
2013-01-10 07:29Ingmar VoigtNew Issue
2013-01-24 16:50Ingmar VoigtFile Added: purify.bat
2013-01-24 16:52Ingmar VoigtNote Added: 0032163
2016-06-10 14:28Kitware RobotNote Added: 0042198
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0032163)
Ingmar Voigt   
2013-01-24 16:52   
I was able to workaround the problem with the following batch file (also attached) - pointing CTEST_MEMORYCHECK_COMMAND to this instead made it work in the end



@echo off
@setlocal

rem strip quotes from /SAVETEXTDATA argment
REM set str="%1=%2"
REM for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a

set PURIFY_PATH="C:\Program Files\IBM\RationalPurifyPlus\purify.exe"
echo calling %PURIFY_PATH% %*
%PURIFY_PATH% %*

@endlocal
(0042198)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.