<commit_before>#!/usr/bin/env python
"""Run all combinations of boards and test sketches."""
from glob import glob
from sys import exit
from os import environ
import subprocess

compiler_configs = [
    # Adding more boards? Add them to this array:
    # ['platformio', 'ci', '--board=your-board-here'],
    ['platformio', 'ci', '--board=lightblue-bean'],
]

test_sketches = [
    'tests/resources/test_sketches/*.ino',
    'examples/LightBlueBean/01.Basics/*/*.ino',
]

test_sketch_paths = []
for pattern in test_sketches:
    test_sketch_paths.extend(glob(pattern))

return_code = 0
for sketch_path in test_sketch_paths:
    for compiler in compiler_configs:
        # Add this variable on top of the existing env to preserve
        # the virtualenv which contains the PlatformIO executable
        env = environ.copy()
        env['PLATFORMIO_CI_SRC'] = sketch_path
        try:
            subprocess.check_call(compiler, env=env)
        except subprocess.CalledProcessError:
            return_code = 1

exit(return_code)<commit_msg>tests: only display bad compile output, and only at the end<commit_after>#!/usr/bin/env python
"""Run all combinations of boards and test sketches."""
from glob import glob
from sys import exit
from os import environ
import subprocess

compiler_configs = [
    # Adding more boards? Add them to this array:
    # ['platformio', 'ci', '--board=your-board-here'],
    ['platformio', 'ci', '--board=lightblue-bean'],
]

test_sketches = [
    'tests/resources/test_sketches/*.ino',
    'examples/LightBlueBean/01.Basics/*/*.ino',
]

test_sketch_paths = []
for pattern in test_sketches:
    test_sketch_paths.extend(glob(pattern))

return_code = 0
bad_sketch_output = []
for sketch_path in test_sketch_paths:
    for compiler in compiler_configs:
        # Add this variable on top of the existing env to preserve
        # the virtualenv which contains the PlatformIO executable
        env = environ.copy()
        env['PLATFORMIO_CI_SRC'] = sketch_path
        try:
            # if it succeeds, we don't care about the compile output
            subprocess.check_output(compiler, env=env)
            print('PASS:', sketch_path)
        except subprocess.CalledProcessError as e:
            return_code = 1
            print('FAIL:', sketch_path)
            bad_sketch_output.append(sketch_path, e.output)

for sketch_path, error_output in bad_sketch_output:
    print('Compile output for {}:'.format(sketch_path))
    print()
    print(error_output)
    print()

exit(return_code)
{'fraction_non_alphanumeric': 0.10348929421094369, 'fraction_numerical': 0.0031720856463124504, 'mean_word_length': 3.3575129533678756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '879406', 'n_tokens_mistral': 777, 'n_tokens_neox': 762, 'n_words': 216}