From 786d98cd71a32b3773f797b1f36909f0bf703efd Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Tue, 28 Oct 2014 20:15:40 +0200 Subject: [PATCH] Do not update files for trivial differences --- tools/testupdate.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/testupdate.sh b/tools/testupdate.sh index f530b8a..a5d5513 100755 --- a/tools/testupdate.sh +++ b/tools/testupdate.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Update the reference test data to match what is actually produced # This should only be executed after manually verifying that the @@ -8,6 +8,12 @@ # # +# Remove elements that do not affect the structure of a file +remove_trivia() +{ + grep -v 'Generated by' "$@" +} + for i in dot umldoc do git ls-files testdata/*-ref | @@ -15,7 +21,7 @@ do while read refname outname do if [ -r "$outname" -a -r "$outname" ] && \ - ! cmp -s $refname $outname + ! diff <(remove_trivia $refname) <(remove_trivia $outname) >/dev/null then cp $outname $refname fi