summaryrefslogtreecommitdiff
path: root/run-test.sh.in
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-01-04 15:42:04 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-01-04 15:42:04 -0500
commitc6e8003fb8854d2bccf744cae52ecc1400afcf29 (patch)
tree0798867cc8da3e5f169fad4b08ae2ca0b3ac08c9 /run-test.sh.in
parentb34c0f705bdec52dba4f83e7d4a02afa5b3b9a9c (diff)
Run diff on the before and after documents, and compare the diff outputs.
Diffstat (limited to 'run-test.sh.in')
-rwxr-xr-xrun-test.sh.in40
1 files changed, 36 insertions, 4 deletions
diff --git a/run-test.sh.in b/run-test.sh.in
index a2125b5..e7ae067 100755
--- a/run-test.sh.in
+++ b/run-test.sh.in
@@ -9,15 +9,47 @@ dump_files()
continue
fi
dumppath=$(echo "$filepath" | sed -e 's/\.xls$/\.log/g')
- @PYTHON@ "$XLS_DUMP_PATH" "$filepath" > "$dumppath"
+ @PYTHON@ "$XLS_DUMP_PATH" --dump-mode=canonical-xml "$filepath" > "$dumppath"
done
}
-export LD_LIBRARY_PATH=@OOO_INSTALL_PATH@/program:@OOO_INSTALL_PATH@/ure/lib
source @ROOTDIR@/setenv.sh
+
+# First, import and export each xls document.
+echo "First, import and export echo xls document."
+export LD_LIBRARY_PATH=@OOO_INSTALL_PATH@/program:@OOO_INSTALL_PATH@/ure/lib
mkdir "$CTRL_XLS_OUT_DIR" 2>/dev/null || /bin/true
cd @OOO_INSTALL_PATH@/ure/lib
@EXECDIR@/run-soffice || exit 1
-dump_files "$CTRL_XLS_IN_DIR"
-dump_files "$CTRL_XLS_OUT_DIR"
+# Dump the contents of before and after documents.
+echo "Dump the contents of the original and exported documents."
+dump_files "$CTRL_XLS_IN_DIR" || exit 1
+dump_files "$CTRL_XLS_OUT_DIR" || exit 1
+
+echo "Now, compare the dumps to see if anything differs before and after."
+# Now, compare the dumps to see if anything differs.
+mkdir "$LOG_DIFF_DIR" 2>/dev/null || /bin/true
+everdifferent="no"
+for file in $(ls "$CTRL_XLS_IN_DIR"); do
+ fileext=$(echo "$file" | sed -e 's/.*\.//g')
+ if test $fileext != "log"; then
+ continue
+ fi
+ inpath="$CTRL_XLS_IN_DIR/$file"
+ outpath="$CTRL_XLS_OUT_DIR/$file"
+ diffoutpath="$LOG_DIFF_DIR/$file"
+ filesdiffer="no"
+ /usr/bin/diff -u "$inpath" "$outpath" > "$diffoutpath" || filesdiffer="yes"
+ if test "$filesdiffer" == "yes"; then
+ xlsfile=$(echo "$file" | sed -e 's/\.log$/\.xls/g')
+ echo "$xlsfile differs."
+ everdifferent="yes"
+ else
+ rm "$diffoutpath"
+ fi
+done
+
+if test "$everdifferent" == "yes"; then
+ echo "Content of one or more files differ. Check the full diff output(s) in $LOG_DIFF_DIR for more details."
+fi