[107657] branches/gsoc13-tests/tests/test/envvariables

marius at macports.org marius at macports.org
Wed Jul 3 16:22:37 PDT 2013


Revision: 107657
          https://trac.macports.org/changeset/107657
Author:   marius at macports.org
Date:     2013-07-03 16:22:37 -0700 (Wed, 03 Jul 2013)
Log Message:
-----------
envvariables removed constraints, removed aux file, added description, cleanup.

Modified Paths:
--------------
    branches/gsoc13-tests/tests/test/envvariables/test.tcl

Added Paths:
-----------
    branches/gsoc13-tests/tests/test/envvariables/DESCRIPTION

Removed Paths:
-------------
    branches/gsoc13-tests/tests/test/envvariables/Makefile
    branches/gsoc13-tests/tests/test/envvariables/master

Added: branches/gsoc13-tests/tests/test/envvariables/DESCRIPTION
===================================================================
--- branches/gsoc13-tests/tests/test/envvariables/DESCRIPTION	                        (rev 0)
+++ branches/gsoc13-tests/tests/test/envvariables/DESCRIPTION	2013-07-03 23:22:37 UTC (rev 107657)
@@ -0,0 +1,3 @@
+This test ensures that variables set in the environment are available in the
+Portfile. The test runs an 'exec sh' command that exports two variables (ENVA
+and ENVB) and checks weather they get in the output file or not.

Deleted: branches/gsoc13-tests/tests/test/envvariables/Makefile
===================================================================
--- branches/gsoc13-tests/tests/test/envvariables/Makefile	2013-07-03 23:09:13 UTC (rev 107656)
+++ branches/gsoc13-tests/tests/test/envvariables/Makefile	2013-07-03 23:22:37 UTC (rev 107657)
@@ -1,18 +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 clean > /dev/null
-	@sh -c "export ENVA=A ; export ENVB=B; \
-		export PORTSRC=$(PORTSRC); $(bindir)/port test" > output 2>&1 || (cat output; exit 1)
-	@diff -u master output 2>&1 | tee difference
-	@if [ -s difference ]; then \
-		exit 1; \
-	else \
-		rm -f difference; \
-	fi

Deleted: branches/gsoc13-tests/tests/test/envvariables/master
===================================================================
--- branches/gsoc13-tests/tests/test/envvariables/master	2013-07-03 23:09:13 UTC (rev 107656)
+++ branches/gsoc13-tests/tests/test/envvariables/master	2013-07-03 23:22:37 UTC (rev 107657)
@@ -1,8 +0,0 @@
---->  Fetching distfiles for envvariables
---->  Verifying checksums for envvariables
---->  Extracting envvariables
---->  Configuring envvariables
---->  Building envvariables
---->  Testing envvariables
-A
-B

Modified: branches/gsoc13-tests/tests/test/envvariables/test.tcl
===================================================================
--- branches/gsoc13-tests/tests/test/envvariables/test.tcl	2013-07-03 23:09:13 UTC (rev 107656)
+++ branches/gsoc13-tests/tests/test/envvariables/test.tcl	2013-07-03 23:22:37 UTC (rev 107657)
@@ -3,10 +3,11 @@
 
 source [file dirname $argv0]/../library.tcl
 
-set file "output"
-set dir "work"
+makeFile "" $output_file
+makeDirectory $work_dir
 set path [file dirname [file normalize $argv0]]
 
+
 # Initial setup
 load_variables $path
 set_dir
@@ -14,39 +15,28 @@
 port_clean $path
 
 proc envvar_test {} {
-    global file
+    global output_file
     global path
     global portsrc
     global bindir
 
-    # Build helping script
-    set fp [open script.sh w+]
-    puts -nonewline $fp "export ENVA=A; export ENVB=B; export PORTSRC="
-    puts -nonewline $fp $portsrc
-    puts -nonewline $fp "; "
-    puts -nonewline $fp $bindir
-    puts -nonewline $fp "port test"
-    close $fp
+    # Build helping string
+    append string "export ENVA=A; export ENVB=B; "
+    append string "export PORTSRC=" $portsrc "; "
+    append string $bindir "port test"
 
-    exec sh script.sh > output
-    set line [get_line $path/$file "a"]
-    set line2 [get_line $path/$file "b"]
+    exec sh -c $string > output
+    set line [get_line $path/$output_file "a"]
+    set line2 [get_line $path/$output_file "b"]
     return $line$line2
 }
 
 test envvariables {
     Regression test for Environment Variables.
-} -constraints {
-    root
 } -body {
     envvar_test
 } -result "ab"
 
 
-# remove output file and print results
-removeFile script.sh
-removeFile $file
-removeDirectory $dir
-
 cleanup
 cleanupTests
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130703/92d32f84/attachment.html>


More information about the macports-changes mailing list