Exemple #1
0
    def processResults(self, moose_dir, retcode, options, output):
        reason = ''
        specs = self.specs

        # Expected errors and assertions might do a lot of things including crash so we
        # will handle them seperately
        if specs.isValid('expect_err'):
            if not util.checkOutputForPattern(output, specs['expect_err']):
                reason = 'NO EXPECTED ERR'
        elif specs.isValid('expect_assert'):
            if options.method == 'dbg':  # Only check asserts in debug mode
                if not util.checkOutputForPattern(output,
                                                  specs['expect_assert']):
                    reason = 'NO EXPECTED ASSERT'

        if reason == '':
            output = RunApp.processResults(self, moose_dir, retcode, options,
                                           output)

        if reason != '':
            self.setStatus(reason, self.bucket_fail)
        else:
            self.setStatus(self.success_message, self.bucket_success)

        return output
Exemple #2
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    specs = self.specs
    if reason != '' or specs['skip_checks']:
      return (reason, output)

    if reason == '':
     # if still no errors, check other files (just for existence)
     for file in self.specs['check_files']:
       if not os.path.isfile(os.path.join(self.specs['test_dir'], file)):
         reason = 'MISSING FILES'
         break
     for file in self.specs['check_not_exists']:
       if os.path.isfile(os.path.join(self.specs['test_dir'], file)):
         reason = 'UNEXPECTED FILES'
         break

     # if still no errors, check that all the files contain the file_expect_out expression
     if reason == '':
       if self.specs.isValid('file_expect_out'):
         for file in self.specs['check_files']:
           fid = open(os.path.join(self.specs['test_dir'], file), 'r')
           contents = fid.read()
           fid.close()
           if not self.checkOutputForPattern(contents, self.specs['file_expect_out']):
             reason = 'NO EXPECTED OUT IN FILE'
             break

    return (reason, output)
Exemple #3
0
 def processResults(self, moose_dir, retcode, options, output):
   if self.httpServer.getNumberOfPosts() != int(self.nPosts):
      return ("ICEUpdater FAILED: DID NOT GET CORRECT NUMBER OF POSTS",
              "Number of Posts was " + str(self.httpServer.getNumberOfPosts()) +
              ", but should have been " + str(self.nPosts))
   else:
      return RunApp.processResults(self, moose_dir, retcode, options, output)
Exemple #4
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    specs = self.specs
    if reason != '' or specs['skip_checks']:
      return (reason, output)

    if reason == '':
     # if still no errors, check other files (just for existence)
     for file in self.specs['check_files']:
       if not os.path.isfile(os.path.join(self.specs['test_dir'], file)):
         reason = 'MISSING FILES'
         break
     for file in self.specs['check_not_exists']:
       if os.path.isfile(os.path.join(self.specs['test_dir'], file)):
         reason = 'UNEXPECTED FILES'
         break

     # if still no errors, check that all the files contain the file_expect_out expression
     if reason == '':
       if self.specs.isValid('file_expect_out'):
         for file in self.specs['check_files']:
           fid = open(os.path.join(self.specs['test_dir'], file), 'r')
           contents = fid.read()
           fid.close()
           if not self.checkOutputForPattern(contents, self.specs['file_expect_out']):
             reason = 'NO EXPECTED OUT IN FILE'
             break

    return (reason, output)
Exemple #5
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    if reason != '' or self.specs['skip_checks']:
      return (reason, output)

    # Don't Run Exodiff on Scaled Tests
    if options.scaling and self.specs['scale_refine']:
      return (reason, output)

    # Make sure that all of the Exodiff files are actually available
    for file in self.specs['txtdiff']:
      if not os.path.exists(os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file)):
        output += "File Not Found: " + os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file)
        reason = 'MISSING GOLD FILE'
        break

    # Run the txtdiff
    if reason == '':
      output += 'Running txtdiff'
      with open(os.path.join(self.specs['test_dir'], file), 'r') as f:
        first_line = f.readline()
      with open(os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file), 'r') as f:
        first_line_gold = f.readline()
      if first_line != first_line_gold:
        reason = 'TXTDIFF'

    return (reason, output)
