Project

General

Profile

« Previous | Next » 

Revision 1184

input.Makefile: verify: Print diff in two columns if verbose=1

View differences:

inputs/input.Makefile
19 19
date = $(shell date +"%Y-%m-%d-%H-%M-%S")
20 20

  
21 21
# Terminal
22
termCols := $(shell tput cols)
22 23
esc := '['
23 24
reset := $(esc)'0m'
24 25
emph := $(esc)'7m '
......
26 27

  
27 28
# Commands
28 29
CP = cp -p
29
DIFF = diff --unified=2
30
diff = diff --unified=2
31
diffVerbose = $(if $(verbose),diff --side-by-side --left-column\
32
--width=$(termCols),$(diff))
30 33

  
31 34
# Paths
32 35
root := $(selfDir_uZPPqC)..
......
151 154
ifneq ($(wildcard verify.ref*),)
152 155

  
153 156
verify: verify.ref verify.out _always
154
	-$(DIFF) $(+_)
157
	-$(diffVerbose) $(+_)
155 158
# don't abort on verification errors, which are expected during development
156 159

  
157 160
all += verify.out
......
182 185
define runTest
183 186
@echo "Testing $(abspath $@)..."
184 187
>$@ env test=1 n=$(test_n) $(1)
185
@(set -x; $(DIFF) $(call testRef,$@) $@) 2>&1 || { e=$$?;\
188
@(set -x; $(diff) $(call testRef,$@) $@) 2>&1 || { e=$$?;\
186 189
$(if $(wildcard $(call testRef,$@)),,cat $@;)\
187 190
$(if $(hasOwnRef),\
188 191
echo $(emph)"To accept new test output:"$(endEmph);\

Also available in: Unified diff