Persist variables to file (~/.whenjobs/variables).
[whenjobs.git] / tests / jobs / t102_manyjobs.ml
1 (* whenjobs
2  * Copyright (C) 2012 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *)
18
19 when reloaded () :
20 <<
21   echo $JOBSERIAL $JOBNAME >\> $HOME/test_output
22   whenjobs --set --type int counter=0
23 >>
24
25 job "counter 1"
26 every second :
27 <<
28   echo $JOBSERIAL $JOBNAME >\> $HOME/test_output
29   whenjobs --set --type int counter=$(($counter+1))
30 >>
31
32 job "counter 2"
33 every second :
34 <<
35   echo $JOBSERIAL $JOBNAME >\> $HOME/test_output
36   whenjobs --set --type int counter=$(($counter+1))
37 >>
38
39 job "counter 3"
40 every second :
41 <<
42   echo $JOBSERIAL $JOBNAME >\> $HOME/test_output
43   whenjobs --set --type int counter=$(($counter+1))
44 >>
45
46 job "counter 4"
47 every second :
48 <<
49   echo $JOBSERIAL $JOBNAME >\> $HOME/test_output
50   whenjobs --set --type int counter=$(($counter+1))
51 >>
52
53 when increases counter :
54 <<
55   echo $JOBSERIAL $JOBNAME >\> $HOME/test_output
56 >>
57
58 when counter == 10 :
59 <<
60   echo $JOBSERIAL $JOBNAME >\> $HOME/test_output
61   whenjobs --daemon-stop
62 >>