commit 11be833a2ef24e5c80f942aa6e22769f3fe9bfb1
Author: Georg Baum <b...@lyx.org>
Date:   Thu May 29 14:57:05 2014 +0200

    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.

diff --git a/Makefile.am b/Makefile.am
index 7388a4e..ec8bbaa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,6 +59,7 @@ keystest:
 alltests: check alltests-recursive
 
 alltests-recursive:
+       cd lib; $(MAKE) alltests-recursive
        cd src; $(MAKE) alltests-recursive
 
 updatetests:
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1aaec8b..18bf1c5 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2219,3 +2219,9 @@ install-data-hook:
        for i in $(DESTDIR)$(scriptsdir)/*.py 
$(DESTDIR)$(scriptsdir)/listerrors ; do \
                $(CHMOD) 755 $$i; \
        done
+
+alltests: check alltests-recursive
+
+alltests-recursive:
+       cd lyx2lyx; $(MAKE) alltests-recursive
+
diff --git a/lib/lyx2lyx/Makefile.am b/lib/lyx2lyx/Makefile.am
index 100c54c..b581136 100644
--- a/lib/lyx2lyx/Makefile.am
+++ b/lib/lyx2lyx/Makefile.am
@@ -38,3 +38,14 @@ dist_lyx2lyx_PYTHON = \
 
 install-data-hook:
        $(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
+
diff --git a/lib/lyx2lyx/test_parser_tools.py b/lib/lyx2lyx/test_parser_tools.py
index a8ef944..7e34947 100644
--- a/lib/lyx2lyx/test_parser_tools.py
+++ b/lib/lyx2lyx/test_parser_tools.py
@@ -78,8 +78,8 @@ class TestParserTools(unittest.TestCase):
     def test_find_token(self):
         self.assertEquals(find_token(lines, '\\emph', 0), 7)
         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, exact = False), 7)
+        self.assertEquals(find_token(lines, '\\emp', 0, 0, True), -1)
+        self.assertEquals(find_token(lines, '\\emp', 0, 0, False), 7)
         self.assertEquals(find_token(lines, 'emph', 0), -1)
 
 

Reply via email to