From owner-svn-soc-all@FreeBSD.ORG Thu Jul 19 17:31:46 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id D5AF8106566B for ; Thu, 19 Jul 2012 17:31:44 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 19 Jul 2012 17:31:44 +0000 Date: Thu, 19 Jul 2012 17:31:44 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120719173144.D5AF8106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r239583 - soc2012/jhagewood/diff3 X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 17:31:47 -0000 Author: jhagewood Date: Thu Jul 19 17:31:44 2012 New Revision: 239583 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=239583 Log: test script Added: soc2012/jhagewood/diff3/diff3-test.sh Added: soc2012/jhagewood/diff3/diff3-test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2012/jhagewood/diff3/diff3-test.sh Thu Jul 19 17:31:44 2012 (r239583) @@ -0,0 +1,79 @@ +# Script for testing BSD diff3 outputs against GNU diff3 outputs. +# Jesse Hagewood +# jhagewood@freebsd.org + +#!/bin/sh + +rm -rf ./test_outputs +mkdir ./test_outputs +mkdir ./test_outputs/gnu +mkdir ./test_outputs/bsd + +run () { + + # --strip-trailing-cr + $1 --ignore-space-change 1.txt 2.txt 3.txt >> $2/ignrspacechg.txt + + # --text + $1 -a 1.txt 2.txt 3.txt >> $2/text.txt + $1 --text 1.txt 2.txt 3.txt >> $2/text.txt + + # --ed + $1 -e 1.txt 2.txt 3.txt >> $2/ed.txt + $1 --ed 1.txt 2.txt 3.txt >> $2/ed.txt + + # --show-overlap + $1 -E 1.txt 2.txt 3.txt >> $2/showoverlap.txt + $1 --show-overlap 1.txt 2.txt 3.txt >> $2/showoverlap.txt + + # --show-all + $1 -A 1.txt 2.txt 3.txt >> $2/showall.txt + $1 --show-all 1.txt 2.txt 3.txt >> $2/showall.txt + + # --overlap-only + $1 -x 1.txt 2.txt 3.txt >> $2/overlaponly.txt + $1 --overlap-only 1.txt 2.txt 3.txt >> $2/overlaponly.txt + + # -X + $1 -X 1.txt 2.txt 3.txt >> $2/X.txt + + # --easy-only + $1 -3 1.txt 2.txt 3.txt >> $2/easyonly.txt + $1 --easy-only 1.txt 2.txt 3.txt >> $2/easyonly.txt + + # --merge + $1 -m 1.txt 2.txt 3.txt >> $2/merge.txt + $1 --merge 1.txt 2.txt 3.txt >> $2/merge.txt + + # --label + $1 -L "test" 1.txt 2.txt 3.txt >> $2/label.txt + $1 --label="test" 1.txt 2.txt 3.txt >> $2/label.txt + + # -i + $1 -i 1.txt 2.txt 3.txt >> $2/i.txt + + # --initial-tab + $1 -T 1.txt 2.txt 3.txt >> $2/initialtab.txt + $1 --initial-tab 1.txt 2.txt 3.txt >> $2/initialtab.txt + + # --diff-program + $1 --diff-program="/usr/bin/diff" 1.txt 2.txt 3.txt >> $2/diffprog.txt + + # --output + $1 -o $2/output.txt 1.txt 2.txt >> /dev/null + $1 --output=$2/output.txt 1.txt 2.txt >> /dev/null + +} + +DIR_PATH="./test_outputs/gnu" +DIFF_PATH="/usr/bin/diff3" +run "$DIFF_PATH" "$DIR_PATH" +DIR_PATH="./test_outputs/bsd" +DIFF_PATH="./diff3prog" +run "$DIFF_PATH" "$DIR_PATH" + +# +# Get the diff between the GNU sdiff and BSD sdiff outputs. +# + +diff -rupN ./test_outputs/gnu/ ./test_outputs/bsd/ >> ./test_outputs/gnu-bsd-diff3.txt