@@ -804,10 +804,12 @@ end
804804
805805const _hidden_re = r" \.\w "
806806
807- # Traverses the directory tree starting at `project_root` and populates `dir_nodes ` with
807+ # Traverses the directory tree starting at `project_root` and grows `root_node ` with
808808# `DirNode`s and `FileNode`s for each directory and test file found. Filters out non-eligible
809809# paths.
810- function walkdir_task (walkdir_channel:: Channel{Tuple{String,FileNode}} , project_root:: String , root_node, dir_nodes, subproject_root:: Union{String,Nothing} , ti_filter, paths, projectfile, report, verbose_results)
810+ function walkdir_task (walkdir_channel:: Channel{Tuple{String,FileNode}} , project_root:: String , root_node, ti_filter, paths, projectfile, report, verbose_results)
811+ dir_nodes = Dict {String, DirNode} ()
812+ subproject_root = nothing # don't recurse into directories with their own Project.toml.
811813 try
812814 # Since test items don't store paths to their test setups, we need to traverse the
813815 # whole project, not just the requested paths.
@@ -877,16 +879,15 @@ function include_task(walkdir_channel, setup_channel, project_root, ti_filter)
877879 close (walkdir_channel, err)
878880 rethrow (err)
879881 end
882+ return nothing
880883end
881884
882885# Find test items using a pool of tasks to include files in parallel.
883886# Returns (testitems::TestItems, setups::Dict{Symbol,TestSetup})
884887# Assumes `isdir(project_root)`, which is guaranteed by `_runtests`.
885888function include_testfiles! (project_name, projectfile, paths, ti_filter:: TestItemFilter , verbose_results:: Bool , report:: Bool )
886889 project_root = dirname (projectfile)
887- subproject_root = nothing # don't recurse into directories with their own Project.toml.
888890 root_node = DirNode (project_name; report, verbose= verbose_results)
889- dir_nodes = Dict {String, DirNode} ()
890891 # setup_channel is populated in store_test_setup when we expand a @testsetup
891892 # we set it below in tls as __RE_TEST_SETUPS__ for each included file
892893 setup_channel = Channel {Pair{Symbol, TestSetup}} (Inf )
@@ -904,8 +905,7 @@ function include_testfiles!(project_name, projectfile, paths, ti_filter::TestIte
904905 walkdir_channel = Channel {Tuple{String, FileNode}} (1024 )
905906 @sync begin
906907 @spawn walkdir_task (
907- $ walkdir_channel, $ project_root, $ root_node, $ dir_nodes, $ subproject_root,
908- $ ti_filter, $ paths, $ projectfile, $ report, $ verbose_results
908+ $ walkdir_channel, $ project_root, $ root_node, $ ti_filter, $ paths, $ projectfile, $ report, $ verbose_results
909909 )
910910 for _ in 1 : clamp (2 * nthreads (), 1 , 16 )
911911 @spawn include_task ($ walkdir_channel, $ setup_channel, $ project_root, $ ti_filter)
0 commit comments