def test_subversion(self):
        svnURL = "http://subversion.tigris.org/downloads/subversion-1.6.12.tar.bz2"
        aprURL = "http://mirror.candidhosting.com/pub/apache/apr/apr-1.4.6.tar.bz2"
        aprUtilURL = "http://mirror.candidhosting.com/pub/apache//apr/apr-util-1.3.12.tar.gz"
        neonURL = "http://www.webdav.org/neon/neon-0.29.5.tar.gz"
        sqliteURL = "http://www.sqlite.org/sqlite-autoconf-3070500.tar.gz"

        skipAPRPreconfig = ""
        if socket.gethostname() == "tux316.llnl.gov":
            skipAPRPreconfig = " -sapr:preconfig"
        try:
            mixDownPath = os.path.abspath("..")
            origPath = os.environ["PATH"]
            os.environ["PATH"] = mixDownPath + ":" + origPath

            tempDir = mdTestUtilities.makeTempDir()
            downloadDir = os.path.join(tempDir, "testDownloadFiles")

            svnPath = utilityFunctions.downloadFile(svnURL, downloadDir)
            self.assertNotEquals(svnPath, "", "Svn failed to download")

            aprPath = utilityFunctions.downloadFile(aprURL, downloadDir)
            self.assertNotEquals(aprPath, "", "Apr failed to download")

            aprUtilPath = utilityFunctions.downloadFile(
                aprUtilURL, downloadDir)
            self.assertNotEquals(aprUtilPath, "",
                                 "Apr Util failed to download")

            neonPath = utilityFunctions.downloadFile(neonURL, downloadDir)
            self.assertNotEquals(neonPath, "", "Neon failed to download")

            sqlitePath = utilityFunctions.downloadFile(sqliteURL, downloadDir)
            self.assertNotEquals(sqlitePath, "", "Sqlite failed to download")

            importRC = utilityFunctions.executeSubProcess(
                "mixdown --import " + svnPath + " " + aprPath + " " +
                aprUtilPath + " " + neonPath + " " + sqlitePath, tempDir)
            self.assertEquals(importRC, 0,
                              "Subversion test case failed import.")

            buildRC = utilityFunctions.executeSubProcess(
                "mixdown subversion-1.6.12.md -ptestPrefix" + skipAPRPreconfig,
                tempDir)
            self.assertEquals(buildRC, 0, "Subversion test case failed build.")

            cleanRC = utilityFunctions.executeSubProcess(
                "mixdown --clean subversion-1.6.12.md", tempDir)
            self.assertEquals(cleanRC, 0, "Subversion test case failed clean.")

            prefix = os.path.join(tempDir, "testPrefix")
            binDir = os.path.join(prefix, "bin")
            libDir = os.path.join(prefix, "lib")
            self.assertEquals(
                os.path.exists(os.path.join(binDir, "svn")), True,
                "Executable does not exist after building CMake Hello test case."
            )
        finally:
            utilityFunctions.removeDir(tempDir)
            os.environ["PATH"] = origPath
    def test_AutoToolsSimpleGraph(self):
        try:
            mixDownPath = os.path.abspath("..")
            origPath = os.environ["PATH"]
            os.environ["PATH"] = mixDownPath + ":" + origPath
            tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools")

            importRC = utilityFunctions.executeSubProcess("mixdown --import " + os.path.join(tempDir, "TestCaseA") + " " + os.path.join(tempDir, "TestCaseB") + " " + os.path.join(tempDir, "TestCaseC") + " " + os.path.join(tempDir, "TestCaseD"), tempDir)
            self.assertEquals(importRC, 0, "AutoTools Simple Graph test case failed import.")
            self.assertEquals(os.path.exists(os.path.join(tempDir, "TestCaseA.md")), True, "MixDown project file does not exist after importing AutoTools Simple Graph test case.")

            buildRC = utilityFunctions.executeSubProcess("mixdown TestCaseA.md -ptestPrefix", tempDir)
            self.assertEquals(buildRC, 0, "AutoTools Simple Graph test case failed build.")

            cleanRC = utilityFunctions.executeSubProcess("mixdown --clean TestCaseA.md", tempDir)
            self.assertEquals(cleanRC, 0, "AutoTools Simple Graph test case failed clean.")

            prefix = os.path.join(tempDir, "testPrefix")
            binDir = os.path.join(prefix, "bin")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseA")), True, "Executable A does not exist after building AutoTools Simple Graph test case.")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseB")), True, "Executable B does not exist after building AutoTools Simple Graph test case.")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseC")), True, "Executable C does not exist after building AutoTools Simple Graph test case.")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseD")), True, "Executable D does not exist after building AutoTools Simple Graph test case.")
        finally:
            utilityFunctions.removeDir(tempDir)
            os.environ["PATH"] = origPath
