Index: macports1.0/macports.tcl
===================================================================
--- macports1.0/macports.tcl	(revision 139788)
+++ macports1.0/macports.tcl	(working copy)
@@ -3437,7 +3437,7 @@
         patch       {return "depends_fetch depends_extract"}
         configure   -
         build       {return "depends_fetch depends_extract depends_build depends_lib"}
-        test        -
+        test        {return "depends_fetch depends_extract depends_build depends_lib depends_run depends_test"}
         destroot    {return "depends_fetch depends_extract depends_build depends_lib depends_run"}
         dmg         -
         pkg         -
Index: port/port.tcl
===================================================================
--- port/port.tcl	(revision 139788)
+++ port/port.tcl	(working copy)
@@ -101,6 +101,7 @@
 
 Pseudo-portnames starting with variants:, variant:, description:, depends:,
 depends_lib:, depends_run:, depends_build:, depends_fetch:, depends_extract:,
+depends_test:,
 portdir:, homepage:, epoch:, platforms:, platform:, name:, long_description:,
 maintainers:, maintainer:, categories:, category:, version:, revision:, and
 license: each select a set of ports based on a regex search of metadata
@@ -1073,7 +1074,7 @@
 
     # gather its deps
     set results {}
-    set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run}
+    set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run depends_test}
 
     set deplist {}
     foreach type $deptypes {
@@ -1367,6 +1368,7 @@
         ^depends_run:       -
         ^depends_extract:   -
         ^depends_fetch:     -
+        ^depends_test:      -
         ^replaced_by:       -
         ^revision:          -
         ^subport:           -
@@ -1395,6 +1397,7 @@
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_run"]
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_extract"]
             add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_fetch"]
+            add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_test"]
 
             set el 1
         }
@@ -2055,6 +2058,7 @@
             depends_build   1
             depends_lib     1
             depends_run     1
+            depends_test    1
             maintainers     1
             platforms       1
             variants        1
@@ -2072,6 +2076,7 @@
             depends_build "Build Dependencies"
             depends_run "Runtime Dependencies"
             depends_lib "Library Dependencies"
+            depends_test "Test Dependencies"
             description "Brief Description"
             long_description "Description"
             fullname    "Full Name: "
@@ -2095,6 +2100,7 @@
             depends_build 22
             depends_run 22
             depends_lib 22
+            depends_test 22
             description 22
             long_description 22
             homepage 22
@@ -2114,6 +2120,7 @@
             set options(ports_info_depends_build) yes
             set options(ports_info_depends_lib) yes
             set options(ports_info_depends_run) yes
+            set options(ports_info_depends_test) yes
         }
                 
         # Set up our field separators
@@ -2164,6 +2171,7 @@
                 ports_info_skip_line ports_info_depends_fetch
                 ports_info_depends_extract ports_info_depends_build
                 ports_info_depends_lib ports_info_depends_run
+                ports_info_depends_test
                 ports_info_conflicts
                 ports_info_platforms ports_info_license
                 ports_info_maintainers
@@ -2938,7 +2946,7 @@
         if {[info exists options(ports_${action}_no-build)] && [string is true -strict $options(ports_${action}_no-build)]} {
             set deptypes {depends_lib depends_run}
         } else {
-            set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run}
+            set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run depends_test}
         }
 
         array unset portinfo
@@ -3013,7 +3021,7 @@
         set deplist {}
         set deps_output {}
         set ndeps 0
