# Path: md/defines.py
# class Defines(dict):
#     def __contains__(self, key):
#     def __setitem__(self, key, value):
#     def __getitem__(self, key):
#     def combine(self, overridingDefines):
#     def expand(self, inString):
# def normalizeKey(key, lower=True):
# def surround(name):
# def setOverrideDefines(defs, overrideGroup):
# def __setToolDefines(defs, overrideGroup):
# def __setFlagDefines(defs, overrideGroup):
# def setJobSlotsDefines(defs, jobSlots):
# def setPrefixDefines(defs, prefix):
# 
# 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/project.py
# class Project(object):
#     def __init__(self, projectFilePath, targets=[]):
#     def determineStartPoint(self):
#     def determineTargetsBuildStepStart(self):
#     def determineTargetsSuccess(self):
#     def writeStatusLog(self, options):
#     def __getStatusLogLine(self, fd, lineCount):
#     def __assureEqualsInStatusLog(self, l, name, value):
#     def readStatusLog(self, options):
#     def addSkipStepFromOptions(self, options):
#     def validate(self, options):
#     def examine(self, options):
#     def __addTarget(self, targets, lineCount=0):
#     def getTarget(self, targetName):
#     def replaceTarget(self, newTarget):
#     def setTargetFieldsAsDefines(self, defines):
#     def read(self):
#     def write(self, fileName=""):
#     def __str__(self):
#     def __validateDependsOnLists(self):
#     def __searchPathsForCycles(self, path):
#     def __assignDepthToTargetList(self):
#     def __sortTargetList(self, targetList):
#     def __expandDependancyLists(self):
# 
# 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 defines, logger, options, project, utilityFunctions
    def test_validateMultiTargetProjectWithStepsAndDependencies(self):
        projectFileContents = textwrap.dedent("""
                                            Name: a
                                            Path: a-1.11.tar.gz
                                            DependsOn: b
                                            PreConfig: autoreconf -i
                                            Config: ./configure --prefix=$(_prefix) --with-b=$(_prefix) --with-c=$(_prefix)
                                            Build: make
                                            Install: make install

                                            Name: b
                                            Path: b-2.22.tar.gz
                                            DependsOn: c
                                            PreConfig: bautoreconf -i
                                            Config: ./configure --prefix=$(_prefix) --with-c=$(_prefix)
                                            Build: bmake
                                            Install: bmake install

                                            Name: c
                                            Path: c-3.33.tar.gz
                                            PreConfig: cautoreconf -i
                                            Config: ./configure --prefix=$(_prefix)
                                            Build: cmake
                                            Install: cmake install
                                            """)
        try:
            tempDir = mdTestUtilities.makeTempDir()
            projectFilePath = mdTestUtilities.makeTempFile(tempDir, projectFileContents, ".md")
            myProject = project.Project(projectFilePath)
            option = options.Options()

# Path: md/defines.py
# class Defines(dict):
#     def __contains__(self, key):
#     def __setitem__(self, key, value):
#     def __getitem__(self, key):
#     def combine(self, overridingDefines):
#     def expand(self, inString):
# def normalizeKey(key, lower=True):
# def surround(name):
# def setOverrideDefines(defs, overrideGroup):
# def __setToolDefines(defs, overrideGroup):
# def __setFlagDefines(defs, overrideGroup):
# def setJobSlotsDefines(defs, jobSlots):
# def setPrefixDefines(defs, prefix):
# 
# 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/project.py
# class Project(object):
#     def __init__(self, projectFilePath, targets=[]):
#     def determineStartPoint(self):
#     def determineTargetsBuildStepStart(self):
#     def determineTargetsSuccess(self):
#     def writeStatusLog(self, options):
#     def __getStatusLogLine(self, fd, lineCount):
#     def __assureEqualsInStatusLog(self, l, name, value):
#     def readStatusLog(self, options):
#     def addSkipStepFromOptions(self, options):
#     def validate(self, options):
#     def examine(self, options):
#     def __addTarget(self, targets, lineCount=0):
#     def getTarget(self, targetName):
#     def replaceTarget(self, newTarget):
#     def setTargetFieldsAsDefines(self, defines):
#     def read(self):
#     def write(self, fileName=""):
#     def __str__(self):
#     def __validateDependsOnLists(self):
#     def __searchPathsForCycles(self, path):
#     def __assignDepthToTargetList(self):
#     def __sortTargetList(self, targetList):
#     def __expandDependancyLists(self):
# 
# 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_project.py
import os, sys, textwrap, unittest, mdTestUtilities
from md import defines, logger, options, project, utilityFunctions

    def test_validateMultiTargetProjectWithStepsAndDependencies(self):
        projectFileContents = textwrap.dedent("""
                                            Name: a
                                            Path: a-1.11.tar.gz
                                            DependsOn: b
                                            PreConfig: autoreconf -i
                                            Config: ./configure --prefix=$(_prefix) --with-b=$(_prefix) --with-c=$(_prefix)
                                            Build: make
                                            Install: make install

                                            Name: b
                                            Path: b-2.22.tar.gz
                                            DependsOn: c
                                            PreConfig: bautoreconf -i
                                            Config: ./configure --prefix=$(_prefix) --with-c=$(_prefix)
                                            Build: bmake
                                            Install: bmake install

                                            Name: c
                                            Path: c-3.33.tar.gz
                                            PreConfig: cautoreconf -i
                                            Config: ./configure --prefix=$(_prefix)
                                            Build: cmake
                                            Install: cmake install
                                            """)
        try:
            tempDir = mdTestUtilities.makeTempDir()
            projectFilePath = mdTestUtilities.makeTempFile(tempDir, projectFileContents, ".md")
            myProject = project.Project(projectFilePath)
            option = options.Options()

            defines.setPrefixDefines(option.defines, os.path.abspath(os.path.join(tempDir, "prefix")))