Repository: jerryscript-project/jerryscript
File: tools/runners/run-test-suite-test262.py (Python)

Code before:
        try:
            subprocess.check_output(["timeout", "--version"])
            command = "timeout 3 " + command
        except subprocess.CalledProcessError:
            pass

    kwargs = {}
    if sys.version_info.major >= 3:
        kwargs['errors'] = 'ignore'

    if args.es51:
        test262_harness_path = os.path.join(args.test262_harness_dir, 'tools/packaging/test262.py')
    else:
        test262_harness_path = os.path.join(args.test262_harness_dir, 'test262-harness.py')

    test262_command = get_platform_cmd_prefix() + \
                      [test262_harness_path,
                       '--command', command,
                       '--tests', args.test_dir,
                       '--summary']

    if 'excludelist_path' in args and args.mode == 'default':
        test262_command.extend(['--exclude-list', args.excludelist_path])

    if args.test262_test_list:
        for test in args.test262_test_list.split(','):
            test262_command.append(test)

    proc = subprocess.Popen(test262_command,
                            universal_newlines=True,
                            stdout=subprocess.PIPE,
                            **kwargs)

    return_code = 1
    with open(os.path.join(os.path.dirname(args.engine), 'test262.report'), 'w') as output_file:
        counter = 0
        summary_found = False
        summary_end_found = False
        while True:
            output = proc.stdout.readline()
            if not output:
                break
            output_file.write(output)

            if output.startswith('=== Summary ==='):
                summary_found = True
                print('')

            if summary_found:
                if not summary_end_found:
                    print(output, end='')

Review comment (suggestion):
in python you can do: `test262_command.extend(args.test262_test_list.split(','))` to achieve the same thing.

Code after:
        try:
            subprocess.check_output(["timeout", "--version"])
            command = "timeout 3 " + command
        except subprocess.CalledProcessError:
            pass

    kwargs = {}
    if sys.version_info.major >= 3:
        kwargs['errors'] = 'ignore'

    if args.es51:
        test262_harness_path = os.path.join(args.test262_harness_dir, 'tools/packaging/test262.py')
    else:
        test262_harness_path = os.path.join(args.test262_harness_dir, 'test262-harness.py')

    test262_command = get_platform_cmd_prefix() + \
                      [test262_harness_path,
                       '--command', command,
                       '--tests', args.test_dir,
                       '--summary']

    if 'excludelist_path' in args and args.mode == 'default':
        test262_command.extend(['--exclude-list', args.excludelist_path])

    if args.test262_test_list:
        test262_command.extend(args.test262_test_list.split(','))

    proc = subprocess.Popen(test262_command,
                            universal_newlines=True,
                            stdout=subprocess.PIPE,
                            **kwargs)

    return_code = 1
    with open(os.path.join(os.path.dirname(args.engine), 'test262.report'), 'w') as output_file:
        counter = 0
        summary_found = False
        summary_end_found = False
        while True:
            output = proc.stdout.readline()
            if not output:
                break
            output_file.write(output)

            if output.startswith('=== Summary ==='):
                summary_found = True
                print('')

            if summary_found:
                if not summary_end_found:
                    print(output, end='')
                    if not output.strip():