GNOME Bugzilla – Bug 745636
tests: multiple small fixes
Last modified: 2015-06-24 19:59:27 UTC
tests/scanner/annotationparser/test_[parser|patterns].py stopped working with Python3 somewhere down the line due to the iteritems() call... hit running the following while hacking on scanner/annotationparser.py: reset && git clean -e .cproject -e .project -e .pydevproject -e .settings -fdx && jhbuild buildone -n -f gobject-introspection && jhbuild run make distcheck && PYTHONPATH=. python3 tests/scanner/annotationparser/test_patterns.py && PYTHONPATH=. python3 tests/scanner/annotationparser/test_parser.py
Created attachment 298574 [details] [review] tests: Python 3 fixes tests/scanner/annotationparser/test_[parser|patterns].py stopped working with Python3 somewhere down the line due to the iteritems() call...
Created attachment 298576 [details] [review] tests: remove unused test files libfoo was moved into libregress in 9fc6eb16e954559d97cdd9a03437c8b1877c2a1d libtestinherit was moved into libregress in bb1ac9cf2dc450c5d44b1e39e3162ba06069f4a1
Created attachment 298578 [details] [review] tests: execute annotationparser tests just once 42bb69a6a2f12165a9758b192e80da089e00ab5c introduced a bug causing test_parser.py and test_patterns.py tests to be executed twice. This patch fixes this and still allows the tests to be executed: - using 'make check' - manually: PYTHONPATH=. python tests/scanner/annotationparser/test_parser.py PYTHONPATH=. python tests/scanner/annotationparser/test_patterns.py - individually: python -m unittest test_parser.TestGiTag_Stability.test_001 python -m unittest test_patterns.TestCommentAsterisk.test_000 test_parser.py now results in: Ran 360 tests in 0.172s instead of: Ran 720 tests in 0.339s test_patterns.py now results in: Ran 213 tests in 0.014s instead of Ran 426 tests in 0.041s
Created attachment 300622 [details] [review] tests: preprocess -expected.gir files
Created attachment 300623 [details] [review] tests: make sure g-ir-scanner can find cairo-1.0.gir
Created attachment 300624 [details] [review] tests: fix tests/repository/gitestthrows.c on win32
Created attachment 300630 [details] [review] tests: preprocess -expected.gir files
Review of attachment 298578 [details] [review]: ::: tests/scanner/annotationparser/test_parser.py @@ +446,3 @@ logger.enable_warnings((WARNING, ERROR, FATAL)) + _all_tests = create_test_cases() Do we need to call this again even though it is filled out above? @@ +449,1 @@ for name, test_case in _all_tests.items(): I wonder if we could get away with removing this loop and instead using the suite.addTests(tests) that was removed?
Created attachment 300860 [details] [review] tests: execute annotationparser tests just once (In reply to Simon Feltman from comment #8) > Review of attachment 298578 [details] [review] [review]: > > ::: tests/scanner/annotationparser/test_parser.py > @@ +446,3 @@ > logger.enable_warnings((WARNING, ERROR, FATAL)) > > + _all_tests = create_test_cases() > > Do we need to call this again even though it is filled out above? Had another look and it seems we can safely drop this call with all 3 methods of test invocation still working. > @@ +449,1 @@ > for name, test_case in _all_tests.items(): > > I wonder if we could get away with removing this loop and instead using the > suite.addTests(tests) that was removed? Further testing shows we can go even further and drop the load_tests hook function completely. The result of the first create_test_cases() call is installed into the globals() dict anyway. All 3 methods of test invocation continue to function correctly.
Comment on attachment 300624 [details] [review] tests: fix tests/repository/gitestthrows.c on win32 This patch will be picked up again in a new win32 specific bug
Comment on attachment 300630 [details] [review] tests: preprocess -expected.gir files This patch will be picked up again in a new win32 specific bug
The following fixes have been pushed: 5f72748 tests: make sure g-ir-scanner can find cairo-1.0.gir b491e9a tests: don't add $(top_srcdir)/gir to XDG_DATA_DIRS eddc702 tests: execute annotationparser tests just once d4bd173 tests: remove unused test files 4533c66 tests: Python 3 fixes
Created attachment 306040 [details] [review] tests: make sure g-ir-scanner can find cairo-1.0.gir "cairo-1.0.gir" is generated into "$(top_builddir)/gir" but g-ir-scanner is never instructed to look into that directory. This fails somewhat when there is no system installed copy of it when VPATH building "tests/scanner/Regress-1.0.gir": Couldn't find include cairo-1.0.gir (search path: "everything except the correct value")
Created attachment 306041 [details] [review] tests: don't add $(top_srcdir)/gir to XDG_DATA_DIRS Adding "$(top_srcdir)/gir" to XDG_DATA_DIRS is pointless as scanner/transformer.py actually goes looking for "$(top_srcdir)/gir/gir-1.0", which doesn't exist.
Created attachment 306042 [details] [review] tests: execute annotationparser tests just once 42bb69a6a2f12165a9758b192e80da089e00ab5c introduced a bug causing test_parser.py and test_patterns.py tests to be executed twice. This patch fixes this and still allows the tests to be executed: - using 'make check' - manually: PYTHONPATH=. python tests/scanner/annotationparser/test_parser.py PYTHONPATH=. python tests/scanner/annotationparser/test_patterns.py - individually: python -m unittest test_parser.TestGiTag_Stability.test_001 python -m unittest test_patterns.TestCommentAsterisk.test_000 test_parser.py now results in: Ran 360 tests in 0.172s instead of: Ran 720 tests in 0.339s test_patterns.py now results in: Ran 213 tests in 0.014s instead of Ran 426 tests in 0.041s
Created attachment 306043 [details] [review] tests: remove unused test files libfoo was moved into libregress in 9fc6eb16e954559d97cdd9a03437c8b1877c2a1d libtestinherit was moved into libregress in bb1ac9cf2dc450c5d44b1e39e3162ba06069f4a1
Created attachment 306044 [details] [review] tests: Python 3 fixes tests/scanner/annotationparser/test_[parser|patterns].py stopped working with Python3 somewhere down the line due to the iteritems() call...