Example #1
0
    def test(self, params):
        fixtures = params.fixtures
        tempdir = fixtures[constants.tempdir_fixture_name].path

        for fname in self.filenames:
            if self.parse_file(joinpath(tempdir, fname)):
                test_util.fail('Could not match regex.')
Example #2
0
    def test(self, params):
        fixtures = params.fixtures
        # Get the file from the tempdir of the test.
        tempdir = fixtures[constants.tempdir_fixture_name].path

        for fname in self.filenames:
            if self.parse_file(joinpath(tempdir, fname)):
                return  # Success

        test_util.fail('Could not match regex.')
Example #3
0
    def test(self, params):
        # We need a tempdir fixture from our parent verifier suite.
        fixtures = params.fixtures
        # Get the file from the tempdir of the test.
        tempdir = fixtures[constants.tempdir_fixture_name].path
        self.test_filename = joinpath(tempdir, self.test_filename)

        diff = diff_out_file(self.standard_filename,
                             self.test_filename,
                             ignore_regexes=self.ignore_regex,
                             logger=params.log)
        if diff is not None:
            test.fail('Stdout did not match:\n%s\nSee %s for full results' %
                      (diff, tempdir))
Example #4
0
    def test(self, params):
        fixtures = params.fixtures
        # Get the file from the tempdir of the test.
        tempdir = fixtures[constants.tempdir_fixture_name].path

        def parse_file(fname):
            with open(fname, 'r') as file_:
                for line in file_:
                    for regex in self.regex:
                        if re.match(regex, line):
                            return True

        if self.match_stdout:
            if parse_file(joinpath(tempdir, constants.gem5_simulation_stdout)):
                return  # Success
        if self.match_stderr:
            if parse_file(joinpath(tempdir, constants.gem5_simulation_stderr)):
                return  # Success
        test.fail('Could not match regex.')
Example #5
0
 def test(self, params):
     tempdir = params.fixtures[constants.tempdir_fixture_name].path
     h5_file = joinpath(tempdir, self.stats_file)
     if not os.path.isfile(h5_file):
         test_util.fail('Could not find h5 stats file %s', h5_file)