socsvn commit: r237868 - soc2012/jhagewood/diff
jhagewood at FreeBSD.org
jhagewood at FreeBSD.org
Mon Jun 18 02:58:03 UTC 2012
Author: jhagewood
Date: Mon Jun 18 02:58:00 2012
New Revision: 237868
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237868
Log:
Added:
soc2012/jhagewood/diff/diff-test.sh
Added: soc2012/jhagewood/diff/diff-test.sh
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2012/jhagewood/diff/diff-test.sh Mon Jun 18 02:58:00 2012 (r237868)
@@ -0,0 +1,57 @@
+# Script for testing BSD diff outputs against GNU diff outputs.
+# Jesse Hagewood
+# jhagewood at freebsd.org
+
+#!/bin/sh
+
+rm -rf ./test_outputs
+mkdir ./test_outputs
+mkdir ./test_outputs/gnu
+mkdir ./test_outputs/bsd
+
+#
+# Run GNU diff with various options, direct output to a file.
+#
+
+# Default diff
+diff 1.txt 2.txt >> ./test_outputs/gnu/diff.txt
+
+# Unified output
+diff -u 1.txt 2.txt >> ./test_outputs/gnu/unified.txt
+diff --unified 1.txt 2.txt >> ./test_outputs/gnu/unified.txt
+
+# Context output
+diff -c 1.txt 2.txt >> ./test_outputs/gnu/context.txt
+diff --context 1.txt 2.txt >> ./test_outputs/gnu/context.txt
+
+# Normal format output
+diff --normal 1.txt 2.txt >> ./test_outputs/gnu/normal.txt
+diff -c --normal 1.txt 2.txt >> ./test_outputs/gnu/normal.txt
+diff -u --normal 1.txt 2.txt >> ./test_outputs/gnu/normal.txt
+
+#
+# Run BSD diff with various options, direct output to a file.
+#
+
+# Default diff
+./diff 1.txt 2.txt >> ./test_outputs/bsd/diff.txt
+
+# Unified output
+./diff -u 1.txt 2.txt >> ./test_outputs/bsd/unified.txt
+./diff --unified 1.txt 2.txt >> ./test_outputs/bsd/unified.txt
+
+# Context output
+./diff -c 1.txt 2.txt >> ./test_outputs/bsd/context.txt
+./diff --context 1.txt 2.txt >> ./test_outputs/bsd/context.txt
+
+# Normal format output
+./diff --normal 1.txt 2.txt >> ./test_outputs/bsd/normal.txt
+./diff -c --normal 1.txt 2.txt >> ./test_outputs/bsd/normal.txt
+./diff -u --normal 1.txt 2.txt >> ./test_outputs/bsd/normal.txt
+
+#
+# Get the diff between the GNU and BSD outputs.
+#
+
+diff -rupN ./test_outputs/gnu/ ./test_outputs/bsd/ >> ./test_outputs/gnu-bsd-diff.txt
+
More information about the svn-soc-all
mailing list