summaryrefslogtreecommitdiff
path: root/ldmicro/reg/run-tests.pl
blob: 91e81b8bab5eb016b429d7e331a48e5a6152a2f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl

if (not -d 'results/') {
    mkdir 'results';
}

$c = 0;
for $test (<tests/*.ld>) {
    $output = $test;
    $output =~ s/^tests/results/;
    $output =~ s/\.ld$/.hex/;

    unlink $output;

    $cmd = "../ldmicro.exe /c $test $output";
    system $cmd;
    $c++;
}

print "\ndifferences follow:\n";
@diff = `diff -q results expected`;
for(@diff) {
    print "    $_";
}
$fc = scalar @diff;
print "($fc difference(s)/$c)\n";
if($fc == 0) {
    print "pass!\n";
    exit(0);
} else {
    print "FAIL\n";
    exit(-1);
}