summaryrefslogtreecommitdiff
path: root/ldmicro/reg/run-tests.pl
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/reg/run-tests.pl')
-rw-r--r--ldmicro/reg/run-tests.pl33
1 files changed, 33 insertions, 0 deletions
diff --git a/ldmicro/reg/run-tests.pl b/ldmicro/reg/run-tests.pl
new file mode 100644
index 0000000..94d5ed0
--- /dev/null
+++ b/ldmicro/reg/run-tests.pl
@@ -0,0 +1,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 = "../build/LDMicro /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);
+}