示例#3
0
    def test_subversion(self):
        svnURL = "http://subversion.tigris.org/downloads/subversion-1.6.12.tar.bz2"
        aprURL = "http://mirror.candidhosting.com/pub/apache/apr/apr-1.4.6.tar.bz2"
        aprUtilURL = "http://mirror.candidhosting.com/pub/apache//apr/apr-util-1.3.12.tar.gz"
        neonURL = "http://www.webdav.org/neon/neon-0.29.5.tar.gz"
        sqliteURL = "http://www.sqlite.org/sqlite-autoconf-3070500.tar.gz"

        skipAPRPreconfig = ""
        if socket.gethostname() == "tux316.llnl.gov":
            skipAPRPreconfig = " -sapr:preconfig"
        try:
            mixDownPath = os.path.abspath("..")
            origPath = os.environ["PATH"]
            os.environ["PATH"] = mixDownPath + ":" + origPath

            tempDir = mdTestUtilities.makeTempDir()
            downloadDir = os.path.join(tempDir, "testDownloadFiles")

            svnPath = utilityFunctions.downloadFile(svnURL, downloadDir)
            self.assertNotEquals(svnPath, "", "Svn failed to download")

            aprPath = utilityFunctions.downloadFile(aprURL, downloadDir)
            self.assertNotEquals(aprPath, "", "Apr failed to download")

            aprUtilPath = utilityFunctions.downloadFile(aprUtilURL, downloadDir)
            self.assertNotEquals(aprUtilPath, "", "Apr Util failed to download")

            neonPath = utilityFunctions.downloadFile(neonURL, downloadDir)
            self.assertNotEquals(neonPath, "", "Neon failed to download")

            sqlitePath = utilityFunctions.downloadFile(sqliteURL, downloadDir)
            self.assertNotEquals(sqlitePath, "", "Sqlite failed to download")

            importRC = utilityFunctions.executeSubProcess("mixdown --import " + svnPath + " " + aprPath + " " + aprUtilPath + " " + neonPath + " " + sqlitePath, tempDir)
            self.assertEquals(importRC, 0, "Subversion test case failed import.")

            buildRC = utilityFunctions.executeSubProcess("mixdown subversion-1.6.12.md -ptestPrefix" + skipAPRPreconfig, tempDir)
            self.assertEquals(buildRC, 0, "Subversion test case failed build.")

            cleanRC = utilityFunctions.executeSubProcess("mixdown --clean subversion-1.6.12.md", tempDir)
            self.assertEquals(cleanRC, 0, "Subversion test case failed clean.")

            prefix = os.path.join(tempDir, "testPrefix")
            binDir = os.path.join(prefix, "bin")
            libDir = os.path.join(prefix, "lib")
            self.assertEquals(os.path.exists(os.path.join(binDir, "svn")), True, "Executable does not exist after building CMake Hello test case.")
        finally:
            utilityFunctions.removeDir(tempDir)
            os.environ["PATH"] = origPath
示例#4
0
def createHgRepository(tempDir):
    repoPath = os.path.join(tempDir, "repo")
    os.mkdir(repoPath)
    utilityFunctions.executeSubProcess("hg init --quiet", repoPath)
    utilityFunctions.executeSubProcess("touch " + testFileName, repoPath)
    utilityFunctions.executeSubProcess("hg add --quiet " + testFileName, repoPath)
    utilityFunctions.executeSubProcess("hg commit -m message --quiet", repoPath)
    return repoPath
示例#5
0
def createGitRepository(tempDir):
    repoPath = os.path.join(tempDir, "repo")
    os.mkdir(repoPath)
    utilityFunctions.executeSubProcess("git init --quiet", repoPath)
    utilityFunctions.executeSubProcess("touch " + testFileName, repoPath)
    utilityFunctions.executeSubProcess("git add " + testFileName, repoPath)
    utilityFunctions.executeSubProcess("git commit -m message --quiet",
                                       repoPath)
    return repoPath
    def test_cmakeHello(self):
        try:
            mixDownPath = os.path.join(os.path.abspath(".."), "mixdown")
            tempDir = mdTestUtilities.copyDirToTempDir("cases/cmake/hello")

            importRC = utilityFunctions.executeSubProcess(mixDownPath + " --import " + os.path.join(tempDir, "main") + " " + os.path.join(tempDir, "hello1"), tempDir)
            self.assertEquals(importRC, 0, "CMake Hello test case failed import.")
            self.assertEquals(os.path.exists(os.path.join(tempDir, "main.md")), True, "MixDown project file does not exist after importing CMake Hello test case.")

            buildRC = utilityFunctions.executeSubProcess("mixdown main.md -ptestPrefix", tempDir)
            self.assertEquals(buildRC, 0, "CMake Hello test case failed build.")

            cleanRC = utilityFunctions.executeSubProcess("mixdown --clean main.md", tempDir)
            self.assertEquals(cleanRC, 0, "CMake Hello test case failed clean.")

            prefix = os.path.join(tempDir, "testPrefix")
            binDir = os.path.join(prefix, "bin")
            libDir = os.path.join(prefix, "lib")
            self.assertEquals(os.path.exists(os.path.join(binDir, "hello")), True, "Executable does not exist after building CMake Hello test case.")
            self.assertEquals(os.path.exists(os.path.join(libDir, "libhello1.a")), True, "Library does not exist after building CMake Hello test case.")
        finally:
            utilityFunctions.removeDir(tempDir)
