# Path: md/logger.py
# def secondsToHMS(seconds=0):
# def Logger():
# def setLogger(loggerName="", logOutputDir=""):
# def close():
# def writeMessage(message, targetName="", targetStep="", forceStdOut=False):
# def writeError(message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
# def reportSkipped(targetName="", targetStep="", reason=""):
# def reportStart(targetName="", targetStep=""):
# def reportSuccess(targetName="", targetStep="", timeInSeconds=0):
# def reportFailure(targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
# def getOutFd(targetName="", targetStep=""):
# def getErrorFd(targetName="", targetStep=""):
#     def _writeStdOut(self, message):
#     def _writeStdErr(self, message):
#     def close(self):
#     def writeMessage(self, message, targetName="", targetStep=""):
#     def writeError(self, message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
#     def reportSkipped(self, targetName="", targetStep="", reason=""):
#     def reportStart(self, targetName="", targetStep=""):
#     def reportSuccess(self, targetName="", targetStep="", timeInSeconds=0):
#     def reportFailure(self, targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
#     def getOutFd(self, targetName="", targetStep=""):
#     def getErrorFd(self, targetName="", targetStep=""):
# class LoggerBase(object):
# 
# Path: md/options.py
# class Options(object):
#     def __init__(self):
#     def __str__(self):
#     def targetSpecifiedToBuild(self, targetName):
#     def setStatusLogPath(self, prefix, projectName):
#     def validate(self):
#     def __validateOptionsDir(self, path):
#     def __processImportCommandline(self, commandline):
#     def __processProfileCommandline(self, commandline):
#     def processCommandline(self, commandline=[]):
#     def printUsageAndExit(self, errorStr=""):
#     def printUsage(self, errorStr=""):
# def validateOptionPair(flag, value):
# def validateOption(flag, value):
# 
# Path: md/overrides.py
# class OverrideGroup(dict):
#     def __init__(self):
#     def __str__(self):
#     def __contains__(self, key):
#     def __setitem__(self, key, value):
#     def __getitem__(self, key):
#     def combine(self, child):
# def readGroups(filename):
# def selectGroups(groups, overrideGroupNames):
# 
# Path: md/profiler.py
# def findExecutables(dirPairs, exeWildCards):
# def profile(mdOptions):
# def addGnuOptimizationGroup(groups, compilerGroup):
# def addIntelOptimizationGroup(groups, compilerGroup):
# def addPathscaleOptimizationGroup(groups, compilerGroup):
# def addPortlandGroupOptimizationGroup(groups, compilerGroup):
# 
# Path: md/utilityFunctions.py
# def boolToStr(s):
# def downloadFile(URL, downloadDir):
# def executeCommand(command, args="", workingDirectory="", verbose=False, exitOnError=False):
# def executeSubProcess(command, workingDirectory=tempfile.gettempdir(), outFileHandle=1, verbose=False, exitOnError=False):
# def findFilesWithExtension(path, extension):
# def findShallowestFile(startPath, fileList):
# def getBasename(path):
# def haveWriteAccess(path):
# def isURL(url):
# def __pathExists(directory, basename):
# def pathExists(path, forceCaseSensitive=False):
# def prettyPrintList(list, header="", headerIndent="", itemIndent=""):
# def printErrorAndExit(errorStr, filePath="", lineNumber=0):
# def removeDir(path):
# def removeDuplicatesFromList(myList):
# def splitFileName(fileName):
# def stripItemsInList(value):
# def untar(tarPath, outPath="", stripDir=False):
# def unzip(zipPath, outPath="", stripDir=False):
# def URLToFilename(url):
# def hasTarFileExtension(path):
# def validateCompressedFile(path, logger=None):
# def setVariables(filename, variableList):
# def is_exe(fpath):
# def isInstalled(program):


