forked from psidnell/ofexport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests
executable file
·138 lines (95 loc) · 4.51 KB
/
runtests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
####################
# Run all the tests.
#
# If run with an argument then that argument is expected
# to be a file format and the tool tests are run in
# that format alone
####################
# set -o xtrace
set -e
export PYTHONPATH=`pwd`
################
# Run unit tests
################
cd tests
rm *.pyc
for FILE in $( ls ); do
MODULE=`echo $FILE | sed -e 's/\.py$//'`
echo module: $MODULE
python -m unittest -f -v $MODULE
done
cd ..
#########################################################
# Run some tests against a test folder in my OmniFocus DB
#########################################################
rm *.pyc
TEST_FOLDER="^Test Folder$"
TEST_CONTEXT="^Test Context$"
function run_tool {
FMT=$1
set +e
mkdir -p tmp/$FMT
set -e
# PM Any
python ofexport.py -o tmp/$FMT/pm-i.$FMT -i "$TEST_FOLDER"
python ofexport.py -o tmp/$FMT/pm-e.$FMT -e "$TEST_FOLDER"
# PM Folder
python ofexport.py -o tmp/$FMT/pm-fi.$FMT --fi "$TEST_FOLDER"
python ofexport.py -o tmp/$FMT/pm-fe.$FMT --fe "$TEST_FOLDER"
# PM Project
python ofexport.py -o tmp/$FMT/pm-pi.$FMT --fi "$TEST_FOLDER" --pi '.*'
python ofexport.py -o tmp/$FMT/pm-pe.$FMT --fi "$TEST_FOLDER" --pe '.*'
python ofexport.py -o tmp/$FMT/pm-pci.$FMT --fi "$TEST_FOLDER" --pci none
python ofexport.py -o tmp/$FMT/pm-pce.$FMT --fi "$TEST_FOLDER" --pce none
python ofexport.py -o tmp/$FMT/pm-pdi.$FMT --fi "$TEST_FOLDER" --pdi none
python ofexport.py -o tmp/$FMT/pm-pde.$FMT --fi "$TEST_FOLDER" --pde none
python ofexport.py -o tmp/$FMT/pm-psi.$FMT --fi "$TEST_FOLDER" --psi none
python ofexport.py -o tmp/$FMT/pm-pse.$FMT --fi "$TEST_FOLDER" --pse none
python ofexport.py -o tmp/$FMT/pm-pfi.$FMT --fi "$TEST_FOLDER" --pfi none
python ofexport.py -o tmp/$FMT/pm-pfe.$FMT --fi "$TEST_FOLDER" --pfe none
# PM Task
python ofexport.py -o tmp/$FMT/pm-ti.$FMT --fi "$TEST_FOLDER" --ti '.*'
python ofexport.py -o tmp/$FMT/pm-te.$FMT --fi "$TEST_FOLDER" --te '.*'
python ofexport.py -o tmp/$FMT/pm-tci.$FMT --fi "$TEST_FOLDER" --tci none
python ofexport.py -o tmp/$FMT/pm-tce.$FMT --fi "$TEST_FOLDER" --tce none
python ofexport.py -o tmp/$FMT/pm-tdi.$FMT --fi "$TEST_FOLDER" --tdi none
python ofexport.py -o tmp/$FMT/pm-tde.$FMT --fi "$TEST_FOLDER" --tde none
python ofexport.py -o tmp/$FMT/pm-tsi.$FMT --fi "$TEST_FOLDER" --tsi none
python ofexport.py -o tmp/$FMT/pm-tse.$FMT --fi "$TEST_FOLDER" --tse none
python ofexport.py -o tmp/$FMT/pm-tfi.$FMT --fi "$TEST_FOLDER" --tfi none
python ofexport.py -o tmp/$FMT/pm-tfe.$FMT --fi "$TEST_FOLDER" --tfe none
# CM Context
python ofexport.py -C -o tmp/$FMT/cm-tfi.$FMT --ci "$TEST_CONTEXT"
python ofexport.py -C -o tmp/$FMT/cp-tfe.$FMT --ce "$TEST_CONTEXT"
# CM Project
python ofexport.py -C -o tmp/$FMT/cm-pi.$FMT --fi "$TEST_FOLDER" --pi '.*'
python ofexport.py -C -o tmp/$FMT/cm-pe.$FMT --fi "$TEST_FOLDER" --pe '.*'
python ofexport.py -C -o tmp/$FMT/cm-pci.$FMT --fi "$TEST_FOLDER" --pci none
python ofexport.py -C -o tmp/$FMT/cm-pce.$FMT --fi "$TEST_FOLDER" --pce none
python ofexport.py -C -o tmp/$FMT/cm-pdi.$FMT --fi "$TEST_FOLDER" --pdi none
python ofexport.py -C -o tmp/$FMT/cm-pde.$FMT --fi "$TEST_FOLDER" --pde none
python ofexport.py -C -o tmp/$FMT/cm-psi.$FMT --fi "$TEST_FOLDER" --psi none
python ofexport.py -C -o tmp/$FMT/cm-pse.$FMT --fi "$TEST_FOLDER" --pse none
python ofexport.py -C -o tmp/$FMT/cm-pfi.$FMT --fi "$TEST_FOLDER" --pfi none
python ofexport.py -C -o tmp/$FMT/cm-pfe.$FMT --fi "$TEST_FOLDER" --pfe none
# CM Task
python ofexport.py -C -o tmp/$FMT/cm-ti.$FMT --fi "$TEST_FOLDER" --ti '.*'
python ofexport.py -C -o tmp/$FMT/cm-te.$FMT --fi "$TEST_FOLDER" --te '.*'
python ofexport.py -C -o tmp/$FMT/cm-tci.$FMT --fi "$TEST_FOLDER" --tci none
python ofexport.py -C -o tmp/$FMT/cm-tce.$FMT --fi "$TEST_FOLDER" --tce none
python ofexport.py -C -o tmp/$FMT/cm-tdi.$FMT --fi "$TEST_FOLDER" --tdi none
python ofexport.py -C -o tmp/$FMT/cm-tde.$FMT --fi "$TEST_FOLDER" --tde none
python ofexport.py -C -o tmp/$FMT/cm-tsi.$FMT --fi "$TEST_FOLDER" --tsi none
python ofexport.py -C -o tmp/$FMT/cm-tse.$FMT --fi "$TEST_FOLDER" --tse none
python ofexport.py -C -o tmp/$FMT/cm-tfi.$FMT --fi "$TEST_FOLDER" --tfi none
python ofexport.py -C -o tmp/$FMT/cm-tfe.$FMT --fi "$TEST_FOLDER" --tfe none
}
FMT=$1
if [ -z "$FMT" ]; then
for FMT in tp md html opml ft; do
run_tool $FMT
done
else
run_tool $FMT
fi