diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-08-05 15:53:18 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-08-05 15:53:18 +0200 |
commit | 0f9b3bd9b10c8c0beb2688fc4bfd8de07ca2fc4f (patch) | |
tree | 2219416cae5c0004e2e569505333f06198c69670 /tests | |
parent | 8ca3ffd711e2d5a4c410d1dc318bfb86bedb6c93 (diff) | |
download | nq-0f9b3bd9b10c8c0beb2688fc4bfd8de07ca2fc4f.tar.gz nq-0f9b3bd9b10c8c0beb2688fc4bfd8de07ca2fc4f.tar.xz nq-0f9b3bd9b10c8c0beb2688fc4bfd8de07ca2fc4f.zip |
test fq
Diffstat (limited to 'tests')
-rwxr-xr-x | tests | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests b/tests index 61500fd..322f541 100755 --- a/tests +++ b/tests @@ -1,6 +1,7 @@ #!/bin/sh : ${NQ:=../nq} +: ${FQ:=../fq} set -e @@ -16,7 +17,7 @@ check() { true } -printf '1..26\n' +printf '1..36\n' rm -rf test.dir mkdir test.dir @@ -76,3 +77,21 @@ check 'all jobs are done' $NQ -w ) rm -rf test.dir +mkdir test.dir +( +cd test.dir + +check 'spawning four jobs' 'f1=$($NQ sleep 100)' +check 'spawning four jobs' 'f2=$($NQ echo two)' +check 'spawning four jobs' 'f3=$($NQ sleep 300)' +check 'spawning four jobs' 'f4=$($NQ sleep 400)' +check 'fq tracks first job' '($FQ & p=$!; sleep 1; kill $p) | sed 3q | grep -q sleep.*100' +check 'killing first job' kill ${f1##*.} +check 'killing fourth job' kill ${f4##*.} +sleep 1 +check 'fq tracks third job' '($FQ & p=$!; sleep 1; kill $p) | sed 3q | grep -q sleep.*300' +check 'killing third job' kill ${f3##*.} +check 'fq outputs last job when no job running' '$FQ | sed 3q | grep -q sleep.*400' +) + +rm -rf test.dir |