It is not a production grade product
- Put all files from this repo to directory with your mole shell file.
- Set execution bit of files
testwdates.sh
datesadday
testdate
. - Replace all
date
commands in your mole file to$BINSLOZKA/testdate
with the same parameters (This will allow us test datefiltering) or add branching:
if [ -z "${BINSLOZKA}" ]; then
echo $(date)
else
# for testing
echo $($BINSLOZKA/testdate)
fi
If this does not work for you should read section about testdate
.
PLEASE USE VERSION WITH SUPPORT FOR DATEFILTERING. It has more tests and is faster.
- Put test.sh file to directory with your mole shell file.
- Set execution bit of file test.sh.
- Run
./test.sh
It returns date for tests instead of "real" date. It uses file ./dateset/tmp
to store last issued date and returns last issued date + 1 second. It works together with datesadday, which adds last date + 1 day to ./dateset/tmp
.
So you dont have to replace all occurrence of date in your script with it, but only ones, that you are writing to MOLE_RC file.