Exemple #6
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    specs = self.specs
    if reason != '' or specs['skip_checks']:
      return (reason, output)

    # Don't Run Exodiff on Scaled Tests
    if options.scaling and specs['scale_refine']:
      return (reason, output)

    for file in specs['exodiff']:
      custom_cmp = ''
      old_floor = ''
      if specs.isValid('custom_cmp'):
         custom_cmp = ' -f ' + os.path.join(specs['test_dir'], specs['custom_cmp'])
      if specs['use_old_floor']:
         old_floor = ' -use_old_floor'

      if not os.path.exists(os.path.join(specs['test_dir'], specs['gold_dir'], file)):
        output += "File Not Found: " + os.path.join(specs['test_dir'], specs['gold_dir'], file)
        reason = 'MISSING GOLD FILE'
        break
      else:
        command = os.path.join(moose_dir, 'framework', 'contrib', 'exodiff', 'exodiff') + ' -m' + custom_cmp + ' -F' + ' ' + str(specs['abs_zero']) + old_floor + ' -t ' + str(specs['rel_err']) \
            + ' ' + ' '.join(specs['exodiff_opts']) + ' ' + os.path.join(specs['test_dir'], specs['gold_dir'], file) + ' ' + os.path.join(specs['test_dir'], file)
        exo_output = runCommand(command)

        output += 'Running exodiff: ' + command + '\n' + exo_output + ' ' + ' '.join(specs['exodiff_opts'])

        if ('different' in exo_output or 'ERROR' in exo_output) and not "Files are the same" in exo_output:
          reason = 'EXODIFF'
          break

    return (reason, output)
Exemple #7
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    if reason != '' or self.specs['skip_checks']:
      return (reason, output)

    # Don't Run Exodiff on Scaled Tests
    if options.scaling and self.specs['scale_refine']:
      return (reason, output)

    # Make sure that all of the Exodiff files are actually available
    for file in self.specs['txtdiff']:
      if not os.path.exists(os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file)):
        output += "File Not Found: " + os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file)
        reason = 'MISSING GOLD FILE'
        break

    # Run the txtdiff
    if reason == '':
      output += 'Running txtdiff'
      with open(os.path.join(self.specs['test_dir'], file), 'r') as f:
        first_line = f.readline()
      with open(os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file), 'r') as f:
        first_line_gold = f.readline()
      if first_line != first_line_gold:
        reason = 'TXTDIFF'

    return (reason, output)
Exemple #8
0
    def processResults(self, moose_dir, retcode, options, output):
        (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

        specs = self.specs
        if reason != "" or specs["skip_checks"]:
            return (reason, output)

        if reason == "":
            # if still no errors, check other files (just for existence)
            for file in self.specs["check_files"]:
                if not os.path.isfile(os.path.join(self.specs["test_dir"], file)):
                    reason = "MISSING FILES"
                    break
            for file in self.specs["check_not_exists"]:
                if os.path.isfile(os.path.join(self.specs["test_dir"], file)):
                    reason = "UNEXPECTED FILES"
                    break

            # if still no errors, check that all the files contain the file_expect_out expression
            if reason == "":
                if self.specs.isValid("file_expect_out"):
                    for file in self.specs["check_files"]:
                        fid = open(os.path.join(self.specs["test_dir"], file), "r")
                        contents = fid.read()
                        fid.close()
                        if not self.checkOutputForPattern(contents, self.specs["file_expect_out"]):
                            reason = "NO EXPECTED OUT IN FILE"
                            break

        return (reason, output)
Exemple #9
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    if reason != '' or self.specs['skip_checks']:
      return (reason, output)

    # Don't Run Exodiff on Scaled Tests
    if options.scaling and self.specs['scale_refine']:
      return (reason, output)

    # Make sure that all of the Exodiff files are actually available
    for file in self.specs['exodiff']:
      if not os.path.exists(os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file)):
        output += "File Not Found: " + os.path.join(self.specs['test_dir'], self.specs['gold_dir'], file)
        reason = 'MISSING GOLD FILE'
        break

    if reason == '':
      # Retrieve the commands
      commands = self.processResultsCommand(moose_dir, options)

      for command in commands:
        exo_output = runCommand(command)

        output += 'Running exodiff: ' + command + '\n' + exo_output + ' ' + ' '.join(self.specs['exodiff_opts'])

        if ('different' in exo_output or 'ERROR' in exo_output) and not "Files are the same" in exo_output:
          reason = 'EXODIFF'
          break

    return (reason, output)
