[96400] trunk/base/tests
cal at macports.org
cal at macports.org
Wed Aug 8 14:17:12 PDT 2012
Revision: 96400
https://trac.macports.org/changeset/96400
Author: cal at macports.org
Date: 2012-08-08 14:17:12 -0700 (Wed, 08 Aug 2012)
Log Message:
-----------
base: add tests for statefile format 1,2 and future unhandled statefile formats
Modified Paths:
--------------
trunk/base/tests/Makefile
Added Paths:
-----------
trunk/base/tests/test/statefile-unknown-version/
trunk/base/tests/test/statefile-unknown-version/Makefile
trunk/base/tests/test/statefile-unknown-version/Portfile
trunk/base/tests/test/statefile-unknown-version/master
trunk/base/tests/test/statefile-unknown-version/statefile
trunk/base/tests/test/statefile-version1/
trunk/base/tests/test/statefile-version1/Makefile
trunk/base/tests/test/statefile-version1/Portfile
trunk/base/tests/test/statefile-version1/master
trunk/base/tests/test/statefile-version1/statefile
trunk/base/tests/test/statefile-version1-outdated/
trunk/base/tests/test/statefile-version1-outdated/Makefile
trunk/base/tests/test/statefile-version1-outdated/Portfile
trunk/base/tests/test/statefile-version1-outdated/master
trunk/base/tests/test/statefile-version1-outdated/statefile
trunk/base/tests/test/statefile-version2/
trunk/base/tests/test/statefile-version2/Makefile
trunk/base/tests/test/statefile-version2/Portfile
trunk/base/tests/test/statefile-version2/master
trunk/base/tests/test/statefile-version2/statefile
trunk/base/tests/test/statefile-version2-invalid/
trunk/base/tests/test/statefile-version2-invalid/Makefile
trunk/base/tests/test/statefile-version2-invalid/Portfile
trunk/base/tests/test/statefile-version2-invalid/master
trunk/base/tests/test/statefile-version2-invalid/statefile
trunk/base/tests/test/statefile-version2-outdated/
trunk/base/tests/test/statefile-version2-outdated/Makefile
trunk/base/tests/test/statefile-version2-outdated/Portfile
trunk/base/tests/test/statefile-version2-outdated/master
trunk/base/tests/test/statefile-version2-outdated/statefile
Modified: trunk/base/tests/Makefile
===================================================================
--- trunk/base/tests/Makefile 2012-08-08 21:14:16 UTC (rev 96399)
+++ trunk/base/tests/Makefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -1,6 +1,6 @@
include ../Mk/macports.autoconf.mk
-TESTS?=checksums-1 svn-and-patchsites envvariables site-tags trace universal universal-2 xcodeversion dependencies-c dependencies-d dependencies-e case-insensitive-deactivate variants
+TESTS?=checksums-1 svn-and-patchsites envvariables site-tags trace universal universal-2 xcodeversion dependencies-c dependencies-d dependencies-e case-insensitive-deactivate variants statefile-version1 statefile-version1-outdated statefile-version2 statefile-version2-outdated statefile-version2-invalid statefile-unknown-version
PWD=$(shell pwd)
Added: trunk/base/tests/test/statefile-unknown-version/Makefile
===================================================================
--- trunk/base/tests/test/statefile-unknown-version/Makefile (rev 0)
+++ trunk/base/tests/test/statefile-unknown-version/Makefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,15 @@
+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-unknown-version.state
+ @PORTSRC=$(PORTSRC) $(bindir)/port destroot >output 2>&1 || (cat output; exit 1)
+ @diff -u master output || (echo "statfile version 3 was accepted, although it shouldn't (this is a hacky test, which might also fail if you change the number of pahses)"; exit 1)
+ @PORTSRC=$(PORTSRC) $(bindir)/port clean >/dev/null 2>&1
+ @rm output
Property changes on: trunk/base/tests/test/statefile-unknown-version/Makefile
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-unknown-version/Portfile
===================================================================
--- trunk/base/tests/test/statefile-unknown-version/Portfile (rev 0)
+++ trunk/base/tests/test/statefile-unknown-version/Portfile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,25 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+name statefile-unknown-version
+version 1
+categories test
+maintainers cal
+description Test port for statefiles of unknown version
+homepage http://www.macports.org/
+platforms darwin
+
+long_description ${description}
+
+distfiles
+
+fetch {}
+extract {}
+configure {}
+build {}
+destroot {
+ system "touch ${destroot}${prefix}/lib/${name}"
+}
+
+test {}
Property changes on: trunk/base/tests/test/statefile-unknown-version/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-unknown-version/master
===================================================================
--- trunk/base/tests/test/statefile-unknown-version/master (rev 0)
+++ trunk/base/tests/test/statefile-unknown-version/master 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,18 @@
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+---> Building statefile-unknown-version
+Warning: Unsupported statefile version '3'
+Warning: Please run 'port selfupdate' to update to the latest version of MacPorts
+---> Staging statefile-unknown-version into destroot
Added: trunk/base/tests/test/statefile-unknown-version/statefile
===================================================================
--- trunk/base/tests/test/statefile-unknown-version/statefile (rev 0)
+++ trunk/base/tests/test/statefile-unknown-version/statefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,6 @@
+version: 3
+target: org.macports.fetch
+target: org.macports.checksum
+target: org.macports.extract
+target: org.macports.patch
+target: org.macports.configure
Added: trunk/base/tests/test/statefile-version1/Makefile
===================================================================
--- trunk/base/tests/test/statefile-version1/Makefile (rev 0)
+++ trunk/base/tests/test/statefile-version1/Makefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,15 @@
+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-version1.state
+ @PORTSRC=$(PORTSRC) $(bindir)/port destroot >output 2>&1 || (cat output; exit 1)
+ @diff -u master output || (echo "statefile version 1 wasn't outdated but still triggered a rebuild"; exit 1)
+ @PORTSRC=$(PORTSRC) $(bindir)/port clean >/dev/null 2>&1
+ @rm output
Property changes on: trunk/base/tests/test/statefile-version1/Makefile
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version1/Portfile
===================================================================
--- trunk/base/tests/test/statefile-version1/Portfile (rev 0)
+++ trunk/base/tests/test/statefile-version1/Portfile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,25 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+name statefile-version1
+version 1
+categories test
+maintainers cal
+description Test port for current statefiles, version 1
+homepage http://www.macports.org/
+platforms darwin
+
+long_description ${description}
+
+distfiles
+
+fetch {}
+extract {}
+configure {}
+build {}
+destroot {
+ system "touch ${destroot}${prefix}/lib/${name}"
+}
+
+test {}
Property changes on: trunk/base/tests/test/statefile-version1/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version1/master
===================================================================
--- trunk/base/tests/test/statefile-version1/master (rev 0)
+++ trunk/base/tests/test/statefile-version1/master 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,2 @@
+---> Building statefile-version1
+---> Staging statefile-version1 into destroot
Added: trunk/base/tests/test/statefile-version1/statefile
===================================================================
--- trunk/base/tests/test/statefile-version1/statefile (rev 0)
+++ trunk/base/tests/test/statefile-version1/statefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,5 @@
+target: org.macports.fetch
+target: org.macports.checksum
+target: org.macports.extract
+target: org.macports.patch
+target: org.macports.configure
Added: trunk/base/tests/test/statefile-version1-outdated/Makefile
===================================================================
--- trunk/base/tests/test/statefile-version1-outdated/Makefile (rev 0)
+++ trunk/base/tests/test/statefile-version1-outdated/Makefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,16 @@
+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-version1-outdated.state
+ @touch -t 197001010000.09 work/.macports.statefile-version1-outdated.state
+ @PORTSRC=$(PORTSRC) $(bindir)/port destroot >output 2>&1 || (cat output; exit 1)
+ @diff -u master output || (echo "statfile version 1 was outdated but didn't cause a fresh build"; exit 1)
+ @PORTSRC=$(PORTSRC) $(bindir)/port clean >/dev/null 2>&1
+ @rm output
Property changes on: trunk/base/tests/test/statefile-version1-outdated/Makefile
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version1-outdated/Portfile
===================================================================
--- trunk/base/tests/test/statefile-version1-outdated/Portfile (rev 0)
+++ trunk/base/tests/test/statefile-version1-outdated/Portfile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,25 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+name statefile-version1-outdated
+version 1
+categories test
+maintainers cal
+description Test port for outdated statefiles, version 1
+homepage http://www.macports.org/
+platforms darwin
+
+long_description ${description}
+
+distfiles
+
+fetch {}
+extract {}
+configure {}
+build {}
+destroot {
+ system "touch ${destroot}${prefix}/lib/${name}"
+}
+
+test {}
Property changes on: trunk/base/tests/test/statefile-version1-outdated/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version1-outdated/master
===================================================================
--- trunk/base/tests/test/statefile-version1-outdated/master (rev 0)
+++ trunk/base/tests/test/statefile-version1-outdated/master 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,7 @@
+Portfile changed since last build; discarding previous state.
+---> Fetching distfiles for statefile-version1-outdated
+---> Verifying checksum(s) for statefile-version1-outdated
+---> Extracting statefile-version1-outdated
+---> Configuring statefile-version1-outdated
+---> Building statefile-version1-outdated
+---> Staging statefile-version1-outdated into destroot
Added: trunk/base/tests/test/statefile-version1-outdated/statefile
===================================================================
--- trunk/base/tests/test/statefile-version1-outdated/statefile (rev 0)
+++ trunk/base/tests/test/statefile-version1-outdated/statefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,5 @@
+target: org.macports.fetch
+target: org.macports.checksum
+target: org.macports.extract
+target: org.macports.patch
+target: org.macports.configure
Added: trunk/base/tests/test/statefile-version2/Makefile
===================================================================
--- trunk/base/tests/test/statefile-version2/Makefile (rev 0)
+++ trunk/base/tests/test/statefile-version2/Makefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,15 @@
+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.state
+ @PORTSRC=$(PORTSRC) $(bindir)/port destroot >output 2>&1 || (cat output; exit 1)
+ @diff -u master output || (echo "statefile version 2 wasn't outdated, but still triggered a rebuild"; exit 1)
+ @PORTSRC=$(PORTSRC) $(bindir)/port clean >/dev/null 2>&1
+ @rm output
Property changes on: trunk/base/tests/test/statefile-version2/Makefile
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version2/Portfile
===================================================================
--- trunk/base/tests/test/statefile-version2/Portfile (rev 0)
+++ trunk/base/tests/test/statefile-version2/Portfile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,25 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+name statefile-version2
+version 1
+categories test
+maintainers cal
+description Test port for current statefiles, version 2
+homepage http://www.macports.org/
+platforms darwin
+
+long_description ${description}
+
+distfiles
+
+fetch {}
+extract {}
+configure {}
+build {}
+destroot {
+ system "touch ${destroot}${prefix}/lib/${name}"
+}
+
+test {}
Property changes on: trunk/base/tests/test/statefile-version2/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version2/master
===================================================================
--- trunk/base/tests/test/statefile-version2/master (rev 0)
+++ trunk/base/tests/test/statefile-version2/master 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,2 @@
+---> Building statefile-version2
+---> Staging statefile-version2 into destroot
Added: trunk/base/tests/test/statefile-version2/statefile
===================================================================
--- trunk/base/tests/test/statefile-version2/statefile (rev 0)
+++ trunk/base/tests/test/statefile-version2/statefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,7 @@
+version: 2
+checksum: 9aca70a1bf19759dc9121a091c3661f265a2c72402591ac26019baaba2ac30e0
+target: org.macports.fetch
+target: org.macports.checksum
+target: org.macports.extract
+target: org.macports.patch
+target: org.macports.configure
Added: trunk/base/tests/test/statefile-version2-invalid/Makefile
===================================================================
--- trunk/base/tests/test/statefile-version2-invalid/Makefile (rev 0)
+++ trunk/base/tests/test/statefile-version2-invalid/Makefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,15 @@
+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-invalid.state
+ @PORTSRC=$(PORTSRC) $(bindir)/port destroot >output 2>&1 || (cat output; exit 1)
+ @diff -u master output || (echo "statefile version 2 without checksum field didn't cause a warning"; exit 1)
+ @PORTSRC=$(PORTSRC) $(bindir)/port clean >/dev/null 2>&1
+ @rm output
Property changes on: trunk/base/tests/test/statefile-version2-invalid/Makefile
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version2-invalid/Portfile
===================================================================
--- trunk/base/tests/test/statefile-version2-invalid/Portfile (rev 0)
+++ trunk/base/tests/test/statefile-version2-invalid/Portfile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,25 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+name statefile-version2-invalid
+version 1
+categories test
+maintainers cal
+description Test port for invalid statefiles, version 2
+homepage http://www.macports.org/
+platforms darwin
+
+long_description ${description}
+
+distfiles
+
+fetch {}
+extract {}
+configure {}
+build {}
+destroot {
+ system "touch ${destroot}${prefix}/lib/${name}"
+}
+
+test {}
Property changes on: trunk/base/tests/test/statefile-version2-invalid/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version2-invalid/master
===================================================================
--- trunk/base/tests/test/statefile-version2-invalid/master (rev 0)
+++ trunk/base/tests/test/statefile-version2-invalid/master 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,8 @@
+Warning: Statefile has version 2 but didn't contain a checksum
+Portfile changed since last build; discarding previous state.
+---> Fetching distfiles for statefile-version2-invalid
+---> Verifying checksum(s) for statefile-version2-invalid
+---> Extracting statefile-version2-invalid
+---> Configuring statefile-version2-invalid
+---> Building statefile-version2-invalid
+---> Staging statefile-version2-invalid into destroot
Added: trunk/base/tests/test/statefile-version2-invalid/statefile
===================================================================
--- trunk/base/tests/test/statefile-version2-invalid/statefile (rev 0)
+++ trunk/base/tests/test/statefile-version2-invalid/statefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,6 @@
+version: 2
+target: org.macports.fetch
+target: org.macports.checksum
+target: org.macports.extract
+target: org.macports.patch
+target: org.macports.configure
Added: trunk/base/tests/test/statefile-version2-outdated/Makefile
===================================================================
--- trunk/base/tests/test/statefile-version2-outdated/Makefile (rev 0)
+++ trunk/base/tests/test/statefile-version2-outdated/Makefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,15 @@
+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
Property changes on: trunk/base/tests/test/statefile-version2-outdated/Makefile
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version2-outdated/Portfile
===================================================================
--- trunk/base/tests/test/statefile-version2-outdated/Portfile (rev 0)
+++ trunk/base/tests/test/statefile-version2-outdated/Portfile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,25 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+name statefile-version2-outdated
+version 1
+categories test
+maintainers cal
+description Test port for outdated statefiles, version 2
+homepage http://www.macports.org/
+platforms darwin
+
+long_description ${description}
+
+distfiles
+
+fetch {}
+extract {}
+configure {}
+build {}
+destroot {
+ system "touch ${destroot}${prefix}/lib/${name}"
+}
+
+test {}
Property changes on: trunk/base/tests/test/statefile-version2-outdated/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/base/tests/test/statefile-version2-outdated/master
===================================================================
--- trunk/base/tests/test/statefile-version2-outdated/master (rev 0)
+++ trunk/base/tests/test/statefile-version2-outdated/master 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,7 @@
+Portfile changed since last build; discarding previous state.
+---> Fetching distfiles for statefile-version2-outdated
+---> Verifying checksum(s) for statefile-version2-outdated
+---> Extracting statefile-version2-outdated
+---> Configuring statefile-version2-outdated
+---> Building statefile-version2-outdated
+---> Staging statefile-version2-outdated into destroot
Added: trunk/base/tests/test/statefile-version2-outdated/statefile
===================================================================
--- trunk/base/tests/test/statefile-version2-outdated/statefile (rev 0)
+++ trunk/base/tests/test/statefile-version2-outdated/statefile 2012-08-08 21:17:12 UTC (rev 96400)
@@ -0,0 +1,7 @@
+version: 2
+checksum: 9aca70a1bf19759dc9121a091c3661f265a2c72402591ac26019baaba2ac30e0
+target: org.macports.fetch
+target: org.macports.checksum
+target: org.macports.extract
+target: org.macports.patch
+target: org.macports.configure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120808/3c5d7efc/attachment-0001.html>
More information about the macports-changes
mailing list