[107494] branches/gsoc13-tests/tests/test/envvariables/test.tcl
marius at macports.org
marius at macports.org
Mon Jul 1 08:11:13 PDT 2013
Revision: 107494
https://trac.macports.org/changeset/107494
Author: marius at macports.org
Date: 2013-07-01 08:11:13 -0700 (Mon, 01 Jul 2013)
Log Message:
-----------
Added envvariables test.
Added Paths:
-----------
branches/gsoc13-tests/tests/test/envvariables/test.tcl
Added: branches/gsoc13-tests/tests/test/envvariables/test.tcl
===================================================================
--- branches/gsoc13-tests/tests/test/envvariables/test.tcl (rev 0)
+++ branches/gsoc13-tests/tests/test/envvariables/test.tcl 2013-07-01 15:11:13 UTC (rev 107494)
@@ -0,0 +1,47 @@
+package require tcltest 2
+namespace import tcltest::*
+
+source [file dirname $argv0]/../library.tcl
+
+set file "output"
+set dir "work"
+set path [file dirname [file normalize $argv0]]
+
+# Initial setup
+load_variables $path
+set_dir
+port_index
+port_clean $path
+
+proc envvar_test {} {
+ global file
+ global path
+
+ # Make helping script
+ set fp [open script.sh w+]
+ puts $fp "export ENVA=A; export ENVB=B; \
+ export PORTSRC=/Volumes/Other/gsoc/macports-all/branches/gsoc13-tests/tests/test-macports.conf; \
+ /opt/macports-test/bin/port test"
+ close $fp
+
+ exec sh script.sh > output
+ set line [get_line $path/$file "a"]
+ set line2 [get_line $path/$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
+
+cleanupTests
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130701/3994d9d2/attachment.html>
More information about the macports-changes
mailing list