Files
tubestation/ipc/ipdl/test/cxx
2011-10-17 10:59:28 -04:00
..
2011-07-13 22:43:43 -07:00
2011-07-13 22:43:43 -07:00
2010-01-12 00:14:31 -06:00
2011-03-25 12:56:17 -05:00
2010-05-22 14:35:40 -05:00
2010-03-11 01:35:28 -06:00
2010-05-22 14:35:40 -05:00
2010-03-18 17:52:34 -05:00
2011-05-04 15:55:54 -05:00
2010-03-11 01:35:21 -06:00
2010-11-05 02:17:07 -05:00
2011-07-13 22:43:43 -07:00
2010-01-20 21:50:07 -06:00
2010-11-05 02:17:07 -05:00
2009-10-06 13:05:47 -05:00
2010-01-12 00:14:31 -06:00
2010-01-12 00:14:31 -06:00
2011-03-25 12:56:17 -05:00
2011-03-25 12:56:17 -05:00
2010-05-22 14:35:40 -05:00
2010-03-18 17:52:34 -05:00
2011-01-12 01:07:17 -06:00
2011-01-12 01:07:17 -06:00
2010-09-01 13:01:50 -05:00
2011-05-04 15:55:54 -05:00
2011-05-04 15:55:54 -05:00
2010-03-11 01:35:32 -06:00
2010-03-11 01:35:21 -06:00
2010-11-05 02:17:07 -05:00
2010-11-05 02:17:07 -05:00
2011-07-13 22:43:43 -07:00
2011-07-13 22:43:43 -07:00
2010-01-20 21:50:07 -06:00
2010-11-05 02:17:07 -05:00
2010-11-05 02:17:07 -05:00

To add a new IPDL C++ unit test, you need to create (at least) the
following files (for a test "TestFoo"):

  - PTestFoo.ipdl, specifying the top-level protocol used for the test

  - TestFoo.h, declaring the top-level parent/child actors used for
    the test

  - TestFoo.cpp, defining the top-level actors

  - (make sure all are in the namespace mozilla::_ipdltest)

Next

  - add PTestFoo.ipdl to ipdl.mk

  - append TestFoo to the variable IPDLTESTS in Makefile.in

The IPDL test harness will try to execute |testFooParentActor->Main()|
to kick off your test.  Make sure you define |TestFooParent::Main()|.

If your test passes its criteria, please call
|MOZ_IPDL_TESTPASS("msg")| and "exit gracefully".

If your tests fails, please call |MOZ_IPDL_TESTFAIL("msg")| and "exit
ungracefully", preferably by abort()ing.


If all goes well, running

  make -C $OBJDIR/ipc/ipdl/test/cxx

will update the file IPDLUnitTests.cpp (the test launcher), and your
new code will be built automatically.


You can launch your new test by invoking

  make -C $OBJDIR/ipc/ipdl/test/cxx check

If you want to launch only your test, run

  cd $OBJDIR/dist/bin
  ./run-mozilla.sh ./ipdlunittest TestFoo


For a bare-bones example of adding a test, take a look at
PTestSanity.ipdl, TestSanity.h, TestSanity.cpp, and how "TestSanity"
is included in ipdl.mk and Makefile.in.