![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
I just did an initial checkin to add CxxTest.
http://cxxtest.sourceforge.net
Once you do an update, just run "make check" from the top level and you should get src/libnr/testrunnr built and executed along with all the other tests.
Or to get just that one, change to inkscape/src and then run "make libnr/testrunnr" to build it.
It runs CxxTest to create the needed .cpp from *-test.h files, then builds it.
![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
Quoting MenTaLguY <mental@...3...>:
On Fri, 2005-02-18 at 03:36, jon@...18... wrote:
src/libnr/testrunnr
Eww. Any chance you can add an 'e' so it's spelt correctly?
That stands for
TestRunNr
:-P
I could case it if you want. :-)
Seriously, though, we should probably get a simple convention to use for those, since I imagine we might want an overall test program plus separate test programs.
![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
Quoting jon@...18...:
Quoting MenTaLguY <mental@...3...>:
On Fri, 2005-02-18 at 03:36, jon@...18... wrote:
src/libnr/testrunnr
Eww. Any chance you can add an 'e' so it's spelt correctly?
That stands for
TestRunNr
I could case it if you want. :-)
Punctuation seems like a better idea: test-run-nr
-mental
![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
Quoting jon@...18...:
I just did an initial checkin to add CxxTest.
Oh, and if anyone wants the X11 GUI to show up for the tests, you just need to go into src/libnr/Makefile_insert and add "--gui=X11Gui" to the cxxtestgen call, and then lines to the LDADD to include the X11 libs:
--- src/libnr/Makefile_insert 18 Feb 2005 08:27:33 -0000 1.14 +++ src/libnr/Makefile_insert 18 Feb 2005 16:08:29 -0000 @@ -109,7 +109,7 @@
libnr/testrunnr.cpp: $(libnr_testrunnr_includes) - cxxtestgen.pl --error-printer -o libnr/testrunnr.cpp $(libnr_testrunnr_includes) + cxxtestgen.pl --gui=X11Gui --error-printer -o libnr/testrunnr.cpp $(libnr_testrunnr_includes)
libnr_testrunnr_includes = \ $(srcdir)/libnr/nr-point-fns-test.h \ @@ -120,6 +120,8 @@
libnr_testrunnr_LDADD = \ libnr/libnr.a \ + -L/usr/X11R6/lib \ + -lX11 \ -lglib-2.0
![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
Quoting jon@...18...:
I just did an initial checkin to add CxxTest.
I've just updated src/libnr/nr-point-fns-test.h
I moved the variables out of the first test, and up to the suite and changed the suite to use dynamic creation via createSuite() and destroySuite(). This gets those variables setup at the point when the suite execution is started, and only once so that all the tests in the suite can use them. (They're member variables instead of static ones so that we don't hit problems with static initialization order)
However... I noticed that in the existing *-test.cpp file it checked two of those variables to be sure they were valid before running the test. It had used asserts, but I really don't want to quit the whole program...
So I then overrode the virtual setUp() method (often paired with tearDown() ). This gets called just before each test in the suite, and gets counted towards each test's pass/fail state. So it just checks if the 'valid' boolean set in the suite constructor is true.
participants (2)
-
unknown@example.com
-
MenTaLguY