<commit_before>#!/usr/bin/env perl

use strict;
use warnings;

my $regression = ($ARGV[0] && $ARGV[0] =~ /--regression/i);
my $exit = 0;
for (<tests/*.sil>, <examples/*.sil>, "documentation/sile.sil") {
    next if /macros.sil/;
    my $expectation = $_; $expectation =~ s/\.sil$/\.expected/;
    if (-f $expectation and $regression) {
        # Only test OSX specific regressions if running OSX
        if ($_ =~ /_darwin\.sil/ && $^O !~ 'darwin') {
            next;
        }
        print "### Regression testing $_\n";
        my $out = $_; $out =~ s/\.sil$/\.actual/;
        exit $? >> 8 if system qq{./sile -e 'require("core/debug-output")' $_ > $out};
        if (system("diff -U0 $expectation $out")) {
			$exit = 1;
        }
    } elsif (!$regression) {
        print "### Compiling $_\n";
        exit $? >> 8 if system("./sile", $_);
    }
}
exit $exit;<commit_msg>separate compile tests from regression tests<commit_after>#!/usr/bin/env perl

use strict;
use warnings;

my $regression = ($ARGV[0] && $ARGV[0] =~ /--regression/i);
if ($regression) {
	my $exit = 0;
	for (<tests/*.sil>) {
		my $expectation = $_; $expectation =~ s/\.sil$/\.expected/;
		if (-f $expectation) {
			# Only test OS specific regressions on their respective OSes
			next if ($_ =~ /_\w+\.sil/ && $_ !~ /_$^O\.sil/);
			print "### Regression testing $_\n";
			my $out = $_; $out =~ s/\.sil$/\.actual/;
			exit $? >> 8 if system qq{./sile -e 'require("core/debug-output")' $_ > $out};
			if (system("diff -U0 $expectation $out")) {
				$exit = 1;
			}
		}
	}
	exit $exit;
} else {
	for (<examples/*.sil>, "documentation/sile.sil") {
		next if /macros.sil/;
		print "### Compiling $_\n";
		exit $? >> 8 if system("./sile", $_);
	}
}
{'fraction_non_alphanumeric': 0.2222222222222222, 'fraction_numerical': 0.008144269924374637, 'mean_word_length': 2.5245901639344264, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '5278913', 'n_tokens_mistral': 700, 'n_tokens_neox': 651, 'n_words': 158}