]> git.lyx.org Git - features.git/blob - development/autotests/run-tests.sh
Added basic automated testing capability, based on the MonKey Test (keytest.py) by...
[features.git] / development / autotests / run-tests.sh
1 #!/bin/bash
2
3 # This script runs all the test scripts it finds in the current folder
4 # Tests are identified as having a file name of *-in.txt
5 # For failed tests, the collected output is kept in the corresponding folder
6
7 export LYX_EXE=../../../src/lyx
8 export KEYTEST=../keytest.py
9
10 if [ "$#" -eq 0 ]; then
11     TESTS=$(ls *-in.txt);
12 else
13     TESTS=$*
14 fi
15
16 echo
17 echo "Running test cases . . ."
18 failed=0
19 for t in $(echo "$TESTS" | sed -e 's/-in.txt//g'); do
20     rm -rf "out-$t"
21     mkdir "out-$t"
22     cd "out-$t"
23     printf "%40s: " $t
24     if ../single-test.sh "../$t-in.txt" > keytest-log.txt 2>&1; then
25         echo Ok
26         cd ..
27         rm -rf "out-$t";
28     else
29         echo FAILED
30         cd ..
31         failed=$[$failed+1];
32     fi;
33 done
34
35 echo
36 if [ $failed -eq 0 ]; then
37     echo "All tests SUCCESSFUL"
38 else
39     echo "There were $failed FAILED tests";
40 fi
41
42 echo