# 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/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/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/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, textwrap, unittest, mdTestUtilities
from md import logger, overrides, options, utilityFunctions

        finalGroup = overrides.selectGroups(groupList, mdOptions)
        self.assertEquals(fullCount(group1), 2, "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals("test" in group1, True, "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals(group1["test"], "value1", "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals("group1Only" in group1, True, "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals(group1["group1Only"], "group1OnlyValue", "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals(fullCount(group2), 2, "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals("test" in group2, True, "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals(group2["test"], "value2", "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals("group2Only" in group2, True, "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals(group2["group2Only"], "group2OnlyValue", "After selectGroups(), group2 was incorrectly altered")

    def test_selectGroups04(self):
        mdOptions = options.Options()
        mdOptions.compilerGroupName = "compiler1"
        mdOptions.optimizationGroupName = "optimization1"
        mdOptions.parallelGroupName = "parallel1"
        mdOptions.overrideFile = "testNOREALFILE"

        groupList = []

        group1 = overrides.OverrideGroup()
        group1.compiler = "compiler1"
        group1.optimization = "*"
        group1.parallel = "*"
        group1["test"] = "value1"
        group1["group1Only"] = "group1OnlyValue"
        groupList.append(group1)


# 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/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/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/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_overrides.py
import os, sys, textwrap, unittest, mdTestUtilities
from md import logger, overrides, options, utilityFunctions


        finalGroup = overrides.selectGroups(groupList, mdOptions)
        self.assertEquals(fullCount(group1), 2, "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals("test" in group1, True, "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals(group1["test"], "value1", "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals("group1Only" in group1, True, "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals(group1["group1Only"], "group1OnlyValue", "After selectGroups(), group1 was incorrectly altered")
        self.assertEquals(fullCount(group2), 2, "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals("test" in group2, True, "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals(group2["test"], "value2", "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals("group2Only" in group2, True, "After selectGroups(), group2 was incorrectly altered")
        self.assertEquals(group2["group2Only"], "group2OnlyValue", "After selectGroups(), group2 was incorrectly altered")

    def test_selectGroups04(self):
        mdOptions = options.Options()
        mdOptions.compilerGroupName = "compiler1"
        mdOptions.optimizationGroupName = "optimization1"
        mdOptions.parallelGroupName = "parallel1"
        mdOptions.overrideFile = "testNOREALFILE"

        groupList = []

        group1 = overrides.OverrideGroup()
        group1.compiler = "compiler1"
        group1.optimization = "*"
        group1.parallel = "*"
        group1["test"] = "value1"
        group1["group1Only"] = "group1OnlyValue"
        groupList.append(group1)


        group2 = overrides.OverrideGroup()