import os, sys, unittest, mdTestUtilities
from md import logger, options, overrides, profiler, utilityFunctions
    def test_findExecutables07(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()

            mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))

            aDir = os.path.join(tempDir, 'a')
            aGccExe = os.path.join(aDir, "gcc")
            mdTestUtilities.createBlankFile(aGccExe)
            mdTestUtilities.makeFileExecutable(aGccExe)

            bDir = os.path.join(tempDir, 'b')
            bIccExe = os.path.join(bDir, "icc")
            mdTestUtilities.createBlankFile(bIccExe)
            mdTestUtilities.makeFileExecutable(bIccExe)

            acDir = os.path.join(os.path.join(tempDir, 'a'), 'c')
            acIccExe = os.path.join(acDir, "icc")
            mdTestUtilities.createBlankFile(acIccExe)
            mdTestUtilities.makeFileExecutable(acIccExe)

            exes = profiler.findExecutables([(tempDir, True)], ["icc", "gcc"])
            self.assertEquals(len(exes), 3, "profiler.findExecutables did not find the right amount of executables")
            self.assertTrue(aGccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(bIccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(acIccExe in exes, "profiler.findExecutables did not find the right executable")
        finally:
            utilityFunctions.removeDir(tempDir)

    def test_addGnuOptimizationGroup01(self):

# Path: md/logger.py
# def secondsToHMS(seconds=0):
# def Logger():
# def setLogger(loggerName="", logOutputDir=""):
# def close():
# def writeMessage(message, targetName="", targetStep="", forceStdOut=False):
# def writeError(message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
# def reportSkipped(targetName="", targetStep="", reason=""):
# def reportStart(targetName="", targetStep=""):
# def reportSuccess(targetName="", targetStep="", timeInSeconds=0):
# def reportFailure(targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
# def getOutFd(targetName="", targetStep=""):
# def getErrorFd(targetName="", targetStep=""):
#     def _writeStdOut(self, message):
#     def _writeStdErr(self, message):
#     def close(self):
#     def writeMessage(self, message, targetName="", targetStep=""):
#     def writeError(self, message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
#     def reportSkipped(self, targetName="", targetStep="", reason=""):
#     def reportStart(self, targetName="", targetStep=""):
#     def reportSuccess(self, targetName="", targetStep="", timeInSeconds=0):
#     def reportFailure(self, targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
#     def getOutFd(self, targetName="", targetStep=""):
#     def getErrorFd(self, targetName="", targetStep=""):
# class LoggerBase(object):
# 
# Path: md/options.py
# class Options(object):
#     def __init__(self):
#     def __str__(self):
#     def targetSpecifiedToBuild(self, targetName):
#     def setStatusLogPath(self, prefix, projectName):
#     def validate(self):
#     def __validateOptionsDir(self, path):
#     def __processImportCommandline(self, commandline):
#     def __processProfileCommandline(self, commandline):
#     def processCommandline(self, commandline=[]):
#     def printUsageAndExit(self, errorStr=""):
#     def printUsage(self, errorStr=""):
# def validateOptionPair(flag, value):
# def validateOption(flag, value):
# 
# Path: md/overrides.py
# class OverrideGroup(dict):
#     def __init__(self):
#     def __str__(self):
#     def __contains__(self, key):
#     def __setitem__(self, key, value):
#     def __getitem__(self, key):
#     def combine(self, child):
# def readGroups(filename):
# def selectGroups(groups, overrideGroupNames):
# 
# Path: md/profiler.py
# def findExecutables(dirPairs, exeWildCards):
# def profile(mdOptions):
# def addGnuOptimizationGroup(groups, compilerGroup):
# def addIntelOptimizationGroup(groups, compilerGroup):
# def addPathscaleOptimizationGroup(groups, compilerGroup):
# def addPortlandGroupOptimizationGroup(groups, compilerGroup):
# 
# Path: md/utilityFunctions.py
# def boolToStr(s):
# def downloadFile(URL, downloadDir):
# def executeCommand(command, args="", workingDirectory="", verbose=False, exitOnError=False):
# def executeSubProcess(command, workingDirectory=tempfile.gettempdir(), outFileHandle=1, verbose=False, exitOnError=False):
# def findFilesWithExtension(path, extension):
# def findShallowestFile(startPath, fileList):
# def getBasename(path):
# def haveWriteAccess(path):
# def isURL(url):
# def __pathExists(directory, basename):
# def pathExists(path, forceCaseSensitive=False):
# def prettyPrintList(list, header="", headerIndent="", itemIndent=""):
# def printErrorAndExit(errorStr, filePath="", lineNumber=0):
# def removeDir(path):
# def removeDuplicatesFromList(myList):
# def splitFileName(fileName):
# def stripItemsInList(value):
# def untar(tarPath, outPath="", stripDir=False):
# def unzip(zipPath, outPath="", stripDir=False):
# def URLToFilename(url):
# def hasTarFileExtension(path):
# def validateCompressedFile(path, logger=None):
# def setVariables(filename, variableList):
# def is_exe(fpath):
# def isInstalled(program):


# Path: test/test_profiler.py
import os, sys, unittest, mdTestUtilities
from md import logger, options, overrides, profiler, utilityFunctions

    def test_findExecutables07(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()

            mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))

            aDir = os.path.join(tempDir, 'a')
            aGccExe = os.path.join(aDir, "gcc")
            mdTestUtilities.createBlankFile(aGccExe)
            mdTestUtilities.makeFileExecutable(aGccExe)

            bDir = os.path.join(tempDir, 'b')
            bIccExe = os.path.join(bDir, "icc")
            mdTestUtilities.createBlankFile(bIccExe)
            mdTestUtilities.makeFileExecutable(bIccExe)

            acDir = os.path.join(os.path.join(tempDir, 'a'), 'c')
            acIccExe = os.path.join(acDir, "icc")
            mdTestUtilities.createBlankFile(acIccExe)
            mdTestUtilities.makeFileExecutable(acIccExe)

            exes = profiler.findExecutables([(tempDir, True)], ["icc", "gcc"])
            self.assertEquals(len(exes), 3, "profiler.findExecutables did not find the right amount of executables")
            self.assertTrue(aGccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(bIccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(acIccExe in exes, "profiler.findExecutables did not find the right executable")
        finally:
            utilityFunctions.removeDir(tempDir)

    def test_addGnuOptimizationGroup01(self):

        compilerGroup = overrides.OverrideGroup()