test: Add a 'make test' target, clean up script a little.

This commit is contained in:
Solomon Peachy 2018-05-19 17:45:19 -04:00
parent 67366b56a0
commit 1df775e9d4
2 changed files with 9 additions and 4 deletions

View File

@ -35,7 +35,7 @@ RM ?= rm
# Flags
CFLAGS += -Wall -Wextra -g -Og -D_GNU_SOURCE -std=c99 # -Wconversion
LDFLAGS += `pkg-config --libs libusb-1.0`
LDFLAGS += `pkg-config --libs libusb-1.0`
CPPFLAGS += `pkg-config --cflags libusb-1.0`
# CPPFLAGS += -DLIBUSB_PRE_1_0_10
CPPFLAGS += -DURI_PREFIX=\"$(BACKEND_NAME)\"
@ -79,6 +79,9 @@ $(BACKENDS): $(EXEC_NAME)
cppcheck:
$(CPPCHECK) -q -v --std=c99 --enable=all --suppress=variableScope --suppress=selfAssignment --suppress=unusedStructMember -I. -I/usr/include -DCORRTABLE_PATH=\"$(BACKEND_DATA_DIR)\" --include=lib70x/libMitsuD70ImageReProcess.h $(CPPFLAGS) $(SOURCES)
test: dyesub_backend
./regression.pl < regression.csv 2>&1 |grep FAIL
install:
$(MKDIR) -p $(CUPS_BACKEND_DIR)
$(INSTALL) -o root -m 700 $(EXEC_NAME) $(CUPS_BACKEND_DIR)/$(BACKEND_NAME)

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
my @array;
my $retval = 0;
while (<STDIN>) {
chomp;
@ -19,11 +19,13 @@ while (<STDIN>) {
my $rval = system(@args);
if ($rval < 0) {
print "***** FAIL: failure to launch ($rval)\n";
print "***** FAIL: failure to launch ($rval)\n";
$retval++;
} elsif ($rval > 0) {
print "***** FAIL: failure to parse/execute ($rval) $row[0] $row[1] $row[2] $row[3] \n";
$retval++;
} else {
print "***** PASS\n";
}
}
exit($retval);