예제 #1
0
    def test_examineWithAutoToolsWithPrefix(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()
            targetDir = os.path.join(tempDir, "targetDir")
            os.makedirs(targetDir)
            mdTestUtilities.createBlankFiles(targetDir,
                                             ["Makefile.am", "configure.ac"])
            option = options.Options()
            defines.setPrefixDefines(option.defines, "/test/prefix")
            option.prefixDefined = True
            option.buildDir = os.path.join(tempDir, option.buildDir)
            option.importMode = True

            targets = target.Target("AutoTools", targetDir)
            targets.examine(option)
            targets.expandDefines(option)
            self.assertEquals(
                targets.findBuildStep("preconfig").command,
                "test -x configure || autoreconf -i",
                "Target with autotool files returned wrong preconfig command")
            self.assertEquals(
                targets.findBuildStep("config").command,
                "./configure --prefix=/test/prefix",
                "Target with autotool files returned wrong config command")
            self.assertEquals(
                targets.findBuildStep("build").command, "make",
                "Target with autotool files returned wrong build command")
            self.assertEquals(
                targets.findBuildStep("install").command, "make install",
                "Target with autotool files returned wrong install command")
        finally:
            utilityFunctions.removeDir(tempDir)
예제 #2
0
    def test_examineWithDependenciesWithPrefix(self):
        option = options.Options()
        option.buildDir = "."
        option.importMode = True
        defines.setPrefixDefines(option.defines, "/test/path")
        option.prefixDefined = True

        targets = target.Target("TestCaseA",
                                "cases/simpleGraphAutoTools/TestCaseA")
        targets.dependsOn = ["TestCaseB", "TestCaseC"]
        targets.examine(option)
        targets.expandDefines(option)
        self.assertEquals(
            targets.findBuildStep("preconfig").command,
            "test -x configure || autoreconf -i",
            "'cases/simpleGraphAutoTools/TestCaseA' returned wrong preconfig command"
        )
        self.assertEquals(
            targets.findBuildStep("config").command,
            "./configure --prefix=/test/path  --with-TestCaseB=/test/path --with-TestCaseC=/test/path",
            "'cases/simpleGraphAutoTools/TestCaseA' returned wrong config command"
        )
        self.assertEquals(
            targets.findBuildStep("build").command, "make",
            "'cases/simpleGraphAutoTools/TestCaseA' returned wrong build command"
        )
        self.assertEquals(
            targets.findBuildStep("install").command, "make install",
            "'cases/simpleGraphAutoTools/TestCaseA' returned wrong install command"
        )
예제 #3
0
    def test_examineWithDependenciesWithPrefix(self):
        option = options.Options()
        option.buildDir = "."
        option.importMode = True
        defines.setPrefixDefines(option.defines, "/test/path")
        option.prefixDefined = True

        targets = target.Target("TestCaseA", "cases/simpleGraphAutoTools/TestCaseA")
        targets.dependsOn = ["TestCaseB", "TestCaseC"]
        targets.examine(option)
        targets.expandDefines(option)
        self.assertEquals(targets.findBuildStep("preconfig").command, "test -x configure || autoreconf -i", "'cases/simpleGraphAutoTools/TestCaseA' returned wrong preconfig command")
        self.assertEquals(targets.findBuildStep("config").command, "./configure --prefix=/test/path  --with-TestCaseB=/test/path --with-TestCaseC=/test/path", "'cases/simpleGraphAutoTools/TestCaseA' returned wrong config command")
        self.assertEquals(targets.findBuildStep("build").command, "make", "'cases/simpleGraphAutoTools/TestCaseA' returned wrong build command")
        self.assertEquals(targets.findBuildStep("install").command, "make install", "'cases/simpleGraphAutoTools/TestCaseA' returned wrong install command")
예제 #4
0
    def test_examineWithAutoToolsWithPrefix(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()
            targetDir = os.path.join(tempDir, "targetDir")
            os.makedirs(targetDir)
            mdTestUtilities.createBlankFiles(targetDir, ["Makefile.am", "configure.ac"])
            option = options.Options()
            defines.setPrefixDefines(option.defines, "/test/prefix")
            option.prefixDefined = True
            option.buildDir = os.path.join(tempDir, option.buildDir)
            option.importMode = True

            targets = target.Target("AutoTools", targetDir)
            targets.examine(option)
            targets.expandDefines(option)
            self.assertEquals(targets.findBuildStep("preconfig").command, "test -x configure || autoreconf -i", "Target with autotool files returned wrong preconfig command")
            self.assertEquals(targets.findBuildStep("config").command, "./configure --prefix=/test/prefix", "Target with autotool files returned wrong config command")
            self.assertEquals(targets.findBuildStep("build").command, "make", "Target with autotool files returned wrong build command")
            self.assertEquals(targets.findBuildStep("install").command, "make install", "Target with autotool files returned wrong install command")
        finally:
            utilityFunctions.removeDir(tempDir)