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
def test_getDependencies2(self): try: tempDir = mdTestUtilities.copyDirToTempDir("cases/cmake/hello/hello1") dependencies = cmake.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, [], "Wrong dependencies found in CMake project") finally: utilityFunctions.removeDir(tempDir)
def test_generateConfigureFiles(self): try: tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools/TestCaseA") success = autoTools.generateConfigureFiles(tempDir, "testCaseTarget", False) self.assertEquals(success, True, "Unable to generate configure files.") self.assertEquals(os.path.exists(os.path.join(tempDir, "configure")), True, "Configure files did not exist after calling generateConfigureFiles.") finally: utilityFunctions.removeDir(tempDir)
def test_getDependencies6(self): #False positive try: tempDir = mdTestUtilities.copyDirToTempDir("cases/cmake/hello/hello1") dependencies = autoTools.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, None, "Wrong dependencies found in AutoTools project") finally: utilityFunctions.removeDir(tempDir)
def test_getDependenciesFalse2(self): # False positive try: tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools/TestCaseB") dependencies = cmake.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, None, "Wrong dependencies found in CMake project") finally: utilityFunctions.removeDir(tempDir)
def test_getDependencies4(self): try: tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools/TestCaseD") success = autoTools.generateConfigureFiles(tempDir, "testCaseTarget", False) self.assertEquals(success, True, "Unable to generate build files.") dependencies = autoTools.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, [], "Wrong dependencies found in AutoTools project") finally: utilityFunctions.removeDir(tempDir)
def test_getDependencies2(self): try: tempDir = mdTestUtilities.copyDirToTempDir( "cases/cmake/hello/hello1") dependencies = cmake.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, [], "Wrong dependencies found in CMake project") finally: utilityFunctions.removeDir(tempDir)
def test_getDependencies6(self): #False positive try: tempDir = mdTestUtilities.copyDirToTempDir( "cases/cmake/hello/hello1") dependencies = autoTools.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, None, "Wrong dependencies found in AutoTools project") finally: utilityFunctions.removeDir(tempDir)
def test_getDependenciesFalse2(self): #False positive try: tempDir = mdTestUtilities.copyDirToTempDir( "cases/simpleGraphAutoTools/TestCaseB") dependencies = cmake.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, None, "Wrong dependencies found in CMake project") finally: utilityFunctions.removeDir(tempDir)
def test_getDependencies4(self): try: tempDir = mdTestUtilities.copyDirToTempDir( "cases/simpleGraphAutoTools/TestCaseD") success = autoTools.generateConfigureFiles(tempDir, "testCaseTarget", False) self.assertEquals(success, True, "Unable to generate build files.") dependencies = autoTools.getDependencies(tempDir, verbose=False) self.assertEquals(dependencies, [], "Wrong dependencies found in AutoTools project") finally: utilityFunctions.removeDir(tempDir)
def test_generateConfigureFiles(self): try: tempDir = mdTestUtilities.copyDirToTempDir( "cases/simpleGraphAutoTools/TestCaseA") success = autoTools.generateConfigureFiles(tempDir, "testCaseTarget", False) self.assertEquals(success, True, "Unable to generate configure files.") self.assertEquals( os.path.exists(os.path.join(tempDir, "configure")), True, "Configure files did not exist after calling generateConfigureFiles." ) finally: utilityFunctions.removeDir(tempDir)
def test_getDependencies3(self): try: tempDir = mdTestUtilities.copyDirToTempDir( "cases/cmake/ogre3dBuildFilesOnly") dependencies = cmake.getDependencies(tempDir, verbose=False) dependencies.sort() self.assertEquals(dependencies, [ 'boost', 'carbon', 'cg', 'cocoa', 'cppunit', 'd3d10', 'd3d11', 'd3d9', 'd3dcompiler', 'd3dx10', 'd3dx11', 'd3dx9', 'directx', 'dl', 'doxygen', 'dxerr', 'dxgi', 'dxguid', 'freeimage', 'freetype', 'iokit', 'iphonesdk', 'ois', 'opengl', 'opengles', 'opengles2', 'pkgconfig', 'poco', 'tbb', 'x11', 'xaw', 'zlib', 'zzip' ], "Wrong dependencies found in CMake project") finally: utilityFunctions.removeDir(tempDir)
def test_getDependencies3(self): try: tempDir = mdTestUtilities.copyDirToTempDir("cases/cmake/ogre3dBuildFilesOnly") dependencies = cmake.getDependencies(tempDir, verbose=False) dependencies.sort() self.assertEquals( dependencies, [ "boost", "carbon", "cg", "cocoa", "cppunit", "d3d10", "d3d11", "d3d9", "d3dcompiler", "d3dx10", "d3dx11", "d3dx9", "directx", "dl", "doxygen", "dxerr", "dxgi", "dxguid", "freeimage", "freetype", "iokit", "iphonesdk", "ois", "opengl", "opengles", "opengles2", "pkgconfig", "poco", "tbb", "x11", "xaw", "zlib", "zzip", ], "Wrong dependencies found in CMake project", ) finally: utilityFunctions.removeDir(tempDir)
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)