-        array set labeldict {depends_fetch Fetch depends_extract Extract depends_build Build depends_lib Library depends_run Runtime}
+        array set labeldict {depends_fetch Fetch depends_extract Extract depends_build Build depends_lib Library depends_run Runtime depends_test Test}
         # get list of direct deps
         foreach type $deptypes {
             if {[info exists portinfo($type)]} {
@@ -3651,6 +3659,7 @@
         set options(ports_search_depends_build) yes
         set options(ports_search_depends_lib) yes
         set options(ports_search_depends_run) yes
+        set options(ports_search_depends_test) yes
     }
 
     # Array to hold given filters
@@ -4374,7 +4383,7 @@
 array set cmd_opts_array {
     edit        {{editor 1}}
     info        {category categories conflicts depends_fetch depends_extract
-                 depends_build depends_lib depends_run
+                 depends_build depends_lib depends_run depends_test
                  depends description epoch fullname heading homepage index license
                  line long_description
                  maintainer maintainers name patchfiles platform platforms portdir
@@ -4384,7 +4393,7 @@
     rdeps       {index no-build full}
     rdependents {full}
     search      {case-sensitive category categories depends_fetch
-                 depends_extract depends_build depends_lib depends_run
+                 depends_extract depends_build depends_lib depends_run depends_test
                  depends description epoch exact glob homepage line
                  long_description maintainer maintainers name platform
                  platforms portdir regex revision variant variants version}
Index: port/portindex.tcl
===================================================================
--- port/portindex.tcl	(revision 139788)
+++ port/portindex.tcl	(working copy)
@@ -271,7 +271,7 @@
 set fd [open $tempportindex w]
 set save_prefix ${macports::prefix}
 foreach key {categories depends_fetch depends_extract depends_build \
-             depends_lib depends_run description epoch homepage \
+             depends_lib depends_run depends_test description epoch homepage \
              long_description maintainers name platforms revision variants \
              version portdir replaced_by license installs_libs} {
     set keepkeys($key) 1
Index: port1.0/portdepends.tcl
===================================================================
--- port1.0/portdepends.tcl	(revision 139788)
+++ port1.0/portdepends.tcl	(working copy)
@@ -38,9 +38,9 @@
 }
 
 # define options
-options depends_fetch depends_extract depends_build depends_run depends_lib depends
+options depends_fetch depends_extract depends_build depends_run depends_lib depends_test depends
 # Export options via PortInfo
-options_export depends_fetch depends_extract depends_build depends_lib depends_run
+options_export depends_fetch depends_extract depends_build depends_lib depends_run depends_test
 
 option_proc depends_fetch portdepends::validate_depends_options
 option_proc depends_extract portdepends::validate_depends_options
@@ -47,6 +47,7 @@
 option_proc depends_build portdepends::validate_depends_options
 option_proc depends_run portdepends::validate_depends_options
 option_proc depends_lib portdepends::validate_depends_options
+option_proc depends_test portdepends::validate_depends_options
 
 # New option for the new dependency. We generate a warning because we don't handle this yet.
 option_proc depends portdepends::validate_depends_options_new
Index: port1.0/portlint.tcl
===================================================================
--- port1.0/portlint.tcl	(revision 139788)
+++ port1.0/portlint.tcl	(working copy)
@@ -339,8 +355,8 @@
     global os.platform os.arch os.version version revision epoch \
            description long_description platforms categories all_variants \
            maintainers license homepage master_sites checksums patchfiles \
-           depends_fetch depends_extract depends_lib depends_build \
-           depends_run distfiles fetch.type lint_portsystem lint_platforms \
+           depends_fetch depends_extract depends_lib depends_build depends_run \
+           depends_test distfiles fetch.type lint_portsystem lint_platforms \
            lint_required lint_optional replaced_by conflicts
     set portarch [get_canonical_archs]
 
@@ -507,6 +547,9 @@
     if {[info exists depends_run]} {
         lappend all_depends {*}$depends_run
     }
+    if {[info exists depends_test]} {
+        lappend all_depends {*}$depends_test
+    }
     foreach depspec $all_depends {
         set dep [lindex [split $depspec :] end]
         if {[catch {set res [mport_lookup $dep]} error]} {
@@ -523,7 +566,7 @@
     }
 
     # Check for multiple dependencies
-    foreach deptype {depends_extract depends_lib depends_build depends_run} {
+    foreach deptype {depends_extract depends_lib depends_build depends_run depends_test} {
         if {[info exists $deptype]} {
             array set depwarned {}
             foreach depspec [set $deptype] {
Index: port1.0/portutil.tcl
===================================================================
--- port1.0/portutil.tcl	(revision 139788)
+++ port1.0/portutil.tcl	(working copy)
@@ -1444,8 +1450,7 @@
                         patch       { set deptypes "depends_fetch depends_extract" }
                         configure   -
                         build       { set deptypes "depends_fetch depends_extract depends_lib depends_build" }
-
-                        test        -
+                        test        { set deptypes "depends_fetch depends_extract depends_lib depends_build depends_run depends_test" }
                         destroot    -
                         dmg         -
                         pkg         -
Index: registry2.0/portuninstall.tcl
===================================================================
--- registry2.0/portuninstall.tcl	(revision 139788)
+++ registry2.0/portuninstall.tcl	(working copy)
@@ -44,7 +44,7 @@
 # generate list of all dependencies of the port
 proc generate_deplist {port {optslist ""}} {
 
-    set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run}
+    set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run depends_test}
     set all_dependencies {}
     # look up deps from the saved portfile if possible
     if {![catch {set mport [mportopen_installed [$port name] [$port version] [$port revision] [$port variants] $optslist]}]} {
