]> git.lyx.org Git - lyx.git/commitdiff
Execute lyx2lyx unit test when running tests
authorGeorg Baum <baum@lyx.org>
Thu, 29 May 2014 12:57:05 +0000 (14:57 +0200)
committerGeorg Baum <baum@lyx.org>
Thu, 29 May 2014 12:57:05 +0000 (14:57 +0200)
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.

Makefile.am
lib/Makefile.am
lib/lyx2lyx/Makefile.am
lib/lyx2lyx/test_parser_tools.py

index 7388a4ef50654bc2d3cbcfdf266813c811e7591a..ec8bbaaeb6fff5e1e30cdcdb476d31ba9ff217f8 100644 (file)
@@ -59,6 +59,7 @@ keystest:
 alltests: check alltests-recursive
 
 alltests-recursive:
+       cd lib; $(MAKE) alltests-recursive
        cd src; $(MAKE) alltests-recursive
 
 updatetests:
index 1aaec8b9d19780b9d4a4a346ad156adc7acb4918..18bf1c5c84c696f57eab876d5e80cd955f9be0df 100644 (file)
@@ -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
+
index 100c54ceb1431aa1add7ae9357fb17298134d119..b581136e5daa92bf8dda497f1f802a48c0581ac1 100644 (file)
@@ -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
+
index a8ef944df8a9dee222ec7f830da810cb84280c00..7e34947c70c9740253842359463bc9064e8e9109 100644 (file)
@@ -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)