Execute lyx2lyx unit test when running tests

Actually lyx2lyx has a tiny unit test. Add it to the autotools test machinery
and fix it: Since nobody knew about it the test was of course broken.
This commit is contained in:
Georg Baum 2014-05-29 14:57:05 +02:00
parent 55af9cb006
commit 11be833a2e
4 changed files with 20 additions and 2 deletions

View File

@ -59,6 +59,7 @@ keystest:
alltests: check alltests-recursive alltests: check alltests-recursive
alltests-recursive: alltests-recursive:
cd lib; $(MAKE) alltests-recursive
cd src; $(MAKE) alltests-recursive cd src; $(MAKE) alltests-recursive
updatetests: updatetests:

View File

@ -2219,3 +2219,9 @@ install-data-hook:
for i in $(DESTDIR)$(scriptsdir)/*.py $(DESTDIR)$(scriptsdir)/listerrors ; do \ for i in $(DESTDIR)$(scriptsdir)/*.py $(DESTDIR)$(scriptsdir)/listerrors ; do \
$(CHMOD) 755 $$i; \ $(CHMOD) 755 $$i; \
done done
alltests: check alltests-recursive
alltests-recursive:
cd lyx2lyx; $(MAKE) alltests-recursive

View File

@ -38,3 +38,14 @@ dist_lyx2lyx_PYTHON = \
install-data-hook: install-data-hook:
$(CHMOD) 755 $(DESTDIR)$(lyx2lyxdir)/lyx2lyx $(CHMOD) 755 $(DESTDIR)$(lyx2lyxdir)/lyx2lyx
alltests: check alltests-recursive
alltests-recursive:
@$(PYTHON) "$(srcdir)/test_parser_tools.py"; \
if test $$? -eq 0; then \
echo -e "=====================\nlyx2lyx tests passed.\n====================="; \
else \
echo -e "=====================\nlyx2lyx tests failed.\n====================="; \
fi

View File

@ -78,8 +78,8 @@ class TestParserTools(unittest.TestCase):
def test_find_token(self): def test_find_token(self):
self.assertEquals(find_token(lines, '\\emph', 0), 7) self.assertEquals(find_token(lines, '\\emph', 0), 7)
self.assertEquals(find_token(lines, '\\emph', 0, 5), -1) self.assertEquals(find_token(lines, '\\emph', 0, 5), -1)
self.assertEquals(find_token(lines, '\\emp', 0, exact = True), -1) self.assertEquals(find_token(lines, '\\emp', 0, 0, True), -1)
self.assertEquals(find_token(lines, '\\emp', 0, exact = False), 7) self.assertEquals(find_token(lines, '\\emp', 0, 0, False), 7)
self.assertEquals(find_token(lines, 'emph', 0), -1) self.assertEquals(find_token(lines, 'emph', 0), -1)