Exemplo n.º 1
0
 def test_findExecutables02(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         testExe = os.path.join(tempDir, "gcc")
         mdTestUtilities.createBlankFile(testExe)
         mdTestUtilities.makeFileExecutable(testExe)
         exes = profiler.findExecutables([(tempDir, True)], ["gcc"])
         self.assertEquals(len(exes), 1, "profiler.findExecutables did not find the right amount of executables")
         self.assertEquals(exes[0], testExe, "profiler.findExecutables did not find the right executable")
     finally:
         utilityFunctions.removeDir(tempDir)
Exemplo n.º 2
0
 def test_findExecutables02(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         testExe = os.path.join(tempDir, "gcc")
         mdTestUtilities.createBlankFile(testExe)
         mdTestUtilities.makeFileExecutable(testExe)
         exes = profiler.findExecutables([(tempDir, True)], ["gcc"])
         self.assertEquals(
             len(exes), 1,
             "profiler.findExecutables did not find the right amount of executables"
         )
         self.assertEquals(
             exes[0], testExe,
             "profiler.findExecutables did not find the right executable")
     finally:
         utilityFunctions.removeDir(tempDir)
Exemplo n.º 3
0
    def test_findExecutables07(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()

            mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))

            aDir = os.path.join(tempDir, 'a')
            aGccExe = os.path.join(aDir, "gcc")
            mdTestUtilities.createBlankFile(aGccExe)
            mdTestUtilities.makeFileExecutable(aGccExe)

            bDir = os.path.join(tempDir, 'b')
            bIccExe = os.path.join(bDir, "icc")
            mdTestUtilities.createBlankFile(bIccExe)
            mdTestUtilities.makeFileExecutable(bIccExe)

            acDir = os.path.join(os.path.join(tempDir, 'a'), 'c')
            acIccExe = os.path.join(acDir, "icc")
            mdTestUtilities.createBlankFile(acIccExe)
            mdTestUtilities.makeFileExecutable(acIccExe)

            exes = profiler.findExecutables([(tempDir, True)], ["icc", "gcc"])
            self.assertEquals(len(exes), 3, "profiler.findExecutables did not find the right amount of executables")
            self.assertTrue(aGccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(bIccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(acIccExe in exes, "profiler.findExecutables did not find the right executable")
        finally:
            utilityFunctions.removeDir(tempDir)
Exemplo n.º 4
0
    def test_findExecutables07(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()

            mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))

            aDir = os.path.join(tempDir, 'a')
            aGccExe = os.path.join(aDir, "gcc")
            mdTestUtilities.createBlankFile(aGccExe)
            mdTestUtilities.makeFileExecutable(aGccExe)

            bDir = os.path.join(tempDir, 'b')
            bIccExe = os.path.join(bDir, "icc")
            mdTestUtilities.createBlankFile(bIccExe)
            mdTestUtilities.makeFileExecutable(bIccExe)

            acDir = os.path.join(os.path.join(tempDir, 'a'), 'c')
            acIccExe = os.path.join(acDir, "icc")
            mdTestUtilities.createBlankFile(acIccExe)
            mdTestUtilities.makeFileExecutable(acIccExe)

            exes = profiler.findExecutables([(tempDir, True)], ["icc", "gcc"])
            self.assertEquals(
                len(exes), 3,
                "profiler.findExecutables did not find the right amount of executables"
            )
            self.assertTrue(
                aGccExe in exes,
                "profiler.findExecutables did not find the right executable")
            self.assertTrue(
                bIccExe in exes,
                "profiler.findExecutables did not find the right executable")
            self.assertTrue(
                acIccExe in exes,
                "profiler.findExecutables did not find the right executable")
        finally:
            utilityFunctions.removeDir(tempDir)