[darwinbuild-changes] [877] branches/PR-8416637/testing/darwinup/run-tests.sh

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 16 14:18:52 PDT 2010


Revision: 877
          http://trac.macosforge.org/projects/darwinbuild/changeset/877
Author:   wsiegrist at apple.com
Date:     2010-09-16 14:18:51 -0700 (Thu, 16 Sep 2010)
Log Message:
-----------
Add test cases for forcing object changes.

Modified Paths:
--------------
    branches/PR-8416637/testing/darwinup/run-tests.sh

Modified: branches/PR-8416637/testing/darwinup/run-tests.sh
===================================================================
--- branches/PR-8416637/testing/darwinup/run-tests.sh	2010-09-16 18:22:47 UTC (rev 876)
+++ branches/PR-8416637/testing/darwinup/run-tests.sh	2010-09-16 21:18:51 UTC (rev 877)
@@ -20,6 +20,20 @@
 
 ROOTS="root root2 root3"
 
+
+function is_file {
+	test -f $1 -a ! -L $1
+}
+
+function is_dir {
+	test -d $1 -a ! -L $1
+}
+
+function is_link {
+	test -L $1;
+}
+
+
 echo "INFO: Cleaning up testing area ..."
 rm -rf $PREFIX
 mkdir -p $PREFIX
@@ -319,9 +333,62 @@
 $DIFF $ORIG $DEST 2>&1
 
 
-# XXX: need to test the force option overrides expected fail cases
+echo "========== TEST: Forcing object change: file to directory ==========" 
+is_file $DEST/rep_file
+$DARWINUP -f install $PREFIX/rep_file_dir
+is_dir $DEST/rep_file
+$DARWINUP uninstall newest
+is_file $DEST/rep_file
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
 
+echo "========== TEST: Forcing object change: file to symlink ==========" 
+is_file $DEST/rep_file
+$DARWINUP -f install $PREFIX/rep_file_link
+is_link $DEST/rep_file
+$DARWINUP uninstall newest
+is_file $DEST/rep_file
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
 
+echo "========== TEST: Forcing object change: directory to file ==========" 
+is_dir $DEST/rep_dir
+$DARWINUP -f install $PREFIX/rep_dir_file
+is_file $DEST/rep_dir
+$DARWINUP uninstall newest
+is_dir $DEST/rep_dir
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
+
+echo "========== TEST: Forcing object change: directory to symlink ==========" 
+is_dir $DEST/rep_dir
+$DARWINUP -f install $PREFIX/rep_dir_link
+is_link $DEST/rep_dir
+$DARWINUP uninstall newest
+is_dir $DEST/rep_dir
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
+
+echo "========== TEST: Forcing object change: symlink to file ==========" 
+is_link $DEST/rep_link
+$DARWINUP -f install $PREFIX/rep_link_file
+is_file $DEST/rep_link
+$DARWINUP uninstall newest
+is_link $DEST/rep_link
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
+
+echo "========== TEST: Forcing object change: symlink to directory ==========" 
+is_link $DEST/rep_link
+$DARWINUP -f install $PREFIX/rep_link_dir
+is_dir $DEST/rep_link
+$DARWINUP uninstall newest
+is_link $DEST/rep_link
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
+
+
+
 #
 # The following are expected failures
 #
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100916/05b59c37/attachment-0001.html>


More information about the darwinbuild-changes mailing list