GNOME Bugzilla – Bug 794349
GstSharp.Tests: Add unit test project
Last modified: 2018-03-21 12:53:06 UTC
Created attachment 369721 [details] [review] GstSharp.Tests: Add I propose this patch to get solution how to build on Windows or meson. I, actually, failed to find a proper way this project because of dependencies. To run this unit tests, the following steps are required. 1. update TargetFrameworkVersion to v4.6.1 (or, greater than 2.0) 2. correct the paths of gio-sharp.dll, and glib-sharp.dll
Created attachment 369722 [details] [review] GstSharp.Tests: Add
Created attachment 369736 [details] [review] tests: Use meson as a build system for the tests
OK, moved to meson but then I am getting the following errors: 1) GstSharp.Tests.PipelineTests.TestPipelineDispose : Expected: False But was: True at GstSharp.Tests.PipelineTests.TestPipelineDispose () [0x000f3] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:69 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 2) GstSharp.Tests.PipelineTests.TestPipelineDisposeManually : Multiple failures or warnings in test: 1) Expected: False But was: True 2) Expected: False But was: True at GstSharp.Tests.PipelineTests.TestPipelineDisposeManually () [0x00125] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:208 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 3) GstSharp.Tests.PipelineTests.TestPipelineParseAndDispose : Multiple failures or warnings in test: 1) Expected: False But was: True 2) Expected: False But was: True 3) Expected: False But was: True at GstSharp.Tests.PipelineTests.TestPipelineParseAndDispose () [0x000a0] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:106 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 4) GstSharp.Tests.PipelineTests.TestPipelineUriDecodeBinForcedlyDespose : Multiple failures or warnings in test: 1) Expected: False But was: True 2) Expected: False But was: True 3) Expected: False But was: True 4) Expected: False But was: True at GstSharp.Tests.PipelineTests.TestPipelineUriDecodeBinForcedlyDespose () [0x000f3] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:152 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 ------- OK: 2 FAIL: 1 SKIP: 0 TIMEOUT: 0 Is that normal?
> Is that normal? Sorry for submitting a mixed issue in this patch, but yes. I think the assertions in this patch is right, but it fails because some leakages were detected by weak references. I filed a leakage issue[0] but I seem not to get a right answer myself yet. I hope this patch is helpful to clarify leakage issue. [0] https://bugzilla.gnome.org/show_bug.cgi?id=794316
@Thibault, I think merging unit test is more important than fixing leakage issue currently. Can I make a squashed commit which has only passed tests?
(In reply to Justin J. Kim from comment #5) > @Thibault, I think merging unit test is more important than fixing leakage > issue currently. Can I make a squashed commit which has only passed tests? Ok
The existing test is failed by exception throwing so I can't make further progress on this work. Thibault, Could you check this log? Unhandled Exception: System.TypeInitializationException: The type initializer for 'Gst.App.AppSink' threw an exception. ---> System.EntryPointNotFoundException: gst_aggregator_get_type at (wrapper managed-to-native) Gst.Base.Aggregator:gst_aggregator_get_type () at Gst.Base.Aggregator.get_GType () [0x00000] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/Gst.Bas e/Aggregator.cs:1222 at GtkSharp.GstreamerSharp.ObjectManager.Initialize () [0x00115] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/GtkSharp/ObjectManager.cs:29 at Gst.App.AppSink..cctor () [0x00000] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/Gst.App/AppSink.cs:665 --- End of inner exception stack trace --- at AbiTester.___Gst.Main (System.String[] args) [0x030e3] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/gstreamer-sharp-abi.cs:341 Full Log: https://gist.github.com/justinjoy/1b34a5d6708b83d14c98afeda6c16277
You got to update GStreamer.
(In reply to Thibault Saunier from comment #8) > You got to update GStreamer. Hmm, sorry, but I am using the latest versions. Here are my testing commit hashes. gst-editing-services/ 4cff10fb (HEAD -> master, origin/master, origin/HEAD) doc: Remove documentation about GESVideoSource::zorder as it doesn't exist gst-libav/ 5328250 (HEAD -> master, tag: 1.13.91, origin/master, origin/HEAD) Release 1.13.91 gst-plugins-bad/ 1da3cd56a (HEAD -> master, origin/master, origin/HEAD) wasapi: try to satisfy both mingw and msvc gst-plugins-base/ 17d5f0831 (HEAD -> master, origin/master, origin/HEAD) oggstream: protect against out-of-bounds read gst-plugins-good/ 42f5f3d1b (HEAD -> master, origin/master, origin/HEAD) splitmuxsink: Allow splitting at exactly the time/bytes threshold gst-plugins-ugly/ f16550f6 (HEAD -> master, tag: 1.13.91, origin/master, origin/HEAD) Release 1.13.91 gstreamer/ bc431c2af (HEAD -> master, tag: 1.13.91, origin/master, origin/HEAD) Release 1.13.91 gstreamer-sharp/ 3c39246 (HEAD -> bgo/794349, master) tests: Use meson as a build system for the tests
maybe you have been in your uninstalled env for a long time and the $LD_LIBRARY_PATH hasen'nt been updated, in any case, this is related to you dev env as it is not able to find `gst_aggregator_get_type`: `System.TypeInitializationException: The type initializer for 'Gst.App.AppSink' threw an exception. ---> System.EntryPointNotFoundException: gst_aggregator_get_type` which should be in `libgstbase-1.0`
You could use `strace` to figure out what 'libgstbase-1.0.so` is being used.
Created attachment 369943 [details] [review] Add unit test Squashed and simplified.
(In reply to Thibault Saunier from comment #11) > You could use `strace` to figure out what 'libgstbase-1.0.so` is being used. thank you. mono seems not to recognise LD_LIBRARY_PATH variable so it tries to load 'libgstbase-1.0.so' from /usr/lib first even under gst-build environment.
Created attachment 369952 [details] [review] Add unit test mono seems to hold a reference in the same stack frame, and this aspect is very different from VS.Net's.
I pushed another version of it with a test for https://bugzilla.gnome.org/show_bug.cgi?id=794483