gecko-dev/ipc/ipdl/test/cxx
2016-10-04 20:34:54 -07:00
..
app Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
genIPDLUnitTests.py
IPDLUnitTestProcessChild.cpp
IPDLUnitTestProcessChild.h Bug 1178514 - Mark one-argument constructors in IPDL tests as 'explicit'. r=bent 2015-06-29 18:29:48 -04:00
IPDLUnitTests.h Bug 1266595: Followup to fix IPDL tests. r=billm 2016-05-03 22:36:50 -07:00
IPDLUnitTests.template.cpp Bug 1273312 - Add task.h to ipdl unit tests (r=khuey) 2016-05-27 09:57:36 -07:00
IPDLUnitTestSubprocess.cpp
IPDLUnitTestSubprocess.h
IPDLUnitTestTypes.h
IPDLUnitTestUtils.h Bug 1262671 - void** -> PickleIterator (r=froydnj) 2016-05-27 09:57:38 -07:00
Makefile.in Bug 1223240 - Make it easier to set up top-level protocols (r=jld) 2015-12-23 12:29:39 -08:00
moz.build Revert "Bug 1306708 - Add prio() for message priority to IPDL (r=dvander)" 2016-10-04 15:55:09 -07:00
PTestActorPunning.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestActorPunningPunned.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestActorPunningSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestBadActor.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestBadActorSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestBridgeMain.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestBridgeMainSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestBridgeSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestCancel.ipdl Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
PTestCrashCleanup.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestDataStructures.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestDataStructuresCommon.ipdlh
PTestDataStructuresSub.ipdl
PTestDemon.ipdl Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
PTestDesc.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestDescSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestDescSubsub.ipdl
PTestEndpointBridgeMain.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestEndpointBridgeMainSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestEndpointBridgeSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestEndpointOpens.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestEndpointOpensOpened.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestFailedCtor.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestFailedCtorSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestFailedCtorSubsub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestHandle.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestHangs.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestHighestPrio.ipdl Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
PTestIndirectProtocolParam.ipdlh
PTestIndirectProtocolParamFirst.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestIndirectProtocolParamManage.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestIndirectProtocolParamSecond.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestInterruptErrorCleanup.ipdl
PTestInterruptRaces.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestInterruptShutdownRace.ipdl
PTestJSON.ipdl
PTestLatency.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestManyChildAllocs.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestManyChildAllocsSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestMultiMgrs.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestMultiMgrsBottom.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestMultiMgrsLeft.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestMultiMgrsRight.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestNestedLoops.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestOpens.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestOpensOpened.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestRaceDeadlock.ipdl Bug 1170231: Part 2 - Regression test for IPC race mediation deadlock; r=dvander 2015-06-07 22:08:56 -06:00
PTestRaceDeferral.ipdl
PTestRacyInterruptReplies.ipdl
PTestRacyReentry.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestRacyUndefer.ipdl
PTestRPC.ipdl Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
PTestSanity.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestSelfManage.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestSelfManageRoot.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestShmem.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestShutdown.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestShutdownSub.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestShutdownSubsub.ipdl
PTestStackHooks.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestSyncError.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestSyncHang.ipdl Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
PTestSyncWakeup.ipdl
PTestUrgency.ipdl Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
PTestUrgentHangs.ipdl Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
README.txt
TestActorPunning.cpp Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
TestActorPunning.h
TestBadActor.cpp Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
TestBadActor.h
TestBridgeMain.cpp Clean up Transport memory management in IPDL. (bug 1283744, r=billm) 2016-07-06 18:51:20 -07:00
TestBridgeMain.h Bug 1178514 - Mark one-argument constructors in IPDL tests as 'explicit'. r=bent 2015-06-29 18:29:48 -04:00
TestCancel.cpp Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
TestCancel.h Bug 1177013 - CancelCurrentTransaction IPC support (r=dvander) 2015-07-06 19:58:44 -07:00
TestCrashCleanup.cpp Bug 1273312 - Add task.h to ipdl unit tests (r=khuey) 2016-05-27 09:57:36 -07:00
TestCrashCleanup.h
TestDataStructures.cpp Bug 1304876: Fix 64-bit build failure in IPC TestDataStructures test; r=billm 2016-09-19 13:15:39 -06:00
TestDataStructures.h Bug 1178514 - Mark one-argument constructors in IPDL tests as 'explicit'. r=bent 2015-06-29 18:29:48 -04:00
TestDemon.cpp Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
TestDemon.h Bug 1240985 - IPC fuzzer (r=gabor) 2016-03-04 14:51:08 -08:00
TestDesc.cpp
TestDesc.h
TestEndpointBridgeMain.cpp Bug 1303499 - Fix broken IPDL tests (r=me, NPOTB) 2016-09-16 20:35:11 -07:00
TestEndpointBridgeMain.h Bug 1223240 - Make it easier to set up top-level protocols (r=jld) 2015-12-23 12:29:39 -08:00
TestEndpointOpens.cpp Bug 1303499 - Fix broken IPDL tests (r=me, NPOTB) 2016-09-16 20:35:11 -07:00
TestEndpointOpens.h Bug 1223240 - Make it easier to set up top-level protocols (r=jld) 2015-12-23 12:29:39 -08:00
TestFailedCtor.cpp
TestFailedCtor.h
TestHangs.cpp Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
TestHangs.h
TestHighestPrio.cpp
TestHighestPrio.h
TestInterruptErrorCleanup.cpp Bug 1273312 - Add task.h to ipdl unit tests (r=khuey) 2016-05-27 09:57:36 -07:00
TestInterruptErrorCleanup.h
TestInterruptRaces.cpp Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
TestInterruptRaces.h Bug 1261094 - Improve how MessageChannel::mInterruptStack is used in IPC code, r=jld 2016-04-28 07:21:49 +08:00
TestInterruptShutdownRace.cpp Bug 1273312 - Add task.h to ipdl unit tests (r=khuey) 2016-05-27 09:57:36 -07:00
TestInterruptShutdownRace.h
TestJSON.cpp
TestJSON.h
TestLatency.cpp
TestLatency.h
TestManyChildAllocs.cpp Bug 1217250 - Fix some IPDL tests that were broken by bug 1212027; r=froydnj 2015-10-21 20:44:34 -04:00
TestManyChildAllocs.h
TestMultiMgrs.cpp Bug 1226200: Don't assume a TCPSocket has only one managee (and rename LoneManagedOrNull) r=jdm 2015-12-22 10:14:23 -05:00
TestMultiMgrs.h
TestNestedLoops.cpp Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
TestNestedLoops.h
TestOpens.cpp Clean up Transport memory management in IPDL. (bug 1283744, r=billm) 2016-07-06 18:51:20 -07:00
TestOpens.h Bug 1178514 - Mark one-argument constructors in IPDL tests as 'explicit'. r=bent 2015-06-29 18:29:48 -04:00
TestRaceDeadlock.cpp Bug 1266595: Followup to fix IPDL tests. r=billm 2016-05-03 22:36:50 -07:00
TestRaceDeadlock.h Bug 1261094 - Improve how MessageChannel::mInterruptStack is used in IPC code, r=jld 2016-04-28 07:21:49 +08:00
TestRaceDeferral.cpp Bug 1266595: Followup to fix IPDL tests. r=billm 2016-05-03 22:36:50 -07:00
TestRaceDeferral.h Bug 1261094 - Improve how MessageChannel::mInterruptStack is used in IPC code, r=jld 2016-04-28 07:21:49 +08:00
TestRacyInterruptReplies.cpp
TestRacyInterruptReplies.h
TestRacyReentry.cpp
TestRacyReentry.h
TestRacyUndefer.cpp
TestRacyUndefer.h
TestRPC.cpp Bug 1177013 - Fix IPDL tests for not allowing CPOWs during sync (r=dvander) 2015-07-06 19:58:45 -07:00
TestRPC.h Bug 1177013 - Fix IPDL tests for not allowing CPOWs during sync (r=dvander) 2015-07-06 19:58:45 -07:00
TestSanity.cpp
TestSanity.h
TestSelfManageRoot.cpp Bug 1212027 - part 7 - modify IPDL codegen to store sub-protocols in a hashtable rather than an array; r=jld,nical,cpearce,billm 2015-10-07 14:30:33 -04:00
TestSelfManageRoot.h
TestShmem.cpp
TestShmem.h
TestShutdown.cpp Bug 1212027 - part 7 - modify IPDL codegen to store sub-protocols in a hashtable rather than an array; r=jld,nical,cpearce,billm 2015-10-07 14:30:33 -04:00
TestShutdown.h Bug 1178514 - Mark one-argument constructors in IPDL tests as 'explicit'. r=bent 2015-06-29 18:29:48 -04:00
TestStackHooks.cpp Bug 1273312 - Add task.h to ipdl unit tests (r=khuey) 2016-05-27 09:57:36 -07:00
TestStackHooks.h
TestSyncError.cpp
TestSyncError.h
TestSyncHang.cpp Bug 1273312 - Add task.h to ipdl unit tests (r=khuey) 2016-05-27 09:57:36 -07:00
TestSyncHang.h
TestSyncWakeup.cpp
TestSyncWakeup.h
TestUrgency.cpp Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
TestUrgency.h
TestUrgentHangs.cpp Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
TestUrgentHangs.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

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.