<commit_before>#include <stdio.h>

#include "tests/min_unit.h"
#include "tests/test_coordinates.h"
#include "tests/test_shapes.h"
#include "tests/test_camera.h"

int tests_run;

int main(int argc, char *argv[]) {

    printf("\n");
    printf("*****************\n");
    printf("* Running tests *\n");
    printf("*****************\n\n");

    int result = 0;

    tests_run = 0;
    char *coord_results = test_coordinates();
    if (coord_results != 0) {
        printf("%s\n", coord_results);
    } else {
        printf("COORDINATE TESTS PASSED\n");
    }
    printf("    Tests run: %d\n", tests_run);
    printf("\n");

    result = result || (coord_results != 0);

    tests_run = 0;
    char *shape_results = test_shapes();
    if (shape_results != 0) {
        printf("%s\n", shape_results);
    } else {
        printf("SHAPE TESTS PASSED\n");
    }
    printf("    Tests run: %d\n", tests_run);
    printf("\n");

    result = result || (shape_results != 0);

    tests_run = 0;
    char *camera_results = test_camera();
    if (camera_results != 0) {
        printf("%s\n", camera_results);
    } else {
        printf("CAMERA TESTS PASSED\n");
    }
    printf("    Tests run: %d\n", tests_run);
    printf("\n");

    result = result || (camera_results != 0);

    return result;
}
<commit_msg>Simplifying test declerations<commit_after>#include <stdio.h>

#include "tests/min_unit.h"
#include "tests/test_coordinates.h"
#include "tests/test_shapes.h"
#include "tests/test_camera.h"
#include "tests/test_config.h"

int tests_run = 0;

int run_test(char *test_name, char *(*test_runner)()) {
    tests_run = 0;
    char *test_results = test_runner();
    if (test_results != 0) {
        printf("%s\n", test_results);
    } else {
        printf("%s tests passed\n", test_name);
    }
    printf("    Tests run: %d\n", tests_run);
    printf("\n");
    return (test_results != 0);
}

int main(int argc, char *argv[]) {

    printf("\n");
    printf("*****************\n");
    printf("* Running tests *\n");
    printf("*****************\n\n");

    int coord_result  = run_test("Coordinates", test_coordinates);
    int shape_result  = run_test("Shape", test_shapes);
    int camera_result = run_test("Camera", test_camera);

    return (
        coord_result ||
        shape_result ||
        camera_result
    );
}

{'fraction_non_alphanumeric': 0.19313304721030042, 'fraction_numerical': 0.006008583690987125, 'mean_word_length': 2.9914383561643834, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5750276', 'n_tokens_mistral': 819, 'n_tokens_neox': 790, 'n_words': 175}