Exemple #10
0
 def processResults(self, moose_dir, retcode, options, output):
     if self.httpServer.getNumberOfPosts() != int(self.nPosts):
         return ("ICEUpdater FAILED: DID NOT GET CORRECT NUMBER OF POSTS",
                 "Number of Posts was " +
                 str(self.httpServer.getNumberOfPosts()) +
                 ", but should have been " + str(self.nPosts))
     else:
         return RunApp.processResults(self, moose_dir, retcode, options,
                                      output)
    def processResults(self, moose_dir, retcode, options, output):
        output = RunApp.processResults(self, moose_dir, retcode, options,
                                       output)

        # Skip
        specs = self.specs
        if self.getStatus() == self.bucket_fail or specs['skip_checks']:
            return output

        # Don't Run VTKDiff on Scaled Tests
        if options.scaling and specs['scale_refine']:
            return output

        # Loop over every file
        for file in specs['vtkdiff']:

            # Error if gold file does not exist
            if not os.path.exists(
                    os.path.join(specs['test_dir'], specs['gold_dir'], file)):
                output += "File Not Found: " + os.path.join(
                    specs['test_dir'], specs['gold_dir'], file)
                self.setStatus('MISSING GOLD FILE', self.bucket_fail)
                break

            # Perform diff
            else:
                for file in self.specs['vtkdiff']:
                    gold = os.path.join(specs['test_dir'], specs['gold_dir'],
                                        file)
                    test = os.path.join(specs['test_dir'], file)

                    # We always ignore the header_type attribute, since it was
                    # introduced in VTK 7 and doesn't seem to be important as
                    # far as Paraview is concerned.
                    specs['ignored_attributes'].append('header_type')

                    differ = XMLDiffer(
                        gold,
                        test,
                        abs_zero=specs['abs_zero'],
                        rel_tol=specs['rel_err'],
                        ignored_attributes=specs['ignored_attributes'])

                    # Print the results of the VTKDiff whether it passed or failed.
                    output += differ.message() + '\n'

                    if differ.fail():
                        self.setStatus('VTKDIFF', self.bucket_skip)
                        break

        # If status is still pending, then it is a passing test
        if self.getStatus() == self.bucket_pending:
            self.setStatus(self.success_message, self.bucket_success)

        return output
Exemple #12
0
    def processResults(self, moose_dir, retcode, options, output):
        (reason, output) = RunApp.processResults(self, moose_dir, retcode,
                                                 options, output)

        # Skip
        specs = self.specs
        if reason != '' or specs['skip_checks']:
            return (reason, output)

        # Don't Run VTKDiff on Scaled Tests
        if options.scaling and specs['scale_refine']:
            return (reason, output)

        # Loop over every file
        for file in specs['vtkdiff']:

            # Error if gold file does not exist
            if not os.path.exists(
                    os.path.join(specs['test_dir'], specs['gold_dir'], file)):
                output += "File Not Found: " + os.path.join(
                    specs['test_dir'], specs['gold_dir'], file)
                reason = 'MISSING GOLD FILE'
                break

            # Perform diff
            else:
                for file in self.specs['vtkdiff']:
                    gold = os.path.join(specs['test_dir'], specs['gold_dir'],
                                        file)
                    test = os.path.join(specs['test_dir'], file)

                    # We always ignore the header_type attribute, since it was
                    # introduced in VTK 7 and doesn't seem to be important as
                    # far as Paraview is concerned.
                    specs['ignored_attributes'].append('header_type')

                    differ = XMLDiffer(
                        gold,
                        test,
                        abs_zero=specs['abs_zero'],
                        rel_tol=specs['rel_err'],
                        ignored_attributes=specs['ignored_attributes'])

                    # Print the results of the VTKDiff whether it passed or failed.
                    output += differ.message() + '\n'

                    if differ.fail():
                        reason = 'VTKDIFF'
                        break

        # Return to the test harness
        return (reason, output)
