Exemple #1
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)
Exemple #2
0
 def test_findExecutables06(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         testExe = os.path.join(tempDir, "gcc")
         mdTestUtilities.createBlankFile(testExe)
         mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))
         exes = profiler.findExecutables([(tempDir, True)], ["gcc"])
         self.assertEquals(len(exes), 0, "profiler.findExecutables did not find the right amount of executables")
     finally:
         utilityFunctions.removeDir(tempDir)
Exemple #3
0
 def test_findExecutables06(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         testExe = os.path.join(tempDir, "gcc")
         mdTestUtilities.createBlankFile(testExe)
         mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))
         exes = profiler.findExecutables([(tempDir, True)], ["gcc"])
         self.assertEquals(
             len(exes), 0,
             "profiler.findExecutables did not find the right amount of executables"
         )
     finally:
         utilityFunctions.removeDir(tempDir)
Exemple #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)