示例#7
0
def createCvsRepository(tempDir):
    repoPath = os.path.join(tempDir, "repo")
    projPath = os.path.join(tempDir, "project")
    os.mkdir(repoPath)
    os.mkdir(projPath)

    utilityFunctions.executeSubProcess("cvs -d " + repoPath + " init", tempDir)
    utilityFunctions.executeSubProcess("touch " + testFileName, projPath)
    utilityFunctions.executeSubProcess("cvs -d " + repoPath + " -Q import -m message project vendor start", projPath)
    return repoPath
示例#8
0
def createSvnRepository(tempDir):
    repoPath = os.path.join(tempDir, "repo")
    os.mkdir(repoPath)
    repoURL = "file://" + repoPath + "/trunk"
    projPath = os.path.join(tempDir, "project")
    os.mkdir(projPath)

    utilityFunctions.executeSubProcess("svnadmin create " + repoPath, tempDir)
    utilityFunctions.executeSubProcess("touch testFile", projPath)
    utilityFunctions.executeSubProcess("svn import --quiet --non-interactive " + projPath + " " + repoURL + " -m message", tempDir)
    return repoURL
示例#9
0
def createCvsRepository(tempDir):
    repoPath = os.path.join(tempDir, "repo")
    projPath = os.path.join(tempDir, "project")
    os.mkdir(repoPath)
    os.mkdir(projPath)

    utilityFunctions.executeSubProcess("cvs -d " + repoPath + " init", tempDir)
    utilityFunctions.executeSubProcess("touch " + testFileName, projPath)
    utilityFunctions.executeSubProcess(
        "cvs -d " + repoPath + " -Q import -m message project vendor start",
        projPath)
    return repoPath
示例#10
0
def createSvnRepository(tempDir):
    repoPath = os.path.join(tempDir, "repo")
    os.mkdir(repoPath)
    repoURL = "file://" + repoPath + "/trunk"
    projPath = os.path.join(tempDir, "project")
    os.mkdir(projPath)

    utilityFunctions.executeSubProcess("svnadmin create " + repoPath, tempDir)
    utilityFunctions.executeSubProcess("touch testFile", projPath)
    utilityFunctions.executeSubProcess(
        "svn import --quiet --non-interactive " + projPath + " " + repoURL +
        " -m message", tempDir)
    return repoURL
示例#11
0
def createZipFile(tempDir):
    zipDir = os.path.join(tempDir, "zip")
    os.mkdir(zipDir)
    utilityFunctions.executeSubProcess("touch zip/" + testFileName, tempDir)
    utilityFunctions.executeSubProcess("zip -q -r test.zip ./zip", tempDir)
    return zipDir, "test.zip"
示例#12
0
def createBzipFile(tempDir):
    tarDir = os.path.join(tempDir, "tar")
    os.mkdir(tarDir)
    utilityFunctions.executeSubProcess("touch tar/" + testFileName, tempDir)
    utilityFunctions.executeSubProcess("tar -cjf test.tar.bz2 tar", tempDir)
    return tarDir, "test.tar.bz2"
示例#13
0
def createZipFile(tempDir):
    zipDir = os.path.join(tempDir, "zip")
    os.mkdir(zipDir)
    utilityFunctions.executeSubProcess("touch zip/" + testFileName, tempDir)
    utilityFunctions.executeSubProcess("zip -q -r test.zip ./zip", tempDir)
    return zipDir, "test.zip"
示例#14
0
def createBzipFile(tempDir):
    tarDir = os.path.join(tempDir, "tar")
    os.mkdir(tarDir)
    utilityFunctions.executeSubProcess("touch tar/" + testFileName, tempDir)
    utilityFunctions.executeSubProcess("tar -cjf test.tar.bz2 tar", tempDir)
    return tarDir, "test.tar.bz2"