예제 #1
0
    def wantFile(self, file):
        """Is the file a wanted test file?

        The file must be an executable module registered as compiled test runner
        or a python source file. Last should be held by parent selector class.
        """
        if not (self.compiledRoot and pathStartsWith(file, self.compiledRoot)):
            log.debug("File %s will have default processing:", file)
            log.debug("self.compiledRoot is %s", self.compiledRoot)
            return nose.selector.Selector.wantFile(self, file)
        registrar = TestRunnerRegistrar(self.compiledRoot, self.config.options.build_config, Selector.tags)
        log.debug("Selector.wantFile(): Selector.tags='%s'" % Selector.tags)
        wanted = isFileNameInItems(file)
        if wanted:
            log.debug("File %s: wanted is %s", file, wanted)
            return wanted 
예제 #2
0
파일: selector.py 프로젝트: dhh1128/sandman
    def wantFile(self, file):
        """Is the file a wanted test file?

        The file must be an executable module registered as compiled test runner
        or a python source file. Last should be held by parent selector class.
        """
        if not (self.compiledRoot and pathStartsWith(file, self.compiledRoot)):
            log.debug("File %s will have default processing:", file)
            log.debug("self.compiledRoot is %s", self.compiledRoot)
            return nose.selector.Selector.wantFile(self, file)
        registrar = TestRunnerRegistrar(self.compiledRoot,
                                        self.config.options.build_config,
                                        Selector.tags)
        log.debug("Selector.wantFile(): Selector.tags='%s'" % Selector.tags)
        wanted = isFileNameInItems(file)
        if wanted:
            log.debug("File %s: wanted is %s", file, wanted)
            return wanted
예제 #3
0
 def loadTestsFromFile(self, filename):
     log.debug("CTestTestLoader.loadTestsFromFile(%s)", filename)
     doesStartWith = False
     try:
         doesStartWith = pathStartsWith(filename, self.compiledTestsRoot)
     except:
         doesStartWith = False
     if not doesStartWith:
         log.debug("CTestTestLoader.loadTestsFromFile(): fall back to predefined behavior")
         return TestLoader.loadTestsFromFile(self, filename)
     tests = list()
     tagset = set(self.tags.split(','))
     testRunnerInfo = getItemByFileName(filename)
     log.debug("testRunnerInfo now is: %s", repr(testRunnerInfo))
     if testRunnerInfo:
         tests = testRunnerInfo.tests
     log.debug("CTestTestLoader.loadTestsFromFile(): have tests: '%s'" % tests)
     loadedTests = self.makeTestCases(filename, tests, testRunnerInfo.env)
     log.debug("CTestTestLoader.loadTestsFromFile(%s): loaded tests %s",
               filename, loadedTests)
     log.debug("CTestTestLoader.loadTestsFromFile(): suite class is %s",
                repr(self.suiteClass))
     return self.suiteClass(loadedTests)