<commit_before>#!/usr/bin/perl

use File::Basename;

$found_test = 0;
$command .= "chpl ";
while (@ARGV) {
    $arg = shift @ARGV;
    if ($arg =~ m/.chpl$/) {
        $found_test = 1;

        ($filename, $path) = fileparse($arg);

        $compopts_file = "$path"."COMPOPTS";

        if (-e $compopts_file) {
            $compopts = `cat $compopts_file`;
            chomp $compopts;
        }

        $filebase = $filename;
        $filebase =~ s/.chpl$//;

        $compopts_file = "$path"."$filebase".".compopts";
        
        if (-e $compopts_file) {
            if ($compopts) {
                $compopts .= " ";
            }
            $compopts .= `cat $compopts_file`;
            chomp $compopts;
        }

        @compopts = split / /, $compopts;

        foreach $compopt (@compopts) {
            if ($compopt =~ m/.chpl$/) {
                $command .= "$path";
            }
            $command .= "$compopt ";
        }
        $command .= "$path$filename ";
    } else {
        $command .= "$arg ";
    }
}

die "no test specified" unless $found_test == 1;

print "$command\n";
system $command;<commit_msg>changed system to exec in perl script<commit_after>#!/usr/bin/perl

use File::Basename;

$found_test = 0;
$command = "chpl ";
while (@ARGV) {
    $arg = shift @ARGV;
    if ($arg =~ m/.chpl$/) {
        $found_test = 1;

        ($filename, $path) = fileparse($arg);

        $compopts_file = "$path"."COMPOPTS";

        if (-e $compopts_file) {
            $compopts = `cat $compopts_file`;
            chomp $compopts;
        }

        $filebase = $filename;
        $filebase =~ s/.chpl$//;

        $compopts_file = "$path"."$filebase".".compopts";
        
        if (-e $compopts_file) {
            if ($compopts) {
                $compopts .= " ";
            }
            $compopts .= `cat $compopts_file`;
            chomp $compopts;
        }

        @compopts = split / /, $compopts;

        foreach $compopt (@compopts) {
            if ($compopt =~ m/.chpl$/) {
                $command .= "$path";
            }
            $command .= "$compopt ";
        }
        $command .= "$path$filename ";
    } else {
        $command .= "$arg ";
    }
}

die "no test specified" unless $found_test == 1;

print "$command\n";
exec $command;
{'fraction_non_alphanumeric': 0.17139119058002616, 'fraction_numerical': 0.0026166593981683385, 'mean_word_length': 1.5659955257270695, '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': '2103783', 'n_tokens_mistral': 778, 'n_tokens_neox': 742, 'n_words': 157}