Added the creation of a custom .lyx folder inside pwd/home/.lyx at

the beginning of the tests (which reconfigures LyX and takes some time),
followed by all of the tests using it. This way, we get only the default
configuration of LyX as a base, without being affected by individual users
custom configurations.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37408 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Tommaso Cucinotta 2011-02-01 22:08:07 +00:00
parent cfc81ea3d7
commit 705759d678
3 changed files with 29 additions and 4 deletions

View File

@ -0,0 +1,4 @@
Lang en_US.utf8
TestBegin test.lyx > lyx-log.txt 2>&1
KK: \[Left]\[Return]
TestEnd

View File

@ -234,6 +234,7 @@ outfilename = os.environ.get('KEYTEST_OUTFILE')
max_drop = os.environ.get('MAX_DROP') max_drop = os.environ.get('MAX_DROP')
lyx_window_name = os.environ.get('LYX_WINDOW_NAME') lyx_window_name = os.environ.get('LYX_WINDOW_NAME')
screenshot_out = os.environ.get('SCREENSHOT_OUT') screenshot_out = os.environ.get('SCREENSHOT_OUT')
lyx_userdir = os.environ.get('LYX_USERDIR')
max_loops = os.environ.get('MAX_LOOPS') max_loops = os.environ.get('MAX_LOOPS')
if max_loops is None: if max_loops is None:
@ -299,10 +300,13 @@ while not failed:
os.system("killall lyx") os.system("killall lyx")
time.sleep(0.2) time.sleep(0.2)
print "Starting LyX . . ." print "Starting LyX . . ."
os.system(lyx_exe + c[9:] + "&") if lyx_userdir is None:
os.system(lyx_exe + c[9:] + "&")
else:
os.system(lyx_exe + " -userdir " + lyx_userdir + " " + c[9:] + "&")
while True: while True:
lyx_pid=os.popen("pidof lyx").read().rstrip() lyx_pid=os.popen("pidof lyx").read().rstrip()
lyx_window_name=os.popen("wmctrl -l | grep 'lyx$\\|LyX:' | sed -e 's/.*\\([Ll]y[Xx].*\\)$/\\1/'").read().rstrip() lyx_window_name=os.popen("wmctrl -l -p | grep ' " + str(lyx_pid) + " ' | cut -d ' ' -f 1").read().rstrip()
if lyx_window_name != "": if lyx_window_name != "":
break break
print 'lyx_win: ' + lyx_window_name + '\n' print 'lyx_win: ' + lyx_window_name + '\n'

View File

@ -6,21 +6,38 @@
export LYX_EXE=../../../src/lyx export LYX_EXE=../../../src/lyx
export KEYTEST=../keytest.py export KEYTEST=../keytest.py
export LYX_USERDIR=$(pwd)/home/.lyx
if [ "$#" -eq 0 ]; then if [ "$#" -eq 0 ]; then
TESTS=$(ls *-in.txt); TESTS=$(ls *-in.txt | sed -e 's/hello-world-in.txt\|first-time-in.txt//');
else else
TESTS=$* TESTS=$*
fi fi
echo echo
if [ ! -d home ]; then
mkdir home
cd home
echo "Initializing testing environment . . ."
if ! ../single-test.sh "../first-time-in.txt" > keytest-log.txt 2>&1; then
echo "Some error occurred: check $(pwd)"
exit -1;
fi
cd ..
fi
echo "Running test cases . . ." echo "Running test cases . . ."
failed=0 failed=0
for t in $(echo "$TESTS" | sed -e 's/-in.txt//g'); do for t in $(echo "$TESTS" | sed -e 's/-in.txt//g'); do
printf "%40s: " $t
if [ ! -f "$t-in.txt" ]; then
echo "ERROR: File not found: $t-in.txt"
exit -1;
fi
rm -rf "out-$t" rm -rf "out-$t"
mkdir "out-$t" mkdir "out-$t"
cd "out-$t" cd "out-$t"
printf "%40s: " $t
if ../single-test.sh "../$t-in.txt" > keytest-log.txt 2>&1; then if ../single-test.sh "../$t-in.txt" > keytest-log.txt 2>&1; then
echo Ok echo Ok
cd .. cd ..