summaryrefslogtreecommitdiff
path: root/ldmicro/reg/run-tests.pl
diff options
context:
space:
mode:
authorakshay-c2019-01-30 12:23:44 +0530
committerakshay-c2019-01-30 12:23:44 +0530
commit4196481f74afb84e5cc59cdf00c06c1ca1becab7 (patch)
treeb531deb0466897691f08f9076b7012592f026664 /ldmicro/reg/run-tests.pl
downloadLDmicroQt-4196481f74afb84e5cc59cdf00c06c1ca1becab7.tar.gz
LDmicroQt-4196481f74afb84e5cc59cdf00c06c1ca1becab7.tar.bz2
LDmicroQt-4196481f74afb84e5cc59cdf00c06c1ca1becab7.zip
First commit
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);
+}