mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-23 17:57:45 +02:00
BaseTools: Update Tests/TestTools.py to allow it to work on Windows
On Windows, executables have a '.exe' suffix which needs to be added for them to be found in a path. Also, files need to be explicitly opened as binary. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
This commit is contained in:
parent
1b765a0b7c
commit
ac593ee4d7
@ -109,6 +109,8 @@ class BaseToolsTest(unittest.TestCase):
|
|||||||
else: logFile = None
|
else: logFile = None
|
||||||
|
|
||||||
if toolName is None: toolName = self.toolName
|
if toolName is None: toolName = self.toolName
|
||||||
|
if sys.platform == "win32":
|
||||||
|
toolName += ".exe"
|
||||||
bin = self.FindToolBin(toolName)
|
bin = self.FindToolBin(toolName)
|
||||||
if logFile is not None:
|
if logFile is not None:
|
||||||
logFile = open(os.path.join(self.testDir, logFile), 'w')
|
logFile = open(os.path.join(self.testDir, logFile), 'w')
|
||||||
@ -135,7 +137,7 @@ class BaseToolsTest(unittest.TestCase):
|
|||||||
return open(os.path.join(self.testDir, fileName), mode)
|
return open(os.path.join(self.testDir, fileName), mode)
|
||||||
|
|
||||||
def ReadTmpFile(self, fileName):
|
def ReadTmpFile(self, fileName):
|
||||||
f = open(self.GetTmpFilePath(fileName), 'r')
|
f = open(self.GetTmpFilePath(fileName), 'rb')
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
return data
|
return data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user