gecko/ipc/ipdl/test/cxx
2012-09-17 10:37:20 +02:00
..
app Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
genIPDLUnitTests.py Bug 767775 - Viciously and loudly kill any process sending messages that race with RPC __delete__ messages. Test by bsmedberg. r=cjones 2012-07-13 13:53:00 -04:00
ipdl.mk Bug 767775 - Viciously and loudly kill any process sending messages that race with RPC __delete__ messages. Test by bsmedberg. r=cjones 2012-07-13 13:53:00 -04:00
IPDLUnitTestProcessChild.cpp Bug 767775 - Viciously and loudly kill any process sending messages that race with RPC __delete__ messages. Test by bsmedberg. r=cjones 2012-07-13 13:53:00 -04:00
IPDLUnitTestProcessChild.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
IPDLUnitTests.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
IPDLUnitTests.template.cpp Bug 767775 - Viciously and loudly kill any process sending messages that race with RPC __delete__ messages. Test by bsmedberg. r=cjones 2012-07-13 13:53:00 -04:00
IPDLUnitTestSubprocess.cpp Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
IPDLUnitTestSubprocess.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
IPDLUnitTestTypes.h Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Makefile.in Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02: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
PTestBlockChild.ipdl
PTestBridgeMain.ipdl
PTestBridgeMainSub.ipdl
PTestBridgeSub.ipdl
PTestCrashCleanup.ipdl
PTestDataStructures.ipdl Bug 765734, part 0: Do the right thing here. r=bent 2012-07-12 05:51:57 -07:00
PTestDataStructuresCommon.ipdlh Bug 765734, part 0: Do the right thing here. r=bent 2012-07-12 05:51:57 -07:00
PTestDataStructuresSub.ipdl Tests for bug 521898. 2012-06-08 17:25:36 -07:00
PTestDesc.ipdl
PTestDescSub.ipdl
PTestDescSubsub.ipdl
PTestFailedCtor.ipdl
PTestFailedCtorSub.ipdl
PTestFailedCtorSubsub.ipdl
PTestHandle.ipdl
PTestHangs.ipdl
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 Test for bug 763228. 2012-06-11 20:41:46 -07:00
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
README.txt
TestBadActor.cpp Convert some of the IPDL C++ test files to use Unix line endings (no bug) 2012-07-23 16:31:14 -04:00
TestBadActor.h Convert some of the IPDL C++ test files to use Unix line endings (no bug) 2012-07-23 16:31:14 -04:00
TestBlockChild.cpp
TestBlockChild.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestBridgeMain.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
TestBridgeMain.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestCrashCleanup.cpp
TestCrashCleanup.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestDataStructures.cpp Bug 787933 - Stop using stdin types in IPC code; r=bsmedberg+cjones sr=cjones 2012-09-17 10:37:20 +02:00
TestDataStructures.h Bug 787933 - Stop using stdin types in IPC code; r=bsmedberg+cjones sr=cjones 2012-09-17 10:37:20 +02:00
TestDesc.cpp
TestDesc.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestFailedCtor.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
TestFailedCtor.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestHangs.cpp
TestHangs.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestJSON.cpp
TestJSON.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05: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
TestManyChildAllocs.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestMultiMgrs.cpp
TestMultiMgrs.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestNestedLoops.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
TestNestedLoops.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestOpens.cpp Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
TestOpens.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRaceDeferral.cpp
TestRaceDeferral.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRacyReentry.cpp
TestRacyReentry.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRacyRPCReplies.cpp
TestRacyRPCReplies.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRacyUndefer.cpp
TestRacyUndefer.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRPCErrorCleanup.cpp
TestRPCErrorCleanup.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRPCRaces.cpp
TestRPCRaces.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRPCShutdownRace.cpp
TestRPCShutdownRace.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
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 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestShmem.cpp
TestShmem.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestShutdown.cpp
TestShutdown.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestStackHooks.cpp
TestStackHooks.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSyncError.cpp
TestSyncError.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSyncHang.cpp
TestSyncHang.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSyncWakeup.cpp
TestSyncWakeup.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSysVShmem.cpp
TestSysVShmem.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -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

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.