After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745636 - tests: multiple small fixes
tests: multiple small fixes
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-03-04 19:55 UTC by Dieter Verfaillie
Modified: 2015-06-24 19:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Python 3 fixes (1.71 KB, patch)
2015-03-04 19:57 UTC, Dieter Verfaillie
none Details | Review
tests: remove unused test files (60.66 KB, patch)
2015-03-04 20:17 UTC, Dieter Verfaillie
none Details | Review
tests: execute annotationparser tests just once (2.69 KB, patch)
2015-03-04 20:21 UTC, Dieter Verfaillie
none Details | Review
tests: preprocess -expected.gir files (579.69 KB, patch)
2015-03-30 20:19 UTC, Dieter Verfaillie
none Details | Review
tests: make sure g-ir-scanner can find cairo-1.0.gir (2.02 KB, patch)
2015-03-30 20:20 UTC, Dieter Verfaillie
none Details | Review
tests: fix tests/repository/gitestthrows.c on win32 (1.77 KB, patch)
2015-03-30 20:20 UTC, Dieter Verfaillie
none Details | Review
tests: preprocess -expected.gir files (580.57 KB, patch)
2015-03-30 21:35 UTC, Dieter Verfaillie
none Details | Review
tests: execute annotationparser tests just once (4.02 KB, patch)
2015-04-02 20:48 UTC, Dieter Verfaillie
none Details | Review
tests: make sure g-ir-scanner can find cairo-1.0.gir (6.15 KB, patch)
2015-06-24 19:59 UTC, Dieter Verfaillie
none Details | Review
tests: don't add $(top_srcdir)/gir to XDG_DATA_DIRS (1.16 KB, patch)
2015-06-24 19:59 UTC, Dieter Verfaillie
none Details | Review
tests: execute annotationparser tests just once (4.01 KB, patch)
2015-06-24 19:59 UTC, Dieter Verfaillie
none Details | Review
tests: remove unused test files (60.66 KB, patch)
2015-06-24 19:59 UTC, Dieter Verfaillie
none Details | Review
tests: Python 3 fixes (1.71 KB, patch)
2015-06-24 19:59 UTC, Dieter Verfaillie
none Details | Review

Description Dieter Verfaillie 2015-03-04 19:55:06 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
Comment 1 Dieter Verfaillie 2015-03-04 19:57:42 UTC
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...
Comment 2 Dieter Verfaillie 2015-03-04 20:17:22 UTC
Created attachment 298576 [details] [review]
tests: remove unused test files

libfoo was moved into libregress in 9fc6eb16e954559d97cdd9a03437c8b1877c2a1d
libtestinherit was moved into libregress in bb1ac9cf2dc450c5d44b1e39e3162ba06069f4a1
Comment 3 Dieter Verfaillie 2015-03-04 20:21:10 UTC
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
Comment 4 Dieter Verfaillie 2015-03-30 20:19:48 UTC
Created attachment 300622 [details] [review]
tests: preprocess -expected.gir files
Comment 5 Dieter Verfaillie 2015-03-30 20:20:22 UTC
Created attachment 300623 [details] [review]
tests: make sure g-ir-scanner can find cairo-1.0.gir
Comment 6 Dieter Verfaillie 2015-03-30 20:20:44 UTC
Created attachment 300624 [details] [review]
tests: fix tests/repository/gitestthrows.c on win32
Comment 7 Dieter Verfaillie 2015-03-30 21:35:34 UTC
Created attachment 300630 [details] [review]
tests: preprocess -expected.gir files
Comment 8 Simon Feltman 2015-04-02 15:54:10 UTC
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?
Comment 9 Dieter Verfaillie 2015-04-02 20:48:46 UTC
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 10 Dieter Verfaillie 2015-06-24 19:07:14 UTC
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 11 Dieter Verfaillie 2015-06-24 19:07:37 UTC
Comment on attachment 300630 [details] [review]
tests: preprocess -expected.gir files

This patch will be picked up again in a new win32 specific bug
Comment 12 Dieter Verfaillie 2015-06-24 19:59:02 UTC
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
Comment 13 Dieter Verfaillie 2015-06-24 19:59:07 UTC
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")
Comment 14 Dieter Verfaillie 2015-06-24 19:59:12 UTC
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.
Comment 15 Dieter Verfaillie 2015-06-24 19:59:17 UTC
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
Comment 16 Dieter Verfaillie 2015-06-24 19:59:22 UTC
Created attachment 306043 [details] [review]
tests: remove unused test files

libfoo was moved into libregress in 9fc6eb16e954559d97cdd9a03437c8b1877c2a1d
libtestinherit was moved into libregress in bb1ac9cf2dc450c5d44b1e39e3162ba06069f4a1
Comment 17 Dieter Verfaillie 2015-06-24 19:59:27 UTC
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...