@ -6,6 +6,12 @@
, coreutils
, gnugrep
, ncurses
, findutils
, hostname
, parallel
, flock
, ps
, bats
, lsof
, doInstallCheck ? true
} :
@ -31,23 +37,79 @@ resholve.mkDerivation rec {
solutions = {
bats = {
scripts = [ " b i n / b a t s " ] ;
scripts = [
" b i n / b a t s "
" l i b e x e c / b a t s - c o r e / * "
" l i b / b a t s - c o r e / * "
] ;
interpreter = " ${ bash } / b i n / b a s h " ;
inputs = [ bash coreutils gnugrep ] ;
inputs = [
bash
coreutils
gnugrep
ncurses
findutils
hostname
parallel
flock
" l i b / b a t s - c o r e "
" l i b e x e c / b a t s - c o r e "
] ;
fake = {
external = [ " g r e a d l i n k " ] ;
external = [
" g r e a d l i n k "
" s h l o c k "
] ;
} ;
fix = {
" $ B A T S _ R O O T " = [ " ${ placeholder " o u t " } " ] ;
" $ B A T S _ L I B E X E C " = [ " ${ placeholder " o u t " } / l i b e x e c / b a t s - c o r e " ] ;
} ;
keep = {
" ${ placeholder " o u t " } / l i b e x e c / b a t s - c o r e / b a t s " = true ;
source = [
" ${ placeholder " o u t " } / l i b / b a t s - c o r e / v a l i d a t o r . b a s h "
" ${ placeholder " o u t " } / l i b / b a t s - c o r e / p r e p r o c e s s i n g . b a s h "
" $ B A T S _ T E S T _ S O U R C E "
" ${ placeholder " o u t " } / l i b / b a t s - c o r e / t r a c i n g . b a s h "
" ${ placeholder " o u t " } / l i b / b a t s - c o r e / t e s t _ f u n c t i o n s . b a s h "
" $ l i b r a r y _ l o a d _ p a t h "
" ${ placeholder " o u t " } / l i b / b a t s - c o r e / c o m m o n . b a s h "
" ${ placeholder " o u t " } / l i b / b a t s - c o r e / s e m a p h o r e . b a s h "
" ${ placeholder " o u t " } / l i b / b a t s - c o r e / f o r m a t t e r . b a s h "
] ;
" $ r e p o r t _ f o r m a t t e r " = true ;
" $ f o r m a t t e r " = true ;
" $ p r e _ c o m m a n d " = true ;
" $ B A T S _ T E S T _ N A M E " = true ;
" ${ placeholder " o u t " } / l i b e x e c / b a t s - c o r e / b a t s - e x e c - t e s t " = true ;
} ;
execer = [
/*
both blatant lies for expedience ; these can certainly exec args
they may be safe here , because they may always run things that
are ultimately in libexec ?
TODO : handle parallel and flock in binlore/resholve
* /
" c a n n o t : ${ parallel } / b i n / p a r a l l e l "
" c a n n o t : ${ flock } / b i n / f l o c k "
" c a n n o t : l i b e x e c / b a t s - c o r e / b a t s - p r e p r o c e s s "
# these do exec, but other internal files
" c a n n o t : l i b e x e c / b a t s - c o r e / b a t s - e x e c - f i l e "
" c a n n o t : l i b e x e c / b a t s - c o r e / b a t s - e x e c - s u i t e "
] ;
} ;
} ;
inherit doInstallCheck ;
installCheckInputs = [ ncurses ] ++ lib . optionals stdenv . isDarwin [ lsof ] ;
installCheckInputs = [
ncurses
parallel # skips some tests if it can't detect
flock # skips some tests if it can't detect
ps
] ++ lib . optionals stdenv . isDarwin [ lsof ] ;
installCheckPhase = ''
# TODO: cut if https://github.com/bats-core/bats-core/issues/418 allows
sed - i ' /test works even if PATH is reset/a skip' test/bats.bats