[AHK_Helper_Functions]

Add nGetRevisionNumber() function to get revision number.

svn path=/trunk/ahk_tests/; revision=2023
This commit is contained in:
Edijs Kolesnikovičs 2013-05-04 15:43:09 +00:00
parent 762433947f
commit 4e7d2c77bc

View File

@ -28,6 +28,37 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
DetectHiddenText, Off ; Hidden text is not detected
nGetRevisionNumber()
{
; usage:
; nRevision := nGetRevisionNumber()
; Note: we can't use TestsFailed() here since Windows doesn't really have revision
result := 0
szApp = %A_WorkingDir%\Apps\Cap.exe ; Utility by Mysoft (Grégori Macário Harbs)
IfNotExist, %szApp%
TestsInfo("nGetRevisionNumber(): Can NOT find '" szApp "'.")
else
{
Run, %szApp% /silent /reg Software\ReactOS
SplitPath, szApp, ProcessName
Process, WaitClose, %ProcessName%, 4
if ErrorLevel
{
bTerminateProcess(ProcessName)
TestsInfo("nGetRevisionNumber(): Process '" ProcessName "' failed to close.")
}
else
{
RegRead, result, HKEY_CURRENT_USER, Software\ReactOS, Revision
if ErrorLevel
TestsInfo("nGetRevisionNumber(): Unable to read HKCU\Software\ReactOS, Revision.")
}
}
return result
}
bTerminateProcess(szProcess)
{
global TestsTotal