예제 #1
0
    def run_tests(self):
        # For a partial run, we do not need to clutter the output.
        if (self.ns.verbose or self.ns.header
                or not (self.ns.pgo or self.ns.quiet or self.ns.single
                        or self.tests or self.ns.args)):
            # Print basic platform information
            print("==", platform.python_implementation(), *sys.version.split())
            print("==  ", platform.platform(aliased=True),
                  "%s-endian" % sys.byteorder)
            print("==  ", "hash algorithm:", sys.hash_info.algorithm,
                  "64bit" if sys.maxsize > 2**32 else "32bit")
            print("==  ", os.getcwd())
            print("Testing with flags:", sys.flags)

        if self.ns.randomize:
            print("Using random seed", self.ns.random_seed)

        if self.ns.forever:
            self.tests = self._test_forever(list(self.selected))
            self.test_count = ''
            self.test_count_width = 3
        else:
            self.tests = iter(self.selected)
            self.test_count = '/{}'.format(len(self.selected))
            self.test_count_width = len(self.test_count) - 1

        if self.ns.use_mp:
            from test.libregrtest.runtest_mp import run_tests_multiprocess
            run_tests_multiprocess(self)
        else:
            self.run_tests_sequential()
예제 #2
0
파일: main.py 프로젝트: redneptun/lokkat
    def run_tests(self):
        # For a partial run, we do not need to clutter the output.
        if (self.ns.header
                or not (self.ns.pgo or self.ns.quiet or self.ns.single
                        or self.tests or self.ns.args)):
            self.display_header()

        if self.ns.huntrleaks:
            warmup, repetitions, _ = self.ns.huntrleaks
            if warmup < 3:
                msg = (
                    "WARNING: Running tests with --huntrleaks/-R and less than "
                    "3 warmup repetitions can give false positives!")
                print(msg, file=sys.stdout, flush=True)

        if self.ns.randomize:
            print("Using random seed", self.ns.random_seed)

        if self.ns.forever:
            self.tests = self._test_forever(list(self.selected))
            self.test_count = ''
            self.test_count_width = 3
        else:
            self.tests = iter(self.selected)
            self.test_count = '/{}'.format(len(self.selected))
            self.test_count_width = len(self.test_count) - 1

        if self.ns.use_mp:
            from test.libregrtest.runtest_mp import run_tests_multiprocess
            run_tests_multiprocess(self)
        else:
            self.run_tests_sequential()
예제 #3
0
파일: main.py 프로젝트: esc/cpython
    def run_tests(self):
        # For a partial run, we do not need to clutter the output.
        if (self.ns.verbose
            or self.ns.header
            or not (self.ns.pgo or self.ns.quiet or self.ns.single
                    or self.tests or self.ns.args)):
            # Print basic platform information
            print("==", platform.python_implementation(), *sys.version.split())
            print("==  ", platform.platform(aliased=True),
                          "%s-endian" % sys.byteorder)
            print("==  ", "hash algorithm:", sys.hash_info.algorithm,
                  "64bit" if sys.maxsize > 2**32 else "32bit")
            print("==  ", os.getcwd())
            print("Testing with flags:", sys.flags)

        if self.ns.randomize:
            print("Using random seed", self.ns.random_seed)

        if self.ns.forever:
            self.tests = self._test_forever(list(self.selected))
            self.test_count = ''
            self.test_count_width = 3
        else:
            self.tests = iter(self.selected)
            self.test_count = '/{}'.format(len(self.selected))
            self.test_count_width = len(self.test_count) - 1

        if self.ns.use_mp:
            from test.libregrtest.runtest_mp import run_tests_multiprocess
            run_tests_multiprocess(self)
        else:
            self.run_tests_sequential()
