gecko/ipc/ipdl/test/cxx
2013-09-05 09:01:46 +09:00
..
app Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
genIPDLUnitTests.py
IPDLUnitTestProcessChild.cpp
IPDLUnitTestProcessChild.h
IPDLUnitTests.h
IPDLUnitTests.template.cpp Bug 784739 - Switch from NULL to nullptr in ipc/. r=ehsan 2013-08-23 15:51:44 -04:00
IPDLUnitTestSubprocess.cpp
IPDLUnitTestSubprocess.h
IPDLUnitTestTypes.h
IPDLUnitTestUtils.h Test for bug 775777. r=bent 2012-09-20 12:30:53 -07:00
Makefile.in Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
moz.build Bug 875934 - Move LIBRARY_NAME to moz.build, batch 4; r=mshal 2013-08-15 09:12:40 -04:00
PTestActorPunning.ipdl Test for bug 775777. r=bent 2012-09-20 12:30:53 -07:00
PTestActorPunningPunned.ipdl Test for bug 775777. r=bent 2012-09-20 12:30:53 -07:00
PTestActorPunningSub.ipdl Test for bug 775777. r=bent 2012-09-20 12:30:53 -07:00
PTestBadActor.ipdl Convert some of the IPDL C++ test files to use Unix line endings (no bug) 2012-07-23 16:31:14 -04:00
PTestBadActorSub.ipdl Convert some of the IPDL C++ test files to use Unix line endings (no bug) 2012-07-23 16:31:14 -04:00
PTestBridgeMain.ipdl
PTestBridgeMainSub.ipdl
PTestBridgeSub.ipdl
PTestCrashCleanup.ipdl
PTestDataStructures.ipdl Don't deadlock on a child process for a CPOW (bug 905896, r=cjones). 2013-08-26 21:56:57 -07:00
PTestDataStructuresCommon.ipdlh
PTestDataStructuresSub.ipdl
PTestDesc.ipdl
PTestDescSub.ipdl
PTestDescSubsub.ipdl
PTestFailedCtor.ipdl
PTestFailedCtorSub.ipdl
PTestFailedCtorSubsub.ipdl
PTestHandle.ipdl
PTestHangs.ipdl
PTestIndirectProtocolParam.ipdlh Bug 783451 - Add ipdl testcases. r=bent DONTBUILD 2013-06-13 13:53:38 +08:00
PTestIndirectProtocolParamFirst.ipdl Bug 783451 - Add ipdl testcases. r=bent DONTBUILD 2013-06-13 13:53:38 +08:00
PTestIndirectProtocolParamManage.ipdl Bug 783451 - Add ipdl testcases. r=bent DONTBUILD 2013-06-13 13:53:38 +08:00
PTestIndirectProtocolParamSecond.ipdl Bug 783451 - Add ipdl testcases. r=bent DONTBUILD 2013-06-13 13:53:38 +08:00
PTestJSON.ipdl
PTestLatency.ipdl Bug 636063, part 3: Honor compression requests when queuing messages. r=bent 2012-08-25 01:25:08 -07:00
PTestManyChildAllocs.ipdl
PTestManyChildAllocsSub.ipdl
PTestMultiMgrs.ipdl
PTestMultiMgrsBottom.ipdl
PTestMultiMgrsLeft.ipdl
PTestMultiMgrsRight.ipdl
PTestNestedLoops.ipdl
PTestOpens.ipdl
PTestOpensOpened.ipdl
PTestRaceDeferral.ipdl
PTestRacyReentry.ipdl
PTestRacyRPCReplies.ipdl
PTestRacyUndefer.ipdl
PTestRPCErrorCleanup.ipdl
PTestRPCRaces.ipdl
PTestRPCShutdownRace.ipdl
PTestSanity.ipdl Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
PTestSelfManage.ipdl
PTestSelfManageRoot.ipdl
PTestShmem.ipdl
PTestShutdown.ipdl
PTestShutdownSub.ipdl
PTestShutdownSubsub.ipdl
PTestStackHooks.ipdl
PTestSyncError.ipdl
PTestSyncHang.ipdl
PTestSyncWakeup.ipdl
PTestSysVShmem.ipdl
PTestUrgency.ipdl Don't deadlock on a child process for a CPOW (bug 905896, r=cjones). 2013-08-26 21:56:57 -07:00
README.txt
TestActorPunning.cpp Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestActorPunning.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestBadActor.cpp Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestBadActor.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestBridgeMain.cpp Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestBridgeMain.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestCrashCleanup.cpp Bug 784739 - Switch from NULL to nullptr in ipc/. r=ehsan 2013-08-23 15:51:44 -04:00
TestCrashCleanup.h
TestDataStructures.cpp Bug 784739 - Switch from NULL to nullptr in ipc/. r=ehsan 2013-08-23 15:51:44 -04:00
TestDataStructures.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestDesc.cpp Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestDesc.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestFailedCtor.cpp Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestFailedCtor.h Bug 784739 - Switch from NULL to nullptr in ipc/. r=ehsan 2013-08-23 15:51:44 -04:00
TestHangs.cpp
TestHangs.h
TestJSON.cpp Bug 823422: Make ipdl C++ unit tests compile again. r=jlebar 2012-12-20 11:54:00 -08:00
TestJSON.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestLatency.cpp Bug 636063, part 3: Honor compression requests when queuing messages. r=bent 2012-08-25 01:25:08 -07:00
TestLatency.h Bug 636063, part 3: Honor compression requests when queuing messages. r=bent 2012-08-25 01:25:08 -07:00
TestManyChildAllocs.cpp Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestManyChildAllocs.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestMultiMgrs.cpp
TestMultiMgrs.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestNestedLoops.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
TestNestedLoops.h
TestOpens.cpp Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestOpens.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestRaceDeferral.cpp
TestRaceDeferral.h
TestRacyReentry.cpp
TestRacyReentry.h
TestRacyRPCReplies.cpp
TestRacyRPCReplies.h
TestRacyUndefer.cpp
TestRacyUndefer.h
TestRPCErrorCleanup.cpp Bug 784739 - Switch from NULL to nullptr in ipc/. r=ehsan 2013-08-23 15:51:44 -04:00
TestRPCErrorCleanup.h
TestRPCRaces.cpp
TestRPCRaces.h
TestRPCShutdownRace.cpp Bug 784739 - Switch from NULL to nullptr in ipc/. r=ehsan 2013-08-23 15:51:44 -04:00
TestRPCShutdownRace.h
TestSanity.cpp Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
TestSanity.h Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
TestSelfManageRoot.cpp
TestSelfManageRoot.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestShmem.cpp
TestShmem.h
TestShutdown.cpp
TestShutdown.h Bug 885804: IPDL unit test changes r=benjamin 2013-07-08 11:48:40 -04:00
TestStackHooks.cpp
TestStackHooks.h
TestSyncError.cpp
TestSyncError.h
TestSyncHang.cpp
TestSyncHang.h
TestSyncWakeup.cpp
TestSyncWakeup.h
TestSysVShmem.cpp
TestSysVShmem.h
TestUrgency.cpp Don't deadlock on a child process for a CPOW (bug 905896, r=cjones). 2013-08-26 21:56:57 -07:00
TestUrgency.h Don't deadlock on a child process for a CPOW (bug 905896, r=cjones). 2013-08-26 21:56:57 -07: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

You must define three methods in your |TestFooParent| class:

  - static methods |bool RunTestInProcesses()| and
    |bool RunTestInThreads()|.  These methods control whether
    to execute the test using actors in separate processes and
    threads respectively.  Generally, both should return true.

  - an instance method |void Main()|.  The test harness wil first
    initialize the processes or threads, create and open both actors,
    and then kick off the test using |Main()|.  Make sure you define
    it.

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 one of

  make -C $OBJDIR/ipc/ipdl/test/cxx check-proc     (test process-based tests)
  make -C $OBJDIR/ipc/ipdl/test/cxx check-threads  (test thread-based tests)
  make -C $OBJDIR/ipc/ipdl/test/cxx check          (tests both)

If you want to launch only your test, run

  cd $OBJDIR/dist/bin
  ./run-mozilla.sh ./ipdlunittest TestFoo          (test in two processes, if appl.)
  ./run-mozilla.sh ./ipdlunittest thread:TestFoo   (test in two threads, if appl.)


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.