gecko/ipc/ipdl/test/cxx
2011-05-10 20:24:49 +02:00
..
app Bug 655473 - Remove WinCE code from IPC; r=cjones 2011-05-10 20:24:49 +02:00
genIPDLUnitTests.py
ipdl.mk Test for bug 648935. 2011-05-04 15:55:54 -05:00
IPDLUnitTestProcessChild.cpp
IPDLUnitTestProcessChild.h
IPDLUnitTests.h
IPDLUnitTests.template.cpp
IPDLUnitTestSubprocess.cpp
IPDLUnitTestSubprocess.h
IPDLUnitTestTypes.h
Makefile.in Test for bug 648935. 2011-05-04 15:55:54 -05:00
PTestBlockChild.ipdl
PTestCrashCleanup.ipdl
PTestDataStructures.ipdl
PTestDataStructuresSub.ipdl
PTestDesc.ipdl
PTestDescSub.ipdl
PTestDescSubsub.ipdl
PTestFailedCtor.ipdl Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
PTestFailedCtorSub.ipdl Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
PTestFailedCtorSubsub.ipdl Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
PTestHandle.ipdl
PTestHangs.ipdl
PTestJSON.ipdl
PTestLatency.ipdl
PTestManyChildAllocs.ipdl
PTestManyChildAllocsSub.ipdl
PTestMultiMgrs.ipdl
PTestMultiMgrsBottom.ipdl
PTestMultiMgrsLeft.ipdl
PTestMultiMgrsRight.ipdl
PTestNestedLoops.ipdl
PTestRaceDeferral.ipdl Test for bug 572134. a=b 2011-01-12 01:07:17 -06:00
PTestRacyReentry.ipdl
PTestRacyRPCReplies.ipdl
PTestRacyUndefer.ipdl Test for bug 648935. 2011-05-04 15:55:54 -05:00
PTestRPCErrorCleanup.ipdl
PTestRPCRaces.ipdl
PTestRPCShutdownRace.ipdl
PTestSanity.ipdl
PTestSelfManage.ipdl
PTestSelfManageRoot.ipdl
PTestShmem.ipdl
PTestShutdown.ipdl
PTestShutdownSub.ipdl
PTestShutdownSubsub.ipdl
PTestStackHooks.ipdl
PTestSyncHang.ipdl
PTestSyncWakeup.ipdl
PTestSysVShmem.ipdl
README.txt
TestBlockChild.cpp
TestBlockChild.h
TestCrashCleanup.cpp
TestCrashCleanup.h
TestDataStructures.cpp
TestDataStructures.h
TestDesc.cpp
TestDesc.h
TestFailedCtor.cpp Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
TestFailedCtor.h Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
TestHangs.cpp
TestHangs.h
TestJSON.cpp
TestJSON.h
TestLatency.cpp
TestLatency.h
TestManyChildAllocs.cpp
TestManyChildAllocs.h
TestMultiMgrs.cpp
TestMultiMgrs.h
TestNestedLoops.cpp
TestNestedLoops.h
TestRaceDeferral.cpp Test for bug 572134. a=b 2011-01-12 01:07:17 -06:00
TestRaceDeferral.h Test for bug 572134. a=b 2011-01-12 01:07:17 -06:00
TestRacyReentry.cpp
TestRacyReentry.h
TestRacyRPCReplies.cpp
TestRacyRPCReplies.h
TestRacyUndefer.cpp Test for bug 648935. 2011-05-04 15:55:54 -05:00
TestRacyUndefer.h Test for bug 648935. 2011-05-04 15:55:54 -05:00
TestRPCErrorCleanup.cpp
TestRPCErrorCleanup.h
TestRPCRaces.cpp
TestRPCRaces.h
TestRPCShutdownRace.cpp
TestRPCShutdownRace.h
TestSanity.cpp
TestSanity.h
TestSelfManageRoot.cpp
TestSelfManageRoot.h
TestShmem.cpp
TestShmem.h
TestShutdown.cpp
TestShutdown.h
TestStackHooks.cpp
TestStackHooks.h
TestSyncHang.cpp
TestSyncHang.h
TestSyncWakeup.cpp
TestSyncWakeup.h
TestSysVShmem.cpp
TestSysVShmem.h

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.