Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
6ebadf1d23 | |||
fec4fd0e22 |
@ -1,9 +1,11 @@
|
|||||||
#ifndef DEF_CONFIG_H
|
#ifndef DEF_CONFIG_H
|
||||||
#define DEF_CONFIG_H
|
#define DEF_CONFIG_H
|
||||||
|
|
||||||
#define VERSION "1.3.4"
|
#define VERSION "1.3.5"
|
||||||
|
|
||||||
#define MAX_TASK_ID 10000 // max is set to MAX_TASK_ID-1
|
#define MAX_TASK_ID 10000 // max is set to MAX_TASK_ID-1
|
||||||
#define NEW_TASK_ID_MAX_RETRIES 10000 // number of retries before giving up
|
#define NEW_TASK_ID_MAX_RETRIES 10000 // number of retries before giving up
|
||||||
|
|
||||||
|
#define TMPDIR "/tmp" // Some Unix systems don't use /tmp as tmp dir (eg Android)
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -19,9 +19,12 @@ char* get_socket_path() {
|
|||||||
|
|
||||||
return socket_path;
|
return socket_path;
|
||||||
} else {
|
} else {
|
||||||
char* base_path = "/tmp/takl";
|
char* base_path = TMPDIR "/takl";
|
||||||
|
|
||||||
char* username = getenv("USER");
|
char* username = getenv("USER");
|
||||||
|
if (!username)
|
||||||
|
username = getenv("USERNAME");
|
||||||
|
|
||||||
assert(username != NULL);
|
assert(username != NULL);
|
||||||
|
|
||||||
char* socket_path = malloc(sizeof(char)*(strlen(base_path)+strlen(username)+1));
|
char* socket_path = malloc(sizeof(char)*(strlen(base_path)+strlen(username)+1));
|
||||||
|
42
tests/main.sh
Executable file
42
tests/main.sh
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
TMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
|
#! On ne teste pas que l'on peut bien récupérer ces chemins automatiquement,
|
||||||
|
#! ce qui peut-être une source d'erreurs
|
||||||
|
export TAKL_DB="$TMPDIR/takl.sqlite3"
|
||||||
|
export TAKL_SOCKET="$TMPDIR/takl.socket"
|
||||||
|
echo "Using $TMPDIR"
|
||||||
|
|
||||||
|
make -j
|
||||||
|
|
||||||
|
# Catégories
|
||||||
|
./takl add "nocategory"
|
||||||
|
./takl add "category1:test1"
|
||||||
|
|
||||||
|
# Dates
|
||||||
|
./takl add "date:avec date" min+5
|
||||||
|
./takl add "date:avec date2" h+5
|
||||||
|
./takl add "date:avec date3" j+5
|
||||||
|
./takl add "date:avec date4" "31/12"
|
||||||
|
|
||||||
|
TASK_ID=$(./takl add "done soon" | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' | awk '-F[' '{ print $2 }' | awk '-F]' '{ print $1 }')
|
||||||
|
|
||||||
|
# List
|
||||||
|
./takl list
|
||||||
|
./takl list date
|
||||||
|
|
||||||
|
# Reschedule
|
||||||
|
./takl reschedule $TASK_ID "22/11"
|
||||||
|
|
||||||
|
# Get info
|
||||||
|
./takl info $TASK_ID
|
||||||
|
|
||||||
|
# Mark as done
|
||||||
|
./takl done $TASK_ID
|
||||||
|
./takl list -a
|
||||||
|
|
||||||
|
./takl rm $TASK_ID
|
||||||
|
|
||||||
|
#* À rajouter: tests sur le fait que les changements ont bien eu lieu
|
||||||
|
rm $TMPDIR -r
|
Loading…
Reference in New Issue
Block a user