Skip to content

Commit 64253fd

Browse files
committed
tests: Fixed some errors in the Makefile script
- The username in ps command is udner 7 characters. - Added GI_TYPELIB_PATH and LD_LIBRARY_PATH for anthy typelib and libs. - python has a buffer in stdout and stderr during koji build.
1 parent 119fdd4 commit 64253fd

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

tests/Makefile.am

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,41 @@ check:
2626
fi; \
2727
ANTHY_SCHEMA_FILE=org.freedesktop.ibus.engine.anthy.gschema.xml; \
2828
if test \! -f $(builddir)/../data/$$ANTHY_SCHEMA_FILE ; then \
29-
echo "Not found $(builddir)/../data/$$ANTHY_SCHEMA_FILE" \
29+
echo "Not found $(builddir)/../data/$$ANTHY_SCHEMA_FILE"; \
3030
exit -1; \
3131
fi; \
3232
SCHEMA_TMPDIR=`mktemp -d`; \
3333
if test $$? -ne 0 ; then \
34-
echo "FAILED mktemp" \
34+
echo "FAILED mktemp"; \
3535
exit -1; \
3636
fi; \
3737
cp $(builddir)/../data/$$ANTHY_SCHEMA_FILE $$SCHEMA_TMPDIR; \
3838
glib-compile-schemas $$SCHEMA_TMPDIR; \
3939
if test $$? -ne 0 ; then \
40-
echo "FAILED glib-compile-schemas $$SCHEMA_TMPDIR" \
40+
echo "FAILED glib-compile-schemas $$SCHEMA_TMPDIR"; \
4141
exit -1; \
4242
fi; \
4343
if test \! -f $$SCHEMA_TMPDIR/gschemas.compiled ; then \
44-
echo "Not found $$SCHEMA_TMPDIR/gschemas.compiled" \
44+
echo "Not found $$SCHEMA_TMPDIR/gschemas.compiled"; \
45+
exit -1; \
46+
fi; \
47+
ls $(builddir)/../gir/Anthy*.typelib > /dev/null; \
48+
if test $$? -ne 0 ; then \
49+
echo "Not found $(builddir)/../gir/Anthy*.typelib"; \
4550
exit -1; \
4651
fi; \
47-
export GSETTINGS_SCHEMA_DIR=$$SCHEMA_TMPDIR ; \
4852
ibus-daemon --daemonize --verbose; \
4953
sleep 1; \
50-
ps -ef | grep $$USER | grep ibus | grep -v grep; \
54+
SUSER=`echo "$$USER" | cut -c 1-7`; \
55+
ps -ef | grep "$$SUSER" | grep ibus | grep -v grep; \
56+
export GSETTINGS_SCHEMA_DIR=$$SCHEMA_TMPDIR; \
57+
export GI_TYPELIB_PATH=$(builddir)/../gir; \
58+
LD_LIBRARY_PATH=$(builddir)/../gir/.libs; \
59+
export LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}:$(builddir)/../gir; \
5160
echo "#### Starting Python3 API test $$ARGS"; \
5261
env IBUS_ANTHY_ENGINE_PATH=$(srcdir)/../engine/python3 \
5362
IBUS_ANTHY_SETUP_PATH=$(srcdir)/../setup/python3 \
54-
python3 $(srcdir)/anthytest.py $$ARGS; \
63+
python3 -u $(srcdir)/anthytest.py $$ARGS; \
5564
if test $$? -ne 0 ; then \
5665
exit -1; \
5766
fi; \
@@ -61,7 +70,7 @@ check:
6170
echo "#### Starting Python2 API test"; \
6271
env IBUS_ANTHY_ENGINE_PATH=$(srcdir)/../engine/python2 \
6372
IBUS_ANTHY_SETUP_PATH=$(srcdir)/../setup/python2 \
64-
python2 $(srcdir)/anthytest.py $$ARGS; \
73+
python2 -u $(srcdir)/anthytest.py $$ARGS; \
6574
rm -rf $$SCHEMA_TMPDIR; \
6675
ibus exit
6776

0 commit comments

Comments
 (0)