[107806] branches/gsoc13-tests/tests/test/statefile-version2-outdated
marius at macports.org
marius at macports.org
Fri Jul 5 17:10:53 PDT 2013
Revision: 107806
https://trac.macports.org/changeset/107806
Author: marius at macports.org
Date: 2013-07-05 17:10:53 -0700 (Fri, 05 Jul 2013)
Log Message:
-----------
Added statefile-v2-outdated test.
Added Paths:
-----------
branches/gsoc13-tests/tests/test/statefile-version2-outdated/test.tcl
Removed Paths:
-------------
branches/gsoc13-tests/tests/test/statefile-version2-outdated/Makefile
branches/gsoc13-tests/tests/test/statefile-version2-outdated/master
Deleted: branches/gsoc13-tests/tests/test/statefile-version2-outdated/Makefile
===================================================================
--- branches/gsoc13-tests/tests/test/statefile-version2-outdated/Makefile 2013-07-06 00:06:24 UTC (rev 107805)
+++ branches/gsoc13-tests/tests/test/statefile-version2-outdated/Makefile 2013-07-06 00:10:53 UTC (rev 107806)
@@ -1,15 +0,0 @@
-include ../../../Mk/macports.autoconf.mk
-
-.PHONY: test
-
-$(bindir)/port:
- @echo "Please install MacPorts before running this test"
- @exit 1
-
-test:
- @PORTSRC=$(PORTSRC) $(bindir)/port configure >/dev/null 2>&1
- @cp statefile work/.macports.statefile-version2-outdated.state
- @PORTSRC=$(PORTSRC) $(bindir)/port destroot >output 2>&1 || (cat output; exit 1)
- @diff -u master output || (echo "statefile version 2 was outdated but didn't cause a fresh build"; exit 1)
- @PORTSRC=$(PORTSRC) $(bindir)/port clean >/dev/null 2>&1
- @rm output
Deleted: branches/gsoc13-tests/tests/test/statefile-version2-outdated/master
===================================================================
--- branches/gsoc13-tests/tests/test/statefile-version2-outdated/master 2013-07-06 00:06:24 UTC (rev 107805)
+++ branches/gsoc13-tests/tests/test/statefile-version2-outdated/master 2013-07-06 00:10:53 UTC (rev 107806)
@@ -1,7 +0,0 @@
-Portfile changed since last build; discarding previous state.
----> Fetching distfiles for statefile-version2-outdated
----> Verifying checksums for statefile-version2-outdated
----> Extracting statefile-version2-outdated
----> Configuring statefile-version2-outdated
----> Building statefile-version2-outdated
----> Staging statefile-version2-outdated into destroot
Added: branches/gsoc13-tests/tests/test/statefile-version2-outdated/test.tcl
===================================================================
--- branches/gsoc13-tests/tests/test/statefile-version2-outdated/test.tcl (rev 0)
+++ branches/gsoc13-tests/tests/test/statefile-version2-outdated/test.tcl 2013-07-06 00:10:53 UTC (rev 107806)
@@ -0,0 +1,47 @@
+package require tcltest 2
+namespace import tcltest::*
+
+source [file dirname $argv0]/../library.tcl
+
+makeFile "" $output_file
+set path [file dirname [file normalize $argv0]]
+
+# Initial setup
+load_variables $path
+set_dir
+port_index
+port_config $path
+file copy -force $path/statefile $work_dir/.macports.statefile-version2-outdated.state
+port_desroot $path
+port_clean $path
+
+proc state_v2_out {warn} {
+ global path
+ global output_file
+
+ if {[string compare $warn "no"]} {
+ set msg "*discarding previous state*"
+ } else {
+ set msg "*staging*destroot*"
+ }
+
+ set line [get_line $path/$output_file $msg]
+ return $line
+}
+
+test warning_check {
+ Regression test for statefile-v2-outdated discard prev version.
+} -body {
+ state_v2_out yes
+} -result "portfile changed since last build; discarding previous state."
+
+test output_check {
+ Regression test for statefile-v2-outdated output.
+} -body {
+ state_v2_out no
+} -result "---> staging statefile-version2-outdated into destroot"
+
+removeDirectory $work_dir
+
+cleanup
+cleanupTests
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130705/14671573/attachment.html>
More information about the macports-changes
mailing list