Revision: 74297
http://sourceforge.net/p/brlcad/code/74297
Author: brlcad
Date: 2019-11-05 20:47:22 +0000 (Tue, 05 Nov 2019)
Log Message:
-----------
move file comparison functions from red.sh to library.sh since they are
generally useful, so other tests can use them.
Modified Paths:
--------------
brlcad/trunk/regress/library.sh
brlcad/trunk/regress/red.sh
Modified: brlcad/trunk/regress/library.sh
===================================================================
--- brlcad/trunk/regress/library.sh 2019-11-05 20:45:00 UTC (rev 74296)
+++ brlcad/trunk/regress/library.sh 2019-11-05 20:47:22 UTC (rev 74297)
@@ -92,7 +92,7 @@
# the return status. reads LOGFILE global, increments STATUS global.
run ( ) {
log "... running $@"
- "$@" >> $LOGFILE 2>&1
+ "$@" >> "$LOGFILE" 2>&1
ret=$?
case "x$STATUS" in
'x'|*[!0-9]*)
@@ -107,6 +107,49 @@
}
+should_be_different ( ) {
+ if test $# -ne 2 ; then
+ log "INTERNAL ERROR: should_be_different has wrong arg count ($# -ne 2)"
+ exit 1
+ fi
+ if test "x$1" = "x" ; then
+ log "INTERNAL ERROR: should_be_different has empty file #1"
+ exit 1
+ fi
+ if test "x$2" = "x" ; then
+ log "INTERNAL ERROR: should_be_different has empty file #2"
+ exit 1
+ fi
+ if test "x`diff $1 $2`" = "x" ; then
+ log "ERROR: comparison failed ($1 and $2 are identical, expected
change)"
+ STATUS="`expr $STATUS + 1`"
+ export STATUS
+ fi
+}
+
+
+should_be_same ( ) {
+ if test $# -ne 2 ; then
+ log "INTERNAL ERROR: should_be_same has wrong arg count ($# -ne 2)"
+ exit 1
+ fi
+ if test "x$1" = "x" ; then
+ log "INTERNAL ERROR: should_be_same has empty file #1"
+ exit 1
+ fi
+ if test "x$2" = "x" ; then
+ log "INTERNAL ERROR: should_be_same has empty file #2"
+ exit 1
+ fi
+ if test "x`diff $1 $2`" != "x" ; then
+ log "ERROR: comparison failed ($1 and $2 are different, expected no
change)"
+ run diff -u $1 $2
+ STATUS="`expr $STATUS + 1`"
+ export STATUS
+ fi
+}
+
+
###
# ensearch {command_to_find}
#
Modified: brlcad/trunk/regress/red.sh
===================================================================
--- brlcad/trunk/regress/red.sh 2019-11-05 20:45:00 UTC (rev 74296)
+++ brlcad/trunk/regress/red.sh 2019-11-05 20:47:22 UTC (rev 74297)
@@ -99,49 +99,6 @@
}
-should_be_different ( ) {
- if test $# -ne 2 ; then
- log "INTERNAL ERROR: should_be_different has wrong arg count ($# -ne 2)"
- exit 1
- fi
- if test "x$1" = "x" ; then
- log "INTERNAL ERROR: should_be_different has empty file #1"
- exit 1
- fi
- if test "x$2" = "x" ; then
- log "INTERNAL ERROR: should_be_different has empty file #2"
- exit 1
- fi
- if test "x`diff $1 $2`" = "x" ; then
- log "ERROR: comparison failed ($1 and $2 are identical, expected
change)"
- STATUS="`expr $STATUS + 1`"
- export STATUS
- fi
-}
-
-
-should_be_same ( ) {
- if test $# -ne 2 ; then
- log "INTERNAL ERROR: should_be_same has wrong arg count ($# -ne 2)"
- exit 1
- fi
- if test "x$1" = "x" ; then
- log "INTERNAL ERROR: should_be_same has empty file #1"
- exit 1
- fi
- if test "x$2" = "x" ; then
- log "INTERNAL ERROR: should_be_same has empty file #2"
- exit 1
- fi
- if test "x`diff $1 $2`" != "x" ; then
- log "ERROR: comparison failed ($1 and $2 are different, expected no
change)"
- run diff -u $1 $2
- STATUS="`expr $STATUS + 1`"
- export STATUS
- fi
-}
-
-
dump ( ) {
if test $# -ne 2 ; then
log "INTERNAL ERROR: dump has wrong arg count ($# -ne 2)"
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits