Exemplo n.º 1
0
    def getTitle(self):
        title = "Tests: "
        if self.testSuiteSelection:
            # We don't care about totals with test suites
            title += plugins.pluralise(self.nofSelectedTests, "suite") + " selected"
            if self.nofDistinctSelectedTests != self.nofSelectedTests:
                title += ", " + str(self.nofDistinctSelectedTests) + " distinct"
            return title
        
        if self.nofSelectedTests == self.totalNofTests:
            title += "All " + str(self.totalNofTests) + " selected"
        else:
            title += str(self.nofSelectedTests) + "/" + str(self.totalNofTests) + " selected"

        if not self.dynamic:
            if self.totalNofDistinctTests != self.totalNofTests:
                if self.nofDistinctSelectedTests == self.totalNofDistinctTests:
                    title += ", all " + str(self.totalNofDistinctTests) + " distinct"
                else:
                    title += ", " + str(self.nofDistinctSelectedTests) + "/" + str(self.totalNofDistinctTests) + " distinct"

        if self.totalNofTestsShown == self.totalNofTests:
            if self.dynamic and self.totalNofTests > 0:
                title += ", none hidden"
        elif self.totalNofTestsShown == 0:
            title += ", all hidden"
        else:
            title += ", " + str(self.totalNofTests - self.totalNofTestsShown) + " hidden"

        return title
Exemplo n.º 2
0
 def computeFor(self, test, ignoreMissing=False):
     self.makeComparisons(test, ignoreMissing)
     self.categorise()
     rerunCount = self.getRerunCount(test)
     if rerunCount and self.hasSucceeded():
         self.briefText = "after " + plugins.pluralise(rerunCount, "rerun")
     test.changeState(self)
Exemplo n.º 3
0
def getTimeDescription(seconds):
    values = list(time.gmtime(seconds)[2:6])
    values[0] -= 1 # not actually using timedelta which doesn't support formatting...
    units = [ "day", "hour", "minute", "second" ]
    parts = []
    for unit, val in zip(units, values):
        if val:
            parts.append(plugins.pluralise(val, unit))

    if len(parts) > 0:
        description = " and ".join(parts).replace(" and ", ", ", len(parts) - 2)
    else:
        description = "Less than 1 second"
    return description
Exemplo n.º 4
0
def describePerformance(fileName):
    line = open(fileName).readline().strip()
    if "mem" in os.path.basename(fileName):
        return line
    
    # Assume seconds
    perf = getPerformanceFromLine(line)
    values = list(time.gmtime(perf)[2:6])
    values[0] -= 1 # not actually using timedelta which doesn't support formatting...
    units = [ "day", "hour", "minute", "second" ]
    parts = []
    for unit, val in zip(units, values):
        if val:
            parts.append(plugins.pluralise(val, unit))

    if len(parts) > 0:
        description = " and ".join(parts).replace(" and ", ", ", len(parts) - 2)
    else:
        description = "Less than 1 second"
    return line.replace(str(perf) + " sec.", description)
Exemplo n.º 5
0
 def messageAfterPerform(self):
     if self.latestNumberOfRecomputations == 0:
         return "No test needed recomputation."
     else:
         return "Recomputed status of " + plugins.pluralise(self.latestNumberOfRecomputations, "test") + "."
Exemplo n.º 6
0
 def getFinalMessage(self, latestTestCount):
     if latestTestCount == 0:
         return "No test needed recomputation."
     else:
         return "Recomputed status of " + plugins.pluralise(latestTestCount, "test") + "."
Exemplo n.º 7
0
 def messageAfterPerform(self):
     if self.latestTestCount == 0:
         return "No test was split."
     else:
         return "Split result files for " + plugins.pluralise(self.latestTestCount, "test") + "."
Exemplo n.º 8
0
 def addAdditionalText(self, test):
     rerunCount = self.getRerunCount(test)
     if rerunCount and self.hasSucceeded():
         self.briefText = "after " + plugins.pluralise(rerunCount, "rerun")