예제 #4
0
파일: main.py 프로젝트: FFMG/myoddweb.piger
    def run_tests(self):
        # For a partial run, we do not need to clutter the output.
        if (self.ns.header
            or not(self.ns.pgo or self.ns.quiet or self.ns.single
                   or self.tests or self.ns.args)):
            self.display_header()

        if self.ns.huntrleaks:
            warmup, repetitions, _ = self.ns.huntrleaks
            if warmup < 3:
                msg = ("WARNING: Running tests with --huntrleaks/-R and less than "
                        "3 warmup repetitions can give false positives!")
                print(msg, file=sys.stdout, flush=True)

        if self.ns.randomize:
            print("Using random seed", self.ns.random_seed)

        if self.ns.forever:
            self.tests = self._test_forever(list(self.selected))
            self.test_count = ''
            self.test_count_width = 3
        else:
            self.tests = iter(self.selected)
            self.test_count = '/{}'.format(len(self.selected))
            self.test_count_width = len(self.test_count) - 1

        if self.ns.use_mp:
            from test.libregrtest.runtest_mp import run_tests_multiprocess
            run_tests_multiprocess(self)
        else:
            self.run_tests_sequential()
예제 #5
0
    def run_tests(self):
        # For a partial run, we do not need to clutter the output.
        if (self.ns.header
                or not (self.ns.pgo or self.ns.quiet or self.ns.single
                        or self.tests or self.ns.args)):
            self.display_header()

        if self.ns.huntrleaks:
            warmup, repetitions, _ = self.ns.huntrleaks
            if warmup < 3:
                msg = (
                    "WARNING: Running tests with --huntrleaks/-R and less than "
                    "3 warmup repetitions can give false positives!")
                print(msg, file=sys.stdout, flush=True)

        if self.ns.randomize:
            print("Using random seed", self.ns.random_seed)

        if self.ns.forever:
            self.tests = self._test_forever(list(self.selected))
            self.test_count = ''
            self.test_count_width = 3
        else:
            self.tests = iter(self.selected)
            self.test_count = '/{}'.format(len(self.selected))
            self.test_count_width = len(self.test_count) - 1

        if self.ns.use_mp:
            from test.libregrtest.runtest_mp import run_tests_multiprocess
            # If we're on windows and this is the parent runner (not a worker),
            # track the load average.
            if sys.platform == 'win32' and self.worker_test_name is None:
                from test.libregrtest.win_utils import WindowsLoadTracker

                try:
                    self.win_load_tracker = WindowsLoadTracker()
                except PermissionError as error:
                    # Standard accounts may not have access to the performance
                    # counters.
                    print(f'Failed to create WindowsLoadTracker: {error}')

            try:
                run_tests_multiprocess(self)
            finally:
                if self.win_load_tracker is not None:
                    self.win_load_tracker.close()
                    self.win_load_tracker = None
        else:
            self.run_tests_sequential()
예제 #6
0
 def run_tests(self):
     if self.ns.header or not (self.ns.pgo or self.ns.quiet
                               or self.ns.single or self.tests
                               or self.ns.args):
         self.display_header()
     if self.ns.randomize:
         print('Using random seed', self.ns.random_seed)
     if self.ns.forever:
         self.tests = self._test_forever(list(self.selected))
         self.test_count = ''
         self.test_count_width = 3
     else:
         self.tests = iter(self.selected)
         self.test_count = '/{}'.format(len(self.selected))
         self.test_count_width = len(self.test_count) - 1
     if self.ns.use_mp:
         from test.libregrtest.runtest_mp import run_tests_multiprocess
         run_tests_multiprocess(self)
     else:
         self.run_tests_sequential()
예제 #7
0
파일: main.py 프로젝트: hzp1245/cpython
    def run_tests(self):
        # For a partial run, we do not need to clutter the output.
        if (self.ns.header
            or not(self.ns.pgo or self.ns.quiet or self.ns.single
                   or self.tests or self.ns.args)):
            self.display_header()

        if self.ns.randomize:
            print("Using random seed", self.ns.random_seed)

        if self.ns.forever:
            self.tests = self._test_forever(list(self.selected))
            self.test_count = ''
            self.test_count_width = 3
        else:
            self.tests = iter(self.selected)
            self.test_count = '/{}'.format(len(self.selected))
            self.test_count_width = len(self.test_count) - 1

        if self.ns.use_mp:
            from test.libregrtest.runtest_mp import run_tests_multiprocess
            run_tests_multiprocess(self)
        else:
            self.run_tests_sequential()