gecko-dev/ipc/ipdl/test/cxx
Ricky Stewart 3749c34fb4 Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium
Differential Revision: https://phabricator.services.mozilla.com/D72478
2020-05-05 20:32:12 +00:00
..
app
IPDLUnitTestProcessChild.cpp Bug 1557739 - Be more consistent with IPC Transport APIs, r=jld 2020-02-06 22:41:56 +00:00
IPDLUnitTestProcessChild.h
IPDLUnitTestSubprocess.cpp
IPDLUnitTestSubprocess.h
IPDLUnitTestTypes.h
IPDLUnitTestUtils.h
IPDLUnitTests.h
IPDLUnitTests.template.cpp
Makefile.in Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium 2020-05-05 20:32:12 +00:00
PTestActorPunning.ipdl
PTestActorPunningPunned.ipdl
PTestActorPunningSub.ipdl
PTestAsyncReturns.ipdl
PTestBadActor.ipdl
PTestBadActorSub.ipdl
PTestCancel.ipdl
PTestCrashCleanup.ipdl
PTestDataStructures.ipdl
PTestDataStructuresCommon.ipdlh
PTestDataStructuresSub.ipdl
PTestDemon.ipdl
PTestDesc.ipdl
PTestDescSub.ipdl
PTestDescSubsub.ipdl
PTestEndpointBridgeMain.ipdl
PTestEndpointBridgeMainSub.ipdl
PTestEndpointBridgeSub.ipdl
PTestEndpointOpens.ipdl
PTestEndpointOpensOpened.ipdl
PTestFailedCtor.ipdl
PTestFailedCtorSub.ipdl
PTestFailedCtorSubsub.ipdl
PTestHandle.ipdl
PTestHangs.ipdl
PTestHighestPrio.ipdl
PTestIndirectProtocolParam.ipdlh
PTestIndirectProtocolParamFirst.ipdl
PTestIndirectProtocolParamManage.ipdl
PTestIndirectProtocolParamSecond.ipdl
PTestInterruptErrorCleanup.ipdl
PTestInterruptRaces.ipdl
PTestInterruptShutdownRace.ipdl
PTestJSON.ipdl
PTestLatency.ipdl
PTestLayoutThread.ipdl
PTestManyChildAllocs.ipdl
PTestManyChildAllocsSub.ipdl
PTestMultiMgrs.ipdl
PTestMultiMgrsBottom.ipdl
PTestMultiMgrsLeft.ipdl
PTestMultiMgrsRight.ipdl
PTestNestedLoops.ipdl
PTestPaintThread.ipdl
PTestPriority.ipdl Bug 1600605, add support for mediumhigh priority ipdl messages, r=jld 2019-12-13 22:38:15 +00:00
PTestRPC.ipdl
PTestRaceDeadlock.ipdl
PTestRaceDeferral.ipdl
PTestRacyInterruptReplies.ipdl
PTestRacyReentry.ipdl
PTestRacyUndefer.ipdl
PTestSanity.ipdl
PTestSelfManage.ipdl
PTestSelfManageRoot.ipdl
PTestShmem.ipdl
PTestShutdown.ipdl
PTestShutdownSub.ipdl
PTestShutdownSubsub.ipdl
PTestStackHooks.ipdl
PTestSyncError.ipdl
PTestSyncHang.ipdl
PTestSyncWakeup.ipdl
PTestUniquePtrIPC.ipdl
PTestUrgency.ipdl
PTestUrgentHangs.ipdl
README.txt
TestActorPunning.cpp
TestActorPunning.h
TestAsyncReturns.cpp
TestAsyncReturns.h
TestBadActor.cpp
TestBadActor.h
TestCancel.cpp
TestCancel.h
TestCrashCleanup.cpp
TestCrashCleanup.h
TestDataStructures.cpp
TestDataStructures.h
TestDemon.cpp
TestDemon.h
TestDesc.cpp
TestDesc.h
TestEndpointBridgeMain.cpp
TestEndpointBridgeMain.h
TestEndpointOpens.cpp
TestEndpointOpens.h
TestFailedCtor.cpp
TestFailedCtor.h
TestHangs.cpp
TestHangs.h
TestHighestPrio.cpp
TestHighestPrio.h
TestInterruptErrorCleanup.cpp
TestInterruptErrorCleanup.h
TestInterruptRaces.cpp
TestInterruptRaces.h
TestInterruptShutdownRace.cpp
TestInterruptShutdownRace.h
TestJSON.cpp
TestJSON.h
TestLatency.cpp
TestLatency.h
TestManyChildAllocs.cpp
TestManyChildAllocs.h
TestMultiMgrs.cpp
TestMultiMgrs.h
TestNestedLoops.cpp
TestNestedLoops.h
TestOffMainThreadPainting.cpp
TestOffMainThreadPainting.h
TestRPC.cpp
TestRPC.h
TestRaceDeadlock.cpp
TestRaceDeadlock.h
TestRaceDeferral.cpp
TestRaceDeferral.h
TestRacyInterruptReplies.cpp
TestRacyInterruptReplies.h
TestRacyReentry.cpp
TestRacyReentry.h
TestRacyUndefer.cpp
TestRacyUndefer.h
TestSanity.cpp
TestSanity.h
TestSelfManageRoot.cpp
TestSelfManageRoot.h Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj 2020-02-20 11:40:14 +00:00
TestShmem.cpp
TestShmem.h
TestShutdown.cpp
TestShutdown.h
TestStackHooks.cpp
TestStackHooks.h
TestSyncError.cpp
TestSyncError.h
TestSyncHang.cpp
TestSyncHang.h
TestSyncWakeup.cpp
TestSyncWakeup.h
TestUniquePtrIPC.cpp
TestUniquePtrIPC.h Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj 2020-02-20 11:40:14 +00:00
TestUrgency.cpp
TestUrgency.h
TestUrgentHangs.cpp
TestUrgentHangs.h
genIPDLUnitTests.py Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium 2020-05-05 20:32:12 +00:00
moz.build

README.txt

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.