<commit_before>use strict; use warnings;
for (<tests/*.sil>, <examples/*.sil>, "documentation/sile.sil") {
    next if /macros.sil/;
    print "### Compiling $_\n";
    my $expectation = $_; $expectation =~ s/\.sil$/\.expected/;
    if (-f $expectation) {
        my $out = $_; $out =~ s/\.sil$/\.actual/;
        exit $? >> 8 if system qq{./sile -e 'require("core/debug-output")' $_ > $out};
        if (system("diff -u $expectation $out")) {
            print("\n\n<<< EXPECTED >>>\n"); system("cat $expectation");  
            print("\n\n<<< GOT >>>\n"); system("cat $out");  
            exit;
        }
    } else {
        exit $? >> 8 if system("./sile", $_);
    }
}<commit_msg>Option for just running regression tests. (Not smoke tests.)<commit_after>use strict; use warnings;
my $regression = ($ARGV[0] && $ARGV[0] =~ /--regression/i);
for (<tests/*.sil>, <examples/*.sil>, "documentation/sile.sil") {
    next if /macros.sil/;
    print "### Compiling $_\n";
    my $expectation = $_; $expectation =~ s/\.sil$/\.expected/;
    if (-f $expectation) {
        my $out = $_; $out =~ s/\.sil$/\.actual/;
        exit $? >> 8 if system qq{./sile -e 'require("core/debug-output")' $_ > $out};
        if (system("diff -u $expectation $out")) {
            print("\n\n<<< EXPECTED >>>\n"); system("cat $expectation");  
            print("\n\n<<< GOT >>>\n"); system("cat $out");  
            exit;
        }
    } elsif (!$regression) {
        exit $? >> 8 if system("./sile", $_);
    }
}
{'fraction_non_alphanumeric': 0.23580494321977288, 'fraction_numerical': 0.004008016032064128, 'mean_word_length': 2.256521739130435, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 29, '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': '3255577', 'n_tokens_mistral': 538, 'n_tokens_neox': 525, 'n_words': 122}