Exemple #13
0
  def processResults(self, moose_dir, retcode, options, output):
    reason = ''
    specs = self.specs

    # Expected errors and assertions might do a lot of things including crash so we
    # will handle them seperately
    if specs.isValid('expect_err'):
      if not self.checkOutputForPattern(output, specs['expect_err']):
        reason = 'NO EXPECTED ERR'
    elif specs.isValid('expect_assert'):
      if options.method == 'dbg':  # Only check asserts in debug mode
        if not self.checkOutputForPattern(output, specs['expect_assert']):
          reason = 'NO EXPECTED ASSERT'

    if reason == '':
      (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    return (reason, output)
Exemple #14
0
  def processResults(self, moose_dir, retcode, options, output):
    reason = ''
    specs = self.specs

    # Expected errors and assertions might do a lot of things including crash so we
    # will handle them seperately
    if specs.isValid('expect_err'):
      if not self.checkOutputForPattern(output, specs['expect_err']):
        reason = 'NO EXPECTED ERR'
    elif specs.isValid('expect_assert'):
      if options.method == 'dbg':  # Only check asserts in debug mode
        if not self.checkOutputForPattern(output, specs['expect_assert']):
          reason = 'NO EXPECTED ASSERT'

    if reason == '':
      (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    return (reason, output)
Exemple #15
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    specs = self.specs
    if reason != '' or specs['skip_checks']:
      return (reason, output)

    # Don't Run CSVDiff on Scaled Tests
    if options.scaling and specs['scale_refine']:
      return (reason, output)

    if len(specs['csvdiff']) > 0:
      differ = CSVDiffer( specs['test_dir'], specs['csvdiff'], specs['abs_zero'], specs['rel_err'] )
      msg = differ.diff()
      output += 'Running CSVDiffer.py\n' + msg
      if msg != '':
        reason = 'CSVDIFF'

    return (reason, output)
Exemple #16
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    specs = self.specs
    if reason != '' or specs['skip_checks']:
      return (reason, output)

    # Don't Run CSVDiff on Scaled Tests
    if options.scaling and specs['scale_refine']:
      return (reason, output)

    if len(specs['csvdiff']) > 0:
      differ = CSVDiffer( specs['test_dir'], specs['csvdiff'], specs['abs_zero'], specs['rel_err'] )
      msg = differ.diff()
      output += 'Running CSVDiffer.py\n' + msg
      if msg != '':
        reason = 'CSVDIFF'

    return (reason, output)
Exemple #17
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    # Skip
    specs = self.specs
    if reason != '' or specs['skip_checks']:
      return (reason, output)

    # Don't Run VTKDiff on Scaled Tests
    if options.scaling and specs['scale_refine']:
      return (reason, output)

    # Loop over every file
    for file in specs['vtkdiff']:

      # Error if gold file does not exist
      if not os.path.exists(os.path.join(specs['test_dir'], specs['gold_dir'], file)):
        output += "File Not Found: " + os.path.join(specs['test_dir'], specs['gold_dir'], file)
        reason = 'MISSING GOLD FILE'
        break

      # Perform diff
      else:
        for file in self.specs['vtkdiff']:
          gold = os.path.join(specs['test_dir'], specs['gold_dir'], file)
          test = os.path.join(specs['test_dir'], file)

          # We always ignore the header_type attribute, since it was
          # introduced in VTK 7 and doesn't seem to be important as
          # far as Paraview is concerned.
          specs['ignored_attributes'].append('header_type')

          differ = XMLDiffer(gold, test, abs_zero=specs['abs_zero'], rel_tol=specs['rel_err'], ignored_attributes=specs['ignored_attributes'])

          # Print the results of the VTKDiff whether it passed or failed.
          output += differ.message() + '\n'

          if differ.fail():
            reason = 'VTKDIFF'
            break

    # Return to the test harness
    return (reason, output)
Exemple #18
0
    def processResults(self, moose_dir, retcode, options, output):
        (reason, output) = RunApp.processResults(self, moose_dir, retcode,
                                                 options, output)

        # Skip
        specs = self.specs
        if reason != '' or specs['skip_checks']:
            return (reason, output)

        # Don't Run VTKDiff on Scaled Tests
        if options.scaling and specs['scale_refine']:
            return (reason, output)

        # Loop over every file
        for file in specs['vtkdiff']:

            # Error if gold file does not exist
            if not os.path.exists(
                    os.path.join(specs['test_dir'], specs['gold_dir'], file)):
                output += "File Not Found: " + os.path.join(
                    specs['test_dir'], specs['gold_dir'], file)
                reason = 'MISSING GOLD FILE'
                break

            # Perform diff
            else:
                output = 'Running XMLDiffer.py'
                for file in self.specs['vtkdiff']:
                    gold = os.path.join(specs['test_dir'], specs['gold_dir'],
                                        file)
                    test = os.path.join(specs['test_dir'], file)
                    differ = XMLDiffer(gold,
                                       test,
                                       abs_zero=specs['abs_zero'],
                                       rel_tol=specs['rel_err'])

                    if differ.fail():
                        reason = 'VTKDIFF'
                        output += differ.message()
                        break

        # Return to the test harness
        return (reason, output)
Exemple #19
0
    def processResults(self, moose_dir, retcode, options, output):
        (reason, output) = RunApp.processResults(self, moose_dir, retcode,
                                                 options, output)

        specs = self.specs
        if reason != '' or specs['skip_checks']:
            return (reason, output)

        # Don't Run Exodiff on Scaled Tests
        if options.scaling and specs['scale_refine']:
            return (reason, output)

        for file in specs['exodiff']:
            custom_cmp = ''
            old_floor = ''
            if specs.isValid('custom_cmp'):
                custom_cmp = ' -f ' + os.path.join(specs['test_dir'],
                                                   specs['custom_cmp'])
            if specs['use_old_floor']:
                old_floor = ' -use_old_floor'

            if not os.path.exists(
                    os.path.join(specs['test_dir'], specs['gold_dir'], file)):
                output += "File Not Found: " + os.path.join(
                    specs['test_dir'], specs['gold_dir'], file)
                reason = 'MISSING GOLD FILE'
                break
            else:
                command = os.path.join(moose_dir, 'framework', 'contrib', 'exodiff', 'exodiff') + ' -m' + custom_cmp + ' -F' + ' ' + str(specs['abs_zero']) + old_floor + ' -t ' + str(specs['rel_err']) \
                    + ' ' + ' '.join(specs['exodiff_opts']) + ' ' + os.path.join(specs['test_dir'], specs['gold_dir'], file) + ' ' + os.path.join(specs['test_dir'], file)
                exo_output = runCommand(command)

                output += 'Running exodiff: ' + command + '\n' + exo_output + ' ' + ' '.join(
                    specs['exodiff_opts'])

                if ('different' in exo_output or 'ERROR' in exo_output
                    ) and not "Files are the same" in exo_output:
                    reason = 'EXODIFF'
                    break

        return (reason, output)
Exemple #20
0
    def processResults(self, moose_dir, retcode, options, output):
        reason = ''
        specs = self.specs

        # Expected errors and assertions might do a lot of things including crash so we
        # will handle them seperately
        if specs.isValid('expect_err'):
            if not util.checkOutputForPattern(output, specs['expect_err']):
                reason = 'NO EXPECTED ERR'
        elif specs.isValid('expect_assert'):
            if options.method == 'dbg':  # Only check asserts in debug mode
                if not util.checkOutputForPattern(output, specs['expect_assert']):
                    reason = 'NO EXPECTED ASSERT'

        if reason == '':
            output = RunApp.processResults(self, moose_dir, retcode, options, output)

        if reason != '':
            self.setStatus(reason, self.bucket_fail)
        else:
            self.setStatus(self.success_message, self.bucket_success)

        return output
Exemple #21
0
  def processResults(self, moose_dir, retcode, options, output):
    (reason, output) = RunApp.processResults(self, moose_dir, retcode, options, output)

    # Skip
    specs = self.specs
    if reason != '' or specs['skip_checks']:
      return (reason, output)

    # Don't Run VTKDiff on Scaled Tests
    if options.scaling and specs['scale_refine']:
      return (reason, output)

    # Loop over every file
    for file in specs['vtkdiff']:

      # Error if gold file does not exist
      if not os.path.exists(os.path.join(specs['test_dir'], specs['gold_dir'], file)):
        output += "File Not Found: " + os.path.join(specs['test_dir'], specs['gold_dir'], file)
        reason = 'MISSING GOLD FILE'
        break

      # Perform diff
      else:
        output = 'Running XMLDiffer.py'
        for file in self.specs['vtkdiff']:
          gold = os.path.join(specs['test_dir'], specs['gold_dir'], file)
          test = os.path.join(specs['test_dir'], file)
          differ = XMLDiffer(gold, test, abs_zero=specs['abs_zero'], rel_tol=specs['rel_err'])

          if differ.fail():
            reason = 'VTKDIFF'
            output += differ.message()
            break

    # Return to the test harness
    return (reason, output)
Exemple #22
0
 def processResults(self, moose_dir, retcode, options, output):
     return RunApp.processResults(self, moose_dir, retcode, options, output)