Beispiel #1
0
 def run_tests(self, **kwargs):
     test_project = self.to_test_project()
     test_runner = qibuild.test_runner.ProjectTestRunner(test_project)
     for key, value in kwargs.iteritems():
         if hasattr(test_runner, key):
             setattr(test_runner, key, value)
     return test_runner.run()
Beispiel #2
0
def do(args):
    """Main entry point"""
    try:
        test_runners = qitest.parsers.get_test_runners(args)
    except qitest.parsers.EmptyTestListException:
        if not args.allow_no_test:
            raise
        test_runners = []
    global_res = True
    n = len(test_runners)
    for i, test_runner in enumerate(test_runners):
        if n != 1:
            ui.info(ui.bold, "::", "[%i on %i]" % (i + 1, len(test_runners)),
                    ui.reset, "Running tests in", ui.blue, test_runner.cwd)
        if not test_runner.tests and args.allow_no_test:
            ui.warning("No test to run")
            continue
        res = test_runner.run()
        if args.coverage:
            build_worktree = qibuild.parsers.get_build_worktree(args, verbose=False)
            build_project = qibuild.parsers.get_one_build_project(build_worktree, args)
            qibuild.gcov.generate_coverage_reports(build_project, output_dir=args.coverage_output_dir)
        global_res = global_res and res
    if not global_res:
        sys.exit(1)
Beispiel #3
0
 def run_tests(self, **kwargs):
     test_project = self.to_test_project()
     test_runner = qibuild.test_runner.ProjectTestRunner(test_project)
     # Note how we do NOT use the env coming from the build config (in
     # self.build_env()), suitable for running CMake and building,
     # but the env coming from the build worktree, suitable to run the tests
     test_runner.env = self.build_worktree.get_env()
     for key, value in kwargs.iteritems():
         if hasattr(test_runner, key):
             setattr(test_runner, key, value)
     return test_runner.run()
Beispiel #4
0
 def run_tests(self, **kwargs):
     test_project = self.to_test_project()
     test_runner = qibuild.test_runner.ProjectTestRunner(test_project)
     # Note how we do NOT use the env coming from the build config (in
     # self.build_env()), suitable for running CMake and building,
     # but the env coming from the build worktree, suitable to run the tests
     test_runner.env = self.build_worktree.get_env()
     for key, value in kwargs.iteritems():
         if hasattr(test_runner, key):
             setattr(test_runner, key, value)
     return test_runner.run()
Beispiel #5
0
def do(args):
    """Main entry point"""
    test_runners = qitest.parsers.get_test_runners(args)
    global_res = True
    for test_runner in test_runners:
        res = test_runner.run()
        if args.coverage:
            build_worktree = qibuild.parsers.get_build_worktree(args)
            build_project = qibuild.parsers.get_one_build_project(build_worktree, args)
            qibuild.gcov.generate_coverage_xml_report(build_project)
        global_res = global_res and res
    if not global_res:
        sys.exit(1)
Beispiel #6
0
 def run_tests(self, **kwargs):
     """ Run the tests for this project """
     ui.info(ui.green, "Testing", self.name, "...")
     test_runner = qibuild.test_runner.ProjectTestRunner(self)
     test_runner.cwd = os.path.join(self.sdk_directory, "bin")
     test_runner.env = self.build_env
     test_runner.pattern = kwargs.get("pattern")
     test_runner.perf = kwargs.get("perf", False)
     test_runner.nightly = kwargs.get("nightly", False)
     test_runner.coverage = kwargs.get("coverage")
     test_runner.valgrind = kwargs.get("valgrind")
     test_runner.verbose = kwargs.get("verbose_tests")
     test_runner.num_cpus = kwargs.get("num_cpus", -1)
     test_runner.num_jobs = kwargs.get("num_jobs", 1)
     return test_runner.run()
Beispiel #7
0
def do(args):
    """Main entry point"""
    test_runners = qitest.parsers.get_test_runners(args)
    global_res = True
    n = len(test_runners)
    for i, test_runner in enumerate(test_runners):
        if n != 1:
            ui.info(ui.bold, "::", "[%i on %i]" % (i + 1, len(test_runners)),
                    ui.reset, "Running tests in", ui.blue, test_runner.cwd)
        res = test_runner.run()
        if args.coverage:
            build_worktree = qibuild.parsers.get_build_worktree(args, verbose=False)
            build_project = qibuild.parsers.get_one_build_project(build_worktree, args)
            qibuild.gcov.generate_coverage_reports(build_project, output_dir=args.coverage_output_dir)
        global_res = global_res and res
    if not global_res:
        sys.exit(1)
Beispiel #8
0
def do(args):
    """Main entry point"""
    qitest_json = args.qitest_json
    test_project = TestProject(qitest_json)
    test_runner = qibuild.test_runner.ProjectTestRunner(test_project)
    test_runner.cwd = os.path.dirname(args.qitest_json)
    test_runner.pattern = args.pattern
    test_runner.perf = args.perf
    test_runner.coverage = args.coverage
    test_runner.valgrind = args.valgrind
    test_runner.verbose = args.verbose_tests
    test_runner.num_cpus = args.num_cpus
    test_runner.num_jobs = args.num_jobs
    test_runner.nightly = args.nightly
    res = test_runner.run()
    if not res:
        sys.exit(1)
Beispiel #9
0
def do(args):
    """Main entry point"""
    test_runners = qitest.parsers.get_test_runners(args)
    global_res = True
    n = len(test_runners)
    for i, test_runner in enumerate(test_runners):
        if n != 1:
            ui.info(ui.bold, "::", "[%i on %i]" % (i + 1, len(test_runners)),
                    ui.reset, "Running tests in", ui.blue, test_runner.cwd)
        res = test_runner.run()
        if args.coverage:
            build_worktree = qibuild.parsers.get_build_worktree(args)
            build_project = qibuild.parsers.get_one_build_project(build_worktree, args)
            qibuild.gcov.generate_coverage_xml_report(build_project)
        global_res = global_res and res
    if not global_res:
        sys.exit(1)