@ -321,12 +321,14 @@ proc runtests_write_child_payload {payloadfile test_tmlist test_auto_path ifneed
close $fd
}
proc runtests_run_child_process { exe bootstrap payloadfile testfile outfile errfile childtmpdir} {
proc runtests_run_child_process { exe exemodeargs bootstrap payloadfile testfile outfile errfile childtmpdir} {
# R u n o n e t e s t f i l e i n a c h i l d p r o c e s s , c a p t u r i n g s t d o u t / s t d e r r t o f i l e s . D e l i b e r a t e l y n o
# s h e l l r u n / s h e l l f i l t e r c a p t u r e o n t h e p a r e n t s i d e : f i l e c a p t u r e a v o i d s t h e p a r e n t - s t d i n / p i p e
# m a c h i n e r y , a n d - j o b s p a r a l l e l s c h e d u l i n g r e u s e s t h e s a m e m e c h a n i s m ( t h i s p r o c i s
# r e p l i c a t e d v e r b a t i m i n t o t p o o l w o r k e r t h r e a d s v i a i n f o a r g s / i n f o b o d y - k e e p i t f r e e o f
# p a c k a g e d e p e n d e n c i e s a n d n a m e s p a c e / g l o b a l s t a t e , a n d k e e p e v e r y a r g u m e n t r e q u i r e d ) .
# e x e m o d e a r g s : e x t r a a r g v b e t w e e n e x e a n d b o o t s t r a p ( { } n o r m a l l y ; { s r c } u n d e r a p u n k k i t
# s o t h e c h i l d b o o t s t h e p r o j e c t ' s s r c d e v m o d u l e s i n s t e a d o f k i t - s t a m p e d p a c k a g e s ) .
# c h i l d t m p d i r o v e r r i d e s t h e c h i l d ' s t c l t e s t - t m p d i r w h e n n o n e m p t y ( m a n d a t o r y p e r c h i l d
# u n d e r - j o b s s o c o n c u r r e n t m a k e F i l e / m a k e D i r e c t o r y h e l p e r s c a n n o t c o l l i d e ) ; " " k e e p s t h e
# s h a r e d - t m p d i r c a r r i e d i n t h e p a y l o a d o p t i o n s .
@ -360,7 +362,7 @@ proc runtests_run_child_process {exe bootstrap payloadfile testfile outfile errf
# e r r o r s i n e a r l y - j o b s r u n s , 2 0 2 6 - 0 7 - 1 9 ) . W i t h a u t o p u r g e o f f e a c h p i d i s p u r g e d
# e x p l i c i t l y a f t e r i t s s t a t u s i s r e a d .
tcl : : process autopurge false
if { [ catch { exec - - $exe $bootstrap $payloadfile $testfile $childtmpdir < $nulldev > $outfile 2 > $errfile & } spawnresult errdict] } {
if { [ catch { exec - - $exe { * } $exemodeargs $bootstrap $payloadfile $testfile $childtmpdir < $nulldev > $outfile 2 > $errfile & } spawnresult errdict] } {
# l a u n c h f a i l u r e - n o u s a b l e t e s t r u n
return [ dict create error $spawnresult errorCode [ dict get $errdict - errorcode] errorInfo [ dict get $errdict - errorinfo] ]
}
@ -392,7 +394,7 @@ proc runtests_run_child_process {exe bootstrap payloadfile testfile outfile errf
# b l o c k i n g f a l l b a c k f o r r u n t i m e s w i t h o u t t c l : : p r o c e s s ( t c l 8 . 6 ) : c o r r e c t s e q u e n t i a l l y ;
# c o n c u r r e n t u s e f r o m - j o b s w o r k e r s r e - c o n v o y s o n W i n d o w s ( d o c u m e n t e d i n
# s r c / t e s t s / A G E N T S . m d )
if { [ catch { exec - - $exe $bootstrap $payloadfile $testfile $childtmpdir < $nulldev > $outfile 2 > $errfile } emsg errdict] } {
if { [ catch { exec - - $exe { * } $exemodeargs $bootstrap $payloadfile $testfile $childtmpdir < $nulldev > $outfile 2 > $errfile } emsg errdict] } {
set ecode [ dict get $errdict - errorcode]
if { [ lindex $ecode 0 ] eq " C H I L D S T A T U S " } {
set exitcode [ lindex $ecode 2 ]
@ -887,8 +889,19 @@ if {!$report_json_only} {
# t c l t e s t o p t i o n s ) s o c h i l d r e n s e l e c t t h e s a m e u n b u i l t d e v m o d u l e s a s t h e s i n g l e p r o c t e s t i n t e r p .
set runtests_workdir " "
if { ! $singleproc } {
set child_exe_modeargs [ list ]
if { [ llength $kit_lib_bases ] } {
puts stderr " W A R N I N G : - s i n g l e p r o c 0 u n d e r a k i t e x e c u t a b l e : c h i l d p r o c e s s e s b o o t v i a t h e k i t ' s s c r i p t d i s p a t c h w i t h k i t - s t a m p e d p u n k p a c k a g e s a l r e a d y l o a d e d , w h i c h c a n s h a d o w t h e s r c d e v m o d u l e s u n d e r t e s t . P r e f e r a n a t i v e t c l s h f o r m u l t i - p r o c e s s r u n s . "
if { [ namespace exists : : punkboot] } {
# p u n k k i t ( p u n k _ m a i n . t c l b o o t ) : p l a i n s c r i p t d i s p a t c h b o o t s k i t - s t a m p e d p u n k
# p a c k a g e s i n t o t h e c h i l d ( e . g p u n k : : c o n s o l e 0 . 7 . 2 ) B E F O R E t h e p a y l o a d ' s s r c
# p a t h s a p p l y , s o s u i t e r e q u i r e s p i n n e d 9 9 9 9 9 9 . 0 a 1 . 0 - h i t v e r s i o n c o n f l i c t s .
# T h e k i t ' s ' s r c ' p a c k a g e _ m o d e b o o t s c h i l d r e n o n t h e p r o j e c t ' s s r c d e v m o d u l e s
# i n s t e a d - m a t c h i n g w h a t t h e p a y l o a d s e l e c t s ( G - 0 9 8 k i t - h o s t e d r u n s 2 0 2 6 - 0 7 - 2 0 ) .
set child_exe_modeargs [ list src]
puts stderr " N O T E : p u n k k i t e x e c u t a b l e - c h i l d t e s t p r o c e s s e s l a u n c h w i t h t h e k i t ' s ' s r c ' p a c k a g e _ m o d e s o s r c d e v m o d u l e s b o o t ( n o t k i t - s t a m p e d p a c k a g e s ) . "
} else {
puts stderr " W A R N I N G : - s i n g l e p r o c 0 u n d e r a n o n - p u n k k i t e x e c u t a b l e : c h i l d p r o c e s s e s b o o t w i t h t h e k i t ' s b u n d l e d p a c k a g e s w h i c h c a n s h a d o w t h e s r c d e v m o d u l e s u n d e r t e s t . P r e f e r a n a t i v e t c l s h f o r m u l t i - p r o c e s s r u n s . "
}
}
set child_bootstrap [ file join $test_base testsupport child_test_runner.tcl]
if { ! [ file exists $child_bootstrap ] } {
@ -1045,7 +1058,7 @@ if {$jobs_mode} {
set c_err [ file join $runtests_workdir child_stderr_$i.txt ]
set c_tmp [ file join $childtmp_base childtmp_$i ]
file mkdir $c_tmp
set jid [ tpool : : post $pool [ list runtests_run_child_process $thisexecutable $child_bootstrap $child_payloadfile $tfabs $c_out $c_err $c_tmp ] ]
set jid [ tpool : : post $pool [ list runtests_run_child_process $thisexecutable $child_exe_modeargs $child_ bootstrap $child_payloadfile $tfabs $c_out $c_err $c_tmp ] ]
dict set jobmap $jid $tf
}
set pending [ dict keys $jobmap ]
@ -1077,7 +1090,7 @@ if {$jobs_mode} {
set c_err [ file join $runtests_workdir child_stderr_$i.txt ]
set c_tmp [ file join $childtmp_base childtmp_$i ]
file mkdir $c_tmp
set jobresult [ runtests_run_child_process $thisexecutable $child_bootstrap $child_payloadfile $tfabs $c_out $c_err $c_tmp ]
set jobresult [ runtests_run_child_process $thisexecutable $child_exe_modeargs $child_ bootstrap $child_payloadfile $tfabs $c_out $c_err $c_tmp ]
if { $report_detailed_markdown } {
puts stdout " s e r i a l c o m p l e t e d : $ t f "
flush stdout
@ -1183,7 +1196,7 @@ foreach testfile_relative $testfiles {
# f i l e - c o l l e c t e d e v e n t h a p p e n e d a t c o l l e c t i o n t i m e
set result $runtests_job_results ( $testfile_relative )
} else {
set result [ runtests_run_child_process $thisexecutable $child_bootstrap $child_payloadfile $testfile $child_outfile $child_errfile " " ]
set result [ runtests_run_child_process $thisexecutable $child_exe_modeargs $child_ bootstrap $child_payloadfile $testfile $child_outfile $child_errfile " " ]
if { $runtests_udptee_target ne " " } {
# r e l a y t h e c h i l d ' s c a p t u r e d o u t p u t t o t h e w a t c h t a r g e t ( f i l e g r a n u l a r i t y -
# c h i l d r e n d o n o t s t r e a m l i v e ; s e e s r c / t e s t s / A G E N T S . m d )
@ -1196,7 +1209,7 @@ foreach testfile_relative $testfiles {
}
}
if { $report_detailed_markdown } {
puts stdout " e x e c u t e d $ t h i s e x e c u t a b l e t e s t s u p p o r t / c h i l d _ t e s t _ r u n n e r . t c l $ t e s t f i l e _ r e l a t i v e "
puts stdout " e x e c u t e d $ t h i s e x e c u t a b l e [ e x p r { [ l l e n g t h $ c h i l d _ e x e _ m o d e a r g s ] ? " $ c h i l d _ e x e _ m o d e a r g s " : " " } ] t e s t s u p p o r t / c h i l d _ t e s t _ r u n n e r . t c l $ t e s t f i l e _ r e l a t i v e "
}
flush stdout
}
@ -1508,7 +1521,13 @@ if {!$report_json_only} {
} else {
set tally_passed [ runtests_clr pass $tally_passed ]
}
puts stdout " T o t a l [ d i c t g e t $ t a l l y d i c t t o t a l ] $ t a l l y _ p a s s e d S k i p p e d [ d i c t g e t $ t a l l y d i c t s k i p p e d ] $ t a l l y _ f a i l e d "
set tally_line " T o t a l [ d i c t g e t $ t a l l y d i c t t o t a l ] $ t a l l y _ p a s s e d S k i p p e d [ d i c t g e t $ t a l l y d i c t s k i p p e d ] $ t a l l y _ f a i l e d "
if { [ llength [ dict get $tallydict files_with_fails] ] } {
# f i l e - l e v e l f a i l u r e s ( l o a d / s e t u p e r r o r s , c h i l d p r o c e s s f a i l u r e s ) a r e n o t t e s t
# r e s u l t s - s u r f a c e t h e m h e r e s o a r e d F A I L c a n ' t s i t b e s i d e ' F a i l e d 0 ' u n e x p l a i n e d
append tally_line " " [ runtests_clr fail " T e s t f i l e s - f a i l e d [ l l e n g t h [ d i c t g e t $ t a l l y d i c t f i l e s _ w i t h _ f a i l s ] ] " ]
}
puts stdout " $ t a l l y _ l i n e "
puts stdout " "
}