[107800] branches/gsoc13-tests/tests/test/statefile-unknown-version

marius at macports.org marius at macports.org
Fri Jul 5 16:27:29 PDT 2013


Revision: 107800
          https://trac.macports.org/changeset/107800
Author:   marius at macports.org
Date:     2013-07-05 16:27:29 -0700 (Fri, 05 Jul 2013)
Log Message:
-----------
Added statefile-unknown test.

Added Paths:
-----------
    branches/gsoc13-tests/tests/test/statefile-unknown-version/test.tcl

Removed Paths:
-------------
    branches/gsoc13-tests/tests/test/statefile-unknown-version/Makefile
    branches/gsoc13-tests/tests/test/statefile-unknown-version/master

Deleted: branches/gsoc13-tests/tests/test/statefile-unknown-version/Makefile
===================================================================
--- branches/gsoc13-tests/tests/test/statefile-unknown-version/Makefile	2013-07-05 22:17:37 UTC (rev 107799)
+++ branches/gsoc13-tests/tests/test/statefile-unknown-version/Makefile	2013-07-05 23:27:29 UTC (rev 107800)
@@ -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-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

Deleted: branches/gsoc13-tests/tests/test/statefile-unknown-version/master
===================================================================
--- branches/gsoc13-tests/tests/test/statefile-unknown-version/master	2013-07-05 22:17:37 UTC (rev 107799)
+++ branches/gsoc13-tests/tests/test/statefile-unknown-version/master	2013-07-05 23:27:29 UTC (rev 107800)
@@ -1,18 +0,0 @@
-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: branches/gsoc13-tests/tests/test/statefile-unknown-version/test.tcl
===================================================================
--- branches/gsoc13-tests/tests/test/statefile-unknown-version/test.tcl	                        (rev 0)
+++ branches/gsoc13-tests/tests/test/statefile-unknown-version/test.tcl	2013-07-05 23:27:29 UTC (rev 107800)
@@ -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-unknown-version.state
+port_desroot $path
+port_clean $path
+
+proc state_unknown {warn} {
+    global path
+    global output_file
+
+    if {[string compare $warn "no"]} {
+        set msg "warning*"
+    } else {
+        set msg "*staging*destroot*"
+    }
+
+    set line [get_line $path/$output_file $msg]
+    return $line
+}
+
+test warning_check {
+    Regression test for statefile-unknown warnings.
+} -body {
+    state_unknown yes
+} -result "warning: unsupported statefile version '3'"
+
+test output_check {
+    Regression test for statefile-unknown output.
+} -body {
+    state_unknown no
+} -result "--->  staging statefile-unknown-version into destroot"
+
+removeFile $work_dir
+
+cleanup
+cleanupTests
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130705/66ddc4de/attachment.html>


More information about the macports-changes mailing list