コード例 #1
0
ファイル: summary.py プロジェクト: kphillisjr/piglit
    def setUpClass(cls):
        """ Create all of the necissary files for running the test

        Create a set of temprorary result files, and add them to the files
        attribute. This attribute will be deleted by the tearDownClass() method
        after the tests have run

        """
        cls._makedirs(cls.tmpdir)

        # Create temporary files in the /tmp/piglit directory
        for result in STATUSES[:-1]:  # notrun cannot be generated here
            tmpfile = path.join(cls.tmpdir, result, "main")
            cls._makedirs(path.dirname(tmpfile))

            with open(tmpfile, 'w') as f:
                json.dump(create_testresult(name=result,
                                            tests=create_test("test", result)),
                          f, indent=4)

            # Add the file to the list of files to be removed in tearDownClass
            cls.files.append(tmpfile)

        # Create an additional file to test a Not Run status. This needs to be
        # generated separately since the test result should not include the
        # test that will have the not run status.
        tmpfile = path.join(cls.tmpdir, "notrun", "main")
        cls._makedirs(path.dirname(tmpfile))

        with open(tmpfile, 'w') as f:
            # If there are not tests buildDictionary fails
            json.dump(create_testresult(name="notrun", 
                                        tests=create_test("diff", "pass")),
                      f, indent=4)

        cls.files.append(tmpfile)
コード例 #2
0
ファイル: summary.py プロジェクト: passdedd/piglit-test
class StatusTest(SummaryTestBase):
    """ Test status comparisons in the Summary module.

    This test creates summary objects with one or two results that it
    generates. These results have a single test in them forming known status
    pairs. These pairs are explicitly a fix, regression, or change. The code
    then creates a summary and ensures that the status has been added to the
    proper field, and not to any additional fields.

    """

    @classmethod
    def setUpClass(cls):
        """ Create all of the necissary files for running the test

        Create a set of temprorary result files, and add them to the files
        attribute. This attribute will be deleted by the tearDownClass() method
        after the tests have run

        """
        cls._makedirs(cls.tmpdir)

        # Create temporary files in the /tmp/piglit directory
        for result in STATUSES[:-1]:  # notrun cannot be generated here
            tmpfile = path.join(cls.tmpdir, result, "main")
            cls._makedirs(path.dirname(tmpfile))

            with open(tmpfile, 'w') as f:
                json.dump(create_testresult(name=result,
                                            tests=create_test("test", result)),
                          f, indent=4)

            # Add the file to the list of files to be removed in tearDownClass
            cls.files.append(tmpfile)

        # Create an additional file to test a Not Run status. This needs to be
        # generated separately since the test result should not include the
        # test that will have the not run status.
        tmpfile = path.join(cls.tmpdir, "notrun", "main")
        cls._makedirs(path.dirname(tmpfile))

        with open(tmpfile, 'w') as f:
            # If there are not tests buildDictionary fails
            json.dump(create_testresult(name="notrun", 
                                        tests=create_test("diff", "pass")),
                      f, indent=4)
コード例 #3
0
ファイル: summary.py プロジェクト: passdedd/piglit-test
    def setUpClass(cls):
        """ Create all of the necissary files for running the test

        Create a set of temprorary result files, and add them to the files
        attribute. This attribute will be deleted by the tearDownClass() method
        after the tests have run

        """
        cls._makedirs(cls.tmpdir)

        # Create temporary files in the /tmp/piglit directory
        for result in STATUSES[:-1]:  # notrun cannot be generated here
            tmpfile = path.join(cls.tmpdir, result, "main")
            cls._makedirs(path.dirname(tmpfile))

            with open(tmpfile, 'w') as f:
                json.dump(create_testresult(name=result,
                                            tests=create_test("test", result)),
                          f, indent=4)

            # Add the file to the list of files to be removed in tearDownClass
            cls.files.append(tmpfile)