コード例 #1
0
def run():
    """
    Run tests for one or more drivers.  If -b is passed then
    we read driver list from the build bot configuration, otherwise
    we use the current IDK driver.
    @return: If any test fails return false, otherwise true
    """

    opts = parseArgs()
    failure = False

    for metadata in get_metadata(opts):
        app = NoseTest(metadata,
                       testname=opts.testname,
                       suppress_stdout=opts.suppress_stdout,
                       noseargs=opts.noseargs)

        app.report_header()

        if (opts.unit):
            success = app.run_unit()
        elif (opts.integration):
            success = app.run_integration()
        elif (opts.qualification):
            success = app.run_qualification()
        elif (opts.publication):
            success = app.run_publication()
        else:
            success = app.run()

        if (not success): failure = True

    return failure
コード例 #2
0
 def setUp(self):
     """
     Setup the test case
     """
     metadata = Metadata(TEST_DRIVER_MAKE, TEST_DRIVER_MODEL,
                         TEST_DRIVER_FLAVOR)
     self.assertTrue(metadata)
     self.nose = NoseTest(metadata)
     self.assertTrue(self.nose)
コード例 #3
0
    def run_qualification_tests(self):
        """
        @brief Run all qualification tests for the driver and store the results for packaging
        """
        log.info("-- Running qualification tests")

        test = NoseTest(self.metadata, log_file=self.log_path())
        test.report_header()

        if (test.run_qualification()):
            log.info(" ++ Qualification tests passed")
            return True
        else:
            log.error("Qualification tests have fail!  No package created.")
            return False
コード例 #4
0
    def test_nose_with_testname(self):
        '''
        Test nose when specifying a specific test name
        '''

        metadata = Metadata(TEST_DRIVER_MAKE, TEST_DRIVER_MODEL,
                            TEST_DRIVER_FLAVOR)
        self.assertTrue(metadata)
        self.nose = NoseTest(metadata, testname='test_autosample')
        self.assertTrue(self.nose)

        # Verify we can get the test module name and file
        self.assertEqual(self.nose._driver_test_module(), DRIVER_TEST_MODULE)
        test_file = self.nose._driver_test_module().replace('.', '/') + ".py"

        self.assertTrue(test_file in self.nose._driver_test_filename())

        self.assertEqual(self.nose._unit_test_class, 'SBEUnitTestCase')
        self.assertEqual(self.nose._int_test_class, 'SBEIntTestCase')
        self.assertEqual(self.nose._qual_test_class,
                         'SBEQualificationTestCase')

        self.assertEqual(self.nose._testname, 'test_autosample')

        self.assertEqual(
            self.nose._unit_test_module_param(),
            "%s:%s.%s" % (self.nose._driver_test_filename(),
                          self.nose._unit_test_class, 'test_autosample'))

        self.assertEqual(
            self.nose._int_test_module_param(),
            "%s:%s.%s" % (self.nose._driver_test_filename(),
                          self.nose._int_test_class, 'test_autosample'))

        self.assertEqual(
            self.nose._qual_test_module_param(),
            "%s:%s.%s" % (self.nose._driver_test_filename(),
                          self.nose._qual_test_class, 'test_autosample'))
コード例 #5
0
 def get_nose_test(self):
     return NoseTest(self.metadata, log_file=self.log_path())