@@ -802,7 +802,8 @@ function _is_subproject(dir, current_projectfile)
802802 return true
803803end
804804
805- const _hidden_re = r" \.\w "
805+ # called on results of `readdir(root)`
806+ _is_hidden (name:: AbstractString ) = ncodeunits (name) > 1 && name[1 ] == ' .'
806807
807808# Traverses the directory tree starting at `project_root` and grows `root_node` with
808809# `DirNode`s and `FileNode`s for each directory and test file found. Filters out non-eligible
@@ -821,7 +822,7 @@ function walkdir_task(walkdir_channel::Channel{Tuple{String,FileNode}}, project_
821822 dir_nodes[rel_root] = dir_node
822823 push! (get (dir_nodes, dirname (rel_root), root_node), dir_node)
823824 for file in readdir (root)
824- startswith (file, _hidden_re ) && continue # skip hidden files/directories
825+ _is_hidden (file) && continue # skip hidden files/directories
825826 full_path = joinpath (root, file)
826827 if isdir (full_path)
827828 if subproject_root != = nothing && startswith (full_path, subproject_root)
@@ -907,7 +908,7 @@ function include_testfiles!(project_name, projectfile, paths, ti_filter::TestIte
907908 @spawn walkdir_task (
908909 $ walkdir_channel, $ project_root, $ root_node, $ ti_filter, $ paths, $ projectfile, $ report, $ verbose_results
909910 )
910- for _ in 1 : clamp (2 * nthreads (), 1 , 16 )
911+ for _ in 1 : clamp (2 * ( nthreads ()- ( nthreads () == 1 )) , 1 , 16 ) # 1 to 16 tasks, 1 if single-threaded
911912 @spawn include_task ($ walkdir_channel, $ setup_channel, $ project_root, $ ti_filter)
912913 end
913914 end
0 commit comments