test/: Run calcurse in read-only mode

We don't change any configuration nor do we modify items here, so we can
safely invoke calcurse in read-only mode. Fixes a couple of permission
errors seen with `make distcheck`.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-02-22 12:43:44 +01:00
parent 3bc9497fc8
commit 80d882d03d
12 changed files with 15 additions and 14 deletions

View File

@ -6,7 +6,7 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
faketime '2011-02-25 23:42' "$CALCURSE" -D "$DATA_DIR" -a
faketime '2011-02-25 23:42' "$CALCURSE" --read-only -D "$DATA_DIR" -a
elif [ "$1" = 'expected' ]; then
cat <<EOD
02/25/11:

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ "$1" = 'actual' ]; then
"$CALCURSE" -D "$DATA_DIR"/ -d02/25/2011
"$CALCURSE" --read-only -D "$DATA_DIR"/ -d02/25/2011
elif [ "$1" = 'expected' ]; then
cat <<EOD
02/25/11:

View File

@ -6,7 +6,7 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
faketime '1912-06-23' "$CALCURSE" -D "$DATA_DIR"/ -d42
faketime '1912-06-23' "$CALCURSE" --read-only -D "$DATA_DIR"/ -d42
elif [ "$1" = 'expected' ]; then
cat <<EOD
06/24/12:

View File

@ -6,9 +6,9 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
faketime '1912-06-23' "$CALCURSE" -D "$DATA_DIR"/ -d42
faketime '1912-06-23' "$CALCURSE" --read-only -D "$DATA_DIR"/ -d42
elif [ "$1" = 'expected' ]; then
"$CALCURSE" -D "$DATA_DIR"/ -s06/23/1912 -r42
"$CALCURSE" --read-only -D "$DATA_DIR"/ -s06/23/1912 -r42
else
./run-test "$0"
fi

View File

@ -6,7 +6,7 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
faketime '1912-07-10 04:10' "$CALCURSE" -D "$DATA_DIR" -n
faketime '1912-07-10 04:10' "$CALCURSE" --read-only -D "$DATA_DIR" -n
elif [ "$1" = 'expected' ]; then
cat <<EOD
next appointment:

View File

@ -6,7 +6,7 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
faketime '2011-02-25 00:00:00' "$CALCURSE" -D "$DATA_DIR"/ -r
faketime '2011-02-25 00:00:00' "$CALCURSE" --read-only -D "$DATA_DIR"/ -r
elif [ "$1" = 'expected' ]; then
cat <<EOD
02/25/11:

View File

@ -6,7 +6,7 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
faketime '2000-01-01 00:00:00' "$CALCURSE" -D "$DATA_DIR"/ -r400
faketime '2000-01-01 00:00:00' "$CALCURSE" --read-only -D "$DATA_DIR"/ -r400
elif [ "$1" = 'expected' ]; then
cat <<EOD
04/07/00:

View File

@ -6,9 +6,9 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
faketime '2000-01-01 00:00:00' "$CALCURSE" -D "$DATA_DIR"/ -r400
faketime '2000-01-01 00:00:00' "$CALCURSE" --read-only -D "$DATA_DIR"/ -r400
elif [ "$1" = 'expected' ]; then
"$CALCURSE" -D "$DATA_DIR"/ -s01/01/2000 -r400
"$CALCURSE" --read-only -D "$DATA_DIR"/ -s01/01/2000 -r400
else
./run-test "$0"
fi

View File

@ -6,7 +6,8 @@ if [ ! -x "$(command -v faketime)" ]; then
fi
if [ "$1" = 'actual' ]; then
"$CALCURSE" -D "$DATA_DIR"/ -s01/01/1902 -r36500 -S '^[KMS]an.*or'
"$CALCURSE" --read-only -D "$DATA_DIR"/ -s01/01/1902 -r36500 \
-S '^[KMS]an.*or'
elif [ "$1" = 'expected' ]; then
cat <<EOD
12/06/42:

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ "$1" = 'actual' ]; then
"$CALCURSE" -D "$DATA_DIR"/ -t | sort
"$CALCURSE" --read-only -D "$DATA_DIR"/ -t | sort
elif [ "$1" = 'expected' ]; then
(
echo 'to do:'

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ "$1" = 'actual' ]; then
"$CALCURSE" -D "$DATA_DIR"/ -t3
"$CALCURSE" --read-only -D "$DATA_DIR"/ -t3
elif [ "$1" = 'expected' ]; then
echo 'to do:'
sed -n 's/^\[3\] \(.*\)/3. \1/p' "$DATA_DIR"/todo

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ "$1" = 'actual' ]; then
"$CALCURSE" -D "$DATA_DIR"/ -t0 | sort -n
"$CALCURSE" --read-only -D "$DATA_DIR"/ -t0 | sort -n
elif [ "$1" = 'expected' ]; then
(
echo 'completed tasks:'