Merge lp://qastaging/~compiz-team/compiz/compiz.ccs_test_990690 into lp://qastaging/compiz/0.9.8

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 3266
Proposed branch: lp://qastaging/~compiz-team/compiz/compiz.ccs_test_990690
Merge into: lp://qastaging/compiz/0.9.8
Diff against target: 8584 lines (+4686/-1148)
25 files modified
compizconfig/cmake/exec_setup_py_with_destdir.cmake (+0/-2)
compizconfig/compizconfig-python/src/compizconfig.pyx (+123/-103)
compizconfig/gconf/src/gconf.c (+27/-27)
compizconfig/gsettings/src/gconf-integration.c (+9/-9)
compizconfig/gsettings/src/gsettings.c (+29/-27)
compizconfig/libcompizconfig/CMakeLists.txt (+1/-0)
compizconfig/libcompizconfig/backend/src/ini.c (+31/-31)
compizconfig/libcompizconfig/include/ccs.h (+466/-141)
compizconfig/libcompizconfig/src/CMakeLists.txt (+3/-0)
compizconfig/libcompizconfig/src/ccs-private.h (+68/-3)
compizconfig/libcompizconfig/src/compiz.cpp (+241/-164)
compizconfig/libcompizconfig/src/ini.c (+1/-1)
compizconfig/libcompizconfig/src/main.c (+1869/-614)
compizconfig/libcompizconfig/tests/CMakeLists.txt (+100/-0)
compizconfig/libcompizconfig/tests/context-mock.cpp (+76/-0)
compizconfig/libcompizconfig/tests/mock-context.h (+338/-0)
compizconfig/libcompizconfig/tests/mock-plugin.h (+166/-0)
compizconfig/libcompizconfig/tests/mock-setting.h (+353/-0)
compizconfig/libcompizconfig/tests/plugin-mock.cpp (+61/-0)
compizconfig/libcompizconfig/tests/setting-mock.cpp (+82/-0)
compizconfig/libcompizconfig/tests/test-ccs-object.cpp (+356/-0)
compizconfig/libcompizconfig/tests/test-context.cpp (+94/-0)
compizconfig/libcompizconfig/tests/test-plugin.cpp (+60/-0)
compizconfig/libcompizconfig/tests/test-setting.cpp (+109/-0)
plugins/ccp/src/ccp.cpp (+23/-26)
To merge this branch: bzr merge lp://qastaging/~compiz-team/compiz/compiz.ccs_test_990690
Reviewer Review Type Date Requested Status
Sam Spilsbury Needs Fixing
Daniel van Vugt Approve
Review via email: mp+112091@code.qastaging.launchpad.net

Description of the change

    Do the initial work to get libcompizconfig under test. (LP: #990690)

    libcompizconfig underwent some fairly large refactorings so that we could
    get it under test. This includes moving all of the public data in the public
    API structs into private structs and creating accessor functions for all of
    that data. The accessor functions are wrappers around interface structures which
    can be replaced at runtime for testing purposes.

    A C based object system was added to make this possible:

    This branch introduces some preliminary work in a series of branches to get libcompizconfig under test. In order to test the objects properly, we need to abstract away their interfaces$

    This would be awkward to do correctly if we didn't have a suitable object system to handle interface implementation, referencing, private storage etc.

    As such, a new struct CCSObject is introduced. It is similar in design to GObject, but with a much smaller feature set centered mostly around the handling of interfaces and composition$

    Tests are included.

    Basic mock classes for all of the public API were added for testing.

    The gconf backend and compizconfig-python were adapted as necessary.

    Merge in the following branches manually:

    lp:~smspillaz/compiz-compizconfig-python/compiz-compizconfig-python.context-apilp:compiz-compizconfig-python
    lp:~smspillaz/compiz-compizconfig-python/compiz-compizconfig-python.plugin-apilp:compiz-compizconfig-python
    lp:~smspillaz/compiz-compizconfig-python/compiz-compizconfig-python.setting-apilp:compiz-compizconfig-python
    lp:~smspillaz/compiz-compizconfig-gconf/compiz-compizconfig-gconf.adapt-to-new-interfaceslp:compiz-compizconfig-gconf
    lp:~smspillaz/compiz-libcompizconfig/refactor-settinglp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/setting-funcs-behind-interfacelp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/context-mocklp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/plugin-mocklp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/setting-mocklp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/refactor-contextlp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/ccs-objectlp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/refactor-pluginlp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/context-funcs-behind-interfacelp:compiz-libcompizconfig
    lp:~smspillaz/compiz-libcompizconfig/plugin-funcs-behind-interfacelp:compiz-libcompizconfig

All of the above branches have been reviewed by ~alan-griffiths, All of the libcompizconfig ones have been approved, asides from setting-mock and plugin-mock, and those two concerns have now been addressed.

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Changed status to Needs review. Since Sam asked me to review it now.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

CCSM segfaults on startup using this branch. object_interfaces is NULL at compizconfig/libcompizconfig/src/main.c:316

Using trunk, CCSM does not segfault on startup and is mostly usable. At least until you click on things and run into a crash caused by bug 1018730 (which has a fix).

Though, this might be my fault for using an old version of:
  /usr/lib/python2.7/dist-packages/compizconfig.so

(gdb) bt
#0 0x00007f09e45ab317 in ccsEmptyContextNew (screenNum=0,
    object_interfaces=0x0)
    at /home/dan/bzr/compiz/tmp.690/compizconfig/libcompizconfig/src/main.c:316
#1 0x00007f09e45abe6b in ccsContextNew (screenNum=<optimised out>,
    iface=<optimised out>)
    at /home/dan/bzr/compiz/tmp.690/compizconfig/libcompizconfig/src/main.c:521
#2 0x00007f09e47c7c2f in ?? ()
   from /usr/lib/python2.7/dist-packages/compizconfig.so
#3 0x00000000004c71c8 in ?? ()
#4 0x00000000004c7c76 in PyObject_Call ()
#5 0x000000000042aa4a in PyEval_EvalFrameEx ()
#6 0x00000000004317f2 in PyEval_EvalCodeEx ()
#7 0x000000000054b171 in PyRun_FileExFlags ()
#8 0x000000000054b7d8 in PyRun_SimpleFileExFlags ()
#9 0x000000000054c5d6 in Py_Main ()
#10 0x00007f09f001b76d in __libc_start_main (main=0x41b900 <main>, argc=2,
    ubp_av=0x7fff4b918878, init=<optimised out>, fini=<optimised out>,
    rtld_fini=<optimised out>, stack_end=0x7fff4b918868) at libc-start.c:226
#11 0x000000000041b931 in _start ()

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I will have to delve into re-compiling and testing compizconfig-python another day :(

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Right, there's a problem with the ccsm installation process. I'll propose the merge for that now, didn't get around to doing it yesterday.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Manual regression testing, including under valgrind, all seems OK.

However, I think it's a terrible idea to make an 8584 line proposal. There will almost certainly be regressions neither of us have found yet.

I also think it's a bad idea to rewrite a large chunk of (mature-ish) code from procedural to object-oriented, just to use Google Test/Mock. But I also won't block this proposal because I'm not about to invest the time to prototype a better alternative. And I don't have enough understanding of compizconfig to know where to begin.

review: Approve
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

FYI, the merges in smaller chunks that alan and I worked on can be found here:

http://code.launchpad.net/~smspillaz/libcompizconfig/+activereviews

I have noticed that there's some weird feedback with gconf just on the hsize setting that causes it to get reset, so I'm going to tentatively mark this needs fixing and have a look into it.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches