gecko/ipc/ipdl/test/cxx
2015-04-13 18:11:49 -07:00
..
app Bug 1077148 part 4 - Add and use new moz.build templates for Gecko programs and libraries. r=gps 2014-10-30 13:06:12 +09:00
genIPDLUnitTests.py Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
IPDLUnitTestProcessChild.cpp Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
IPDLUnitTestProcessChild.h Bug 1119878 Part 2: Change IPC code to hold ProcessID instead of ProcessHandle. r=billm, r=dvander, r=aklotz, r=cpearce 2015-04-01 09:40:35 +01:00
IPDLUnitTests.h Bug 1119878 Part 2: Change IPC code to hold ProcessID instead of ProcessHandle. r=billm, r=dvander, r=aklotz, r=cpearce 2015-04-01 09:40:35 +01:00
IPDLUnitTests.template.cpp Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
IPDLUnitTestSubprocess.cpp
IPDLUnitTestSubprocess.h
IPDLUnitTestTypes.h
IPDLUnitTestUtils.h
Makefile.in Backed out changeset e56bf4ea89fb (bug 1049879) for bustage in emulator debug builds on a CLOSED TREE 2014-10-08 08:03:57 +02:00
moz.build Bug 1110938 - Add timeout for CPOWs (default to 0) (r=dvander) 2014-12-18 17:35:44 -08:00
PTestActorPunning.ipdl
PTestActorPunningPunned.ipdl
PTestActorPunningSub.ipdl
PTestBadActor.ipdl
PTestBadActorSub.ipdl
PTestBridgeMain.ipdl Bug 1133748 - Fix ipdl code for bridged protocols that are also opened. r=billm. 2015-02-09 21:54:12 +01:00
PTestBridgeMainSub.ipdl
PTestBridgeSub.ipdl
PTestCrashCleanup.ipdl
PTestDataStructures.ipdl
PTestDataStructuresCommon.ipdlh
PTestDataStructuresSub.ipdl
PTestDesc.ipdl
PTestDescSub.ipdl
PTestDescSubsub.ipdl
PTestFailedCtor.ipdl
PTestFailedCtorSub.ipdl
PTestFailedCtorSubsub.ipdl
PTestHandle.ipdl
PTestHangs.ipdl
PTestHighestPrio.ipdl Backed out changeset e56bf4ea89fb (bug 1049879) for bustage in emulator debug builds on a CLOSED TREE 2014-10-08 08:03:57 +02:00
PTestIndirectProtocolParam.ipdlh
PTestIndirectProtocolParamFirst.ipdl
PTestIndirectProtocolParamManage.ipdl
PTestIndirectProtocolParamSecond.ipdl
PTestInterruptErrorCleanup.ipdl
PTestInterruptRaces.ipdl
PTestInterruptShutdownRace.ipdl
PTestJSON.ipdl
PTestLatency.ipdl
PTestManyChildAllocs.ipdl
PTestManyChildAllocsSub.ipdl
PTestMultiMgrs.ipdl
PTestMultiMgrsBottom.ipdl
PTestMultiMgrsLeft.ipdl
PTestMultiMgrsRight.ipdl
PTestNestedLoops.ipdl
PTestOpens.ipdl
PTestOpensOpened.ipdl
PTestRaceDeferral.ipdl
PTestRacyInterruptReplies.ipdl
PTestRacyReentry.ipdl
PTestRacyUndefer.ipdl
PTestRPC.ipdl Bug 1142109 - Fix IPDL tests (r=dvander) 2015-03-17 13:43:28 -07:00
PTestSanity.ipdl
PTestSelfManage.ipdl
PTestSelfManageRoot.ipdl
PTestShmem.ipdl
PTestShutdown.ipdl
PTestShutdownSub.ipdl
PTestShutdownSubsub.ipdl
PTestStackHooks.ipdl
PTestSyncError.ipdl
PTestSyncHang.ipdl
PTestSyncWakeup.ipdl
PTestSysVShmem.ipdl
PTestUrgency.ipdl Backed out changeset e56bf4ea89fb (bug 1049879) for bustage in emulator debug builds on a CLOSED TREE 2014-10-08 08:03:57 +02:00
PTestUrgentHangs.ipdl Bug 1128457 - Change handling of urgent messages during timeout (r=dvander) 2015-04-13 18:11:49 -07:00
README.txt
TestActorPunning.cpp
TestActorPunning.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestBadActor.cpp
TestBadActor.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestBridgeMain.cpp Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
TestBridgeMain.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestCrashCleanup.cpp
TestCrashCleanup.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestDataStructures.cpp Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
TestDataStructures.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestDesc.cpp
TestDesc.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestFailedCtor.cpp Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
TestFailedCtor.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestHangs.cpp Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
TestHangs.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestHighestPrio.cpp Backed out changeset e56bf4ea89fb (bug 1049879) for bustage in emulator debug builds on a CLOSED TREE 2014-10-08 08:03:57 +02:00
TestHighestPrio.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestInterruptErrorCleanup.cpp Bug 1124933 - Include crash reason when intentionally crashing content process (r=bent) 2015-02-03 09:09:27 -08:00
TestInterruptErrorCleanup.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestInterruptRaces.cpp
TestInterruptRaces.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestInterruptShutdownRace.cpp
TestInterruptShutdownRace.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestJSON.cpp
TestJSON.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestLatency.cpp
TestLatency.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestManyChildAllocs.cpp
TestManyChildAllocs.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestMultiMgrs.cpp
TestMultiMgrs.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestNestedLoops.cpp
TestNestedLoops.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestOpens.cpp Bug 1149971 Part 1: Follow-up to bug 1119878 to fix broken IPDL tests. r=dvander 2015-04-01 16:44:48 +01:00
TestOpens.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestRaceDeferral.cpp
TestRaceDeferral.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestRacyInterruptReplies.cpp
TestRacyInterruptReplies.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestRacyReentry.cpp
TestRacyReentry.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestRacyUndefer.cpp
TestRacyUndefer.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestRPC.cpp Bug 1142109 - Fix IPDL tests (r=dvander) 2015-03-17 13:43:28 -07:00
TestRPC.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestSanity.cpp
TestSanity.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestSelfManageRoot.cpp
TestSelfManageRoot.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestShmem.cpp Bug 1122956 - Convert IPDL tests to take move references (r=bent) 2015-01-20 15:42:54 -08:00
TestShmem.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestShutdown.cpp
TestShutdown.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestStackHooks.cpp
TestStackHooks.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestSyncError.cpp
TestSyncError.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestSyncHang.cpp
TestSyncHang.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestSyncWakeup.cpp
TestSyncWakeup.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestSysVShmem.cpp Bug 1122956 - Convert IPDL tests to take move references (r=bent) 2015-01-20 15:42:54 -08:00
TestSysVShmem.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestUrgency.cpp Backed out changeset e56bf4ea89fb (bug 1049879) for bustage in emulator debug builds on a CLOSED TREE 2014-10-08 08:03:57 +02:00
TestUrgency.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
TestUrgentHangs.cpp Bug 1128457 - Change handling of urgent messages during timeout (r=dvander) 2015-04-13 18:11:49 -07:00
TestUrgentHangs.h Bug 1128457 - Change handling of urgent messages during timeout (r=dvander) 2015-04-13 18:11:49 -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.