Merge lp://staging/~chasedouglas/xorg-gtest/fixes into lp://staging/~oif-team/xorg-gtest/trunk
Proposed by
Chase Douglas
Status: | Merged |
---|---|
Merged at revision: | 3 |
Proposed branch: | lp://staging/~chasedouglas/xorg-gtest/fixes |
Merge into: | lp://staging/~oif-team/xorg-gtest/trunk |
Diff against target: |
595 lines (+377/-87) 8 files modified
Makefile.am (+10/-5) include/xorg/gtest/environment.h (+14/-5) include/xorg/gtest/process.h (+59/-0) include/xorg/gtest/test.h (+57/-0) src/environment.cpp (+53/-60) src/main.cpp (+37/-17) src/process.cpp (+98/-0) src/test.cpp (+49/-0) |
To merge this branch: | bzr merge lp://staging/~chasedouglas/xorg-gtest/fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thomas Voß (community) | Approve | ||
Stephen M. Webb (community) | Approve | ||
Review via email: mp+84896@code.staging.launchpad.net |
Description of the change
A ton of fixes and changes. Highlights:
* Based on Thomas' process class branch
* Fix Process::Start() (variadic args weren't handled properly)
* Use exceptions instead of return codes where it makes sense
* Add server executable path option
* Add basic xorg::testing::Test fixture for opening a connection to the server
I have reworked my utouch-frame v2-tests branch on top of this API, and things seem to work well.
To post a comment you must log in.
(1) "make install" doesn't install the headers.
(2) in xorg::testing: :Environment: :SetUp( ), the first parameter is a std::string, but std::string: :c_str( ) is passed.
(3) the error messages in xorg::testing: :Environment: :TearDown( ) are missing newlines.
(4) xorg::testing: :Process: :Start( ) does a lot of simulating the new operator by using malloc() followed by a 'throw bad_alloc' on failure: argv at least should be a std::vector<char*>, eliminating all mallocs and reallocs.
(5) can the pimpls be made std::unique_ptrs instead of using explicit deletes (this is not a big thing).
(6) either a constructor should be added to xorg::testing: :Environment: :Private or a uniform initializer should be used in the initialization list in the xorg::testing: :Environment constructor when initializing Private members (it's bad form to initialize someone else's members). Same goes for xorg::testing: :Process: :Private.
(7) Why use the C-compatibility headers (eg. string.h, stdlib.h, errno.h) instead of the C++ headers (<cstring>, <cstdlib>, <cerrno>) if this is C++ code? It's not broken, it's just a little inconsistent.
But when all is said and done, this works well.