Revision: 74303
http://sourceforge.net/p/brlcad/code/74303
Author: brlcad
Date: 2019-11-06 08:47:59 +0000 (Wed, 06 Nov 2019)
Log Message:
-----------
the iges regression was actually doing a bunch of work, ignoring it all, and
only failing if the singular m35 region tested at the end failed. fixed the
STATUS propagation so now all issues are detected and reported correctly.
alas, this means they cannot be turned on because there are problems that need
to be fixed -- they are currently commented out with FIXME notes.
Modified Paths:
--------------
brlcad/trunk/regress/iges.sh
brlcad/trunk/regress/library.sh
Modified: brlcad/trunk/regress/iges.sh
===================================================================
--- brlcad/trunk/regress/iges.sh 2019-11-06 00:36:51 UTC (rev 74302)
+++ brlcad/trunk/regress/iges.sh 2019-11-06 08:47:59 UTC (rev 74303)
@@ -113,11 +113,38 @@
exit 1
fi
+# test that the first g-iges -o output matches the stdout output
+files_match iges.export.iges iges.export.stdout.iges -I 'G'
+if test $? -ne 0 ; then
+ STATUS="`expr $STATUS + 1`"
+ export STATUS
+fi
+
# G TO IGES TO G
# test IGES -> G
output="iges.import.g"
rm -f "$output"
+run $IGESG -o "$output" iges.export.iges
+if [ ! -f "$output" ] ; then
+ log "ERROR: iges-g failed to create $output"
+ log "-> iges.sh FAILED, see $LOGFILE"
+ exit 1
+fi
+
+# test IGES -> G (with -p)
+output="iges.import2.g"
+rm -f "$output"
+run $IGESG -o "$output" -p iges.export.iges
+if [ ! -f "$output" ] ; then
+ log "ERROR: iges-g failed to create $output"
+ log "-> iges.sh FAILED, see $LOGFILE"
+ exit 1
+fi
+
+# test IGES -> G (with -p -N name)
+output="iges.import3.g"
+rm -f "$output"
run $IGESG -o "$output" -p -N box.nmg iges.export.iges
if [ ! -f "$output" ] ; then
log "ERROR: iges-g failed to create $output"
@@ -125,13 +152,32 @@
exit 1
fi
+# test that these produced different output
+files_differ iges.import.g iges.import2.g
+if test $? -ne 0 ; then
+ STATUS="`expr $STATUS + 1`"
+ export STATUS
+fi
+# FIXME: these should match but -N is creating 'box.nmgA'
+# files_match iges.import2.g iges.import3.g
+# if test $? -ne 0 ; then
+# STATUS="`expr $STATUS + 1`"
+# export STATUS
+# fi
+# FIXME: these should match but -N is creating 'box.nmgA'
+# files_match iges.import.g iges.import3.g
+# if test $? -ne 0 ; then
+# STATUS="`expr $STATUS + 1`"
+# export STATUS
+# fi
+
# G TO IGES TO G TO IGES (ROUND TRIP)
# make sure we don't permute vertices or introduce some other
# unintended change.
-# test G -> IGES #2 via -o
-output="iges.export2.iges"
+# test G -> IGES #2a via -o
+output="iges.import.export.iges"
rm -f "$output"
run $GIGES -o "$output" iges.import.g box.nmg
if [ ! -f "$output" ] ; then
@@ -140,9 +186,10 @@
exit 1
fi
-# test G -> IGES #2 via stdout (can't use 'run')
-output="iges.export2.stdout.iges"
-$GIGES iges.import.g box.nmg > "$output" 2>> "$LOGFILE"
+# test G -> IGES #2b via -o
+output="iges.import2.export.iges"
+rm -f "$output"
+run $GIGES -o "$output" iges.import2.g box.nmg
if [ ! -f "$output" ] ; then
log "ERROR: g-iges failed to create $output"
log "-> iges.sh FAILED, see $LOGFILE"
@@ -149,24 +196,44 @@
exit 1
fi
-# FIXME: test that these two files are identical
-# iges.export.iges
-# iges.export2.iges
+# test G -> IGES #2c via -o
+output="iges.import3.export.iges"
+rm -f "$output"
+run $GIGES -o "$output" iges.import3.g box.nmg
+if [ ! -f "$output" ] ; then
+ log "ERROR: g-iges failed to create $output"
+ log "-> iges.sh FAILED, see $LOGFILE"
+ exit 1
+fi
-# FIXME: test that these two files are identical
-# iges.export.stdout.iges
-# iges.export2.stdout.iges
+# COMPARE RESULTS
-# test IGES -> G #3 with -p (output nmg, not bot)
-run $IGESG -o iges.export3.stdout.g -p iges.export.stdout.iges
-if [ $? != 0 ] ; then
- log "...iges-g (2) FAILED, see $LOGFILE"
- STATUS=1
-else
- log "...iges-g (2) succeeded"
+# test that initial g-iges output does NOT match final BoT output
+files_differ iges.export.iges iges.import.export.iges -I 'G'
+if test $? -ne 0 ; then
+ STATUS="`expr $STATUS + 1`"
+ export STATUS
fi
-# check one other TGM known to have a conversion failure which should be
graceful
+# FIXME: these should match but vertices are permuted!
+# test that initial g-iges output DOES match final NMG output
+# files_match iges.export.iges iges.import2.export.iges -I 'G'
+# if test $? -ne 0 ; then
+# STATUS="`expr $STATUS + 1`"
+# export STATUS
+# fi
+
+# test that initial g-iges output DOES match final named NMG output
+# FIXME: these should match but iges-g -N is creating 'box.nmgA'
+# files_match iges.export.iges iges.import3.export.iges -I 'G'
+# if test $? -ne 0 ; then
+# STATUS="`expr $STATUS + 1`"
+# export STATUS
+# fi
+
+# COMPLEX TEST
+
+# check another TGM known to have a conversion failure which should be graceful
ASC2G="`ensearch asc2g`"
if test ! -f "$ASC2G" ; then
log "Unable to find asc2g, aborting"
@@ -184,9 +251,18 @@
# and test it (note it should work with the '-f' option, but fail
# without any options)
-$GIGES -f -o iges_file3.iges iges.m35.g r516 2>> iges.log > /dev/null
-STATUS=$?
+run $GIGES -f -o iges.m35.r516.iges iges.m35.g r516
+if test $? -ne 0 ; then
+ STATUS="`expr $STATUS + 1`"
+ export STATUS
+fi
+# TODO: add full m35 conversion test
+# run $GIGES -f -o iges.m35.iges iges.m35.g component
+# if test $? -ne 0 ; then
+# STATUS="`expr $STATUS + 1`"
+# export STATUS
+# fi
if [ X$STATUS = X0 ] ; then
log "-> iges.sh succeeded"
Modified: brlcad/trunk/regress/library.sh
===================================================================
--- brlcad/trunk/regress/library.sh 2019-11-06 00:36:51 UTC (rev 74302)
+++ brlcad/trunk/regress/library.sh 2019-11-06 08:47:59 UTC (rev 74303)
@@ -108,14 +108,14 @@
###
-# files_differ file1 file2
+# files_differ file1 file2 [diff args]
#
# comparison function returns success (zero) if the two specified
# files differ or either doesn't exist, returns error otherwise.
# Increments STATUS global.
files_differ ( ) {
- if test $# -ne 2 ; then
- log "INTERNAL ERROR: files_differ has wrong arg count ($# -ne 2)"
+ if test $# -lt 2 ; then
+ log "INTERNAL ERROR: files_differ has wrong arg count ($# < 2)"
exit 1
fi
if test "x$2" = "x" ; then
@@ -134,9 +134,15 @@
elif test ! -f "$1" ; then
log "ERROR: $1 does not exist"
ret=1
- elif test "x`diff $1 $2`" = "x" ; then
- log "ERROR: comparison failed ($1 and $2 are identical, expected
change)"
- ret=1
+ else
+ file1="$1"
+ file2="$2"
+ shift 2
+ log "... running diff $* $file1 $file2"
+ if test "x`diff $* $file1 $file2`" = "x" ; then
+ log "ERROR: comparison failed ($file1 and $file2 are identical,
expected change)"
+ ret=1
+ fi
fi
if test $ret -ne 0 ; then
@@ -148,14 +154,14 @@
###
-# files_match file1 file2
+# files_match file1 file2 [diff args]
#
# comparison function returns success (zero) if two specified files
# both exist and have the same contents, returns failure otherwise.
# Increments STATUS global.
files_match ( ) {
- if test $# -ne 2 ; then
- log "INTERNAL ERROR: files_match has wrong arg count ($# -ne 2)"
+ if test $# -lt 2 ; then
+ log "INTERNAL ERROR: files_match has wrong arg count ($# < 2)"
exit 1
fi
if test "x$2" = "x" ; then
@@ -174,13 +180,19 @@
elif test ! -f "$1" ; then
log "ERROR: $1 does not exist"
ret=1
- elif test "x`diff $1 $2`" != "x" ; then
- log "ERROR: comparison failed ($1 and $2 are different, expected no
change)"
- # display diff in the log
- log "BEGIN displaying differences ..."
- run diff -u $1 $2
- log "... DONE displaying differences."
- ret=1
+ else
+ file1="$1"
+ file2="$2"
+ shift 2
+ log "... running diff $* $file1 $file2"
+ if test "x`diff $* $file1 $file2`" != "x" ; then
+ log "ERROR: comparison failed ($file1 and $file2 are different,
expected no change)"
+ # display diff in the log
+ log "BEGIN logging differences:"
+ run diff -u $* $file1 $file2
+ log "DONE logging differences."
+ ret=1
+ fi
fi
if test $ret -ne 0 ; then
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