gecko/ipc/ipdl/test/cxx
Joshua Cranmer 4ad48824ad Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan
--HG--
extra : rebase_source : 1843575683c3897f96f3966cbce26140ff1a7d90
2012-07-06 13:15:45 -05:00
..
app Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01: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 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
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 Bug 564086, part r: Test IPDL |bridge| 2011-06-03 13:33:56 -05:00
PTestBridgeMainSub.ipdl Bug 564086, part r: Test IPDL |bridge| 2011-06-03 13:33:56 -05:00
PTestBridgeSub.ipdl Bug 564086, part r: Test IPDL |bridge| 2011-06-03 13:33:56 -05:00
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 Bug 525181, part 3: Turn on "soft" state checking, NS_WARNING()ing on bad transitions. Fix tests. r=bent 2010-07-15 14:27:43 -05:00
PTestDescSub.ipdl Bug 522547: Serialize/deserialize IPC messages in a "streaming" style. r=bent 2010-05-22 14:35:34 -05:00
PTestDescSubsub.ipdl Bug 522547: Serialize/deserialize IPC messages in a "streaming" style. r=bent 2010-05-22 14:35:34 -05:00
PTestFailedCtor.ipdl Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
PTestFailedCtorSub.ipdl Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
PTestFailedCtorSubsub.ipdl Test for bug 640901. a=b 2011-03-25 12:56:17 -05:00
PTestHandle.ipdl Tests for bug 560000 2010-05-22 14:35:40 -05:00
PTestHangs.ipdl
PTestJSON.ipdl Tests for bug 560000 2010-05-22 14:35:40 -05:00
PTestLatency.ipdl Bug 581930: Add an async "spam test" and make output more readable. r=NPOTB (alas!) 2010-08-05 17:11:23 -05:00
PTestManyChildAllocs.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestManyChildAllocsSub.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestMultiMgrs.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestMultiMgrsBottom.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestMultiMgrsLeft.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestMultiMgrsRight.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestNestedLoops.ipdl
PTestOpens.ipdl Bug 598869: Test that using actors on non-main threads works 2011-06-03 13:33:56 -05:00
PTestOpensOpened.ipdl Test for bug 763228. 2012-06-11 20:41:46 -07:00
PTestRaceDeferral.ipdl Test for bug 572134. a=b 2011-01-12 01:07:17 -06:00
PTestRacyReentry.ipdl Test for bug 592002. a=test 2010-09-01 13:01:50 -05:00
PTestRacyRPCReplies.ipdl
PTestRacyUndefer.ipdl Test for bug 648935. 2011-05-04 15:55:54 -05:00
PTestRPCErrorCleanup.ipdl
PTestRPCRaces.ipdl Bug 525181, part 3: Turn on "soft" state checking, NS_WARNING()ing on bad transitions. Fix tests. r=bent 2010-07-15 14:27:43 -05:00
PTestRPCShutdownRace.ipdl
PTestSanity.ipdl
PTestSelfManage.ipdl Bug 525181, part 3: Turn on "soft" state checking, NS_WARNING()ing on bad transitions. Fix tests. r=bent 2010-07-15 14:27:43 -05:00
PTestSelfManageRoot.ipdl Bug 559898: Allow (sub-)protocols to manage themselves. r=bsmedberg 2010-04-26 20:11:48 -05:00
PTestShmem.ipdl Tests for bug 598866. 2010-11-05 02:17:07 -05:00
PTestShutdown.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestShutdownSub.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestShutdownSubsub.ipdl Bug 541131: Include IPDL headers as |include protocol PFoo;|. r=cjones 2010-04-26 20:11:46 -05:00
PTestStackHooks.ipdl
PTestSyncError.ipdl Test for bug 671189. 2011-07-13 22:43:43 -07:00
PTestSyncHang.ipdl Bug 535077 - Fixes hang caused by failure to execute sync launch r=cjones a=blocking2.0 2010-08-10 14:14:10 -07:00
PTestSyncWakeup.ipdl
PTestSysVShmem.ipdl Tests for bug 598866. 2010-11-05 02:17:07 -05:00
README.txt Bug 699319 - Part 3: Update test infrastructure to run tests in either threaded or process mode. r=cjones 2011-11-30 08:27:22 -08:00
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 Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05: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 564086, part r: Test IPDL |bridge| 2011-06-03 13:33:56 -05: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 765734, part 0: Do the right thing here. r=bent 2012-07-12 05:51:57 -07:00
TestDataStructures.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestDesc.cpp Bug 522547: Serialize/deserialize IPC messages in a "streaming" style. r=bent 2010-05-22 14:35:34 -05:00
TestDesc.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestFailedCtor.cpp Bug 699319 - Part 3: Update test infrastructure to run tests in either threaded or process mode. r=cjones 2011-11-30 08:27:22 -08:00
TestFailedCtor.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestHangs.cpp Bug 679240 - Split total channel timeout into two discrete wait periods. Avoids aborting children after system sleep. r=bsmedberg 2012-01-06 12:17:03 -06:00
TestHangs.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestJSON.cpp Bug 562424: Switch IPDL interfaces to infallible TArray. r=bent a=blocking 2010-11-08 20:49:00 -06:00
TestJSON.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestLatency.cpp Bug 581930: Add an async "spam test" and make output more readable. r=NPOTB (alas!) 2010-08-05 17:11:23 -05:00
TestLatency.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestManyChildAllocs.cpp Bug 559953: Add a |const nsTArray<Subactor*>& ManagedFoo();| accessor. r=bent 2010-04-26 20:11:47 -05:00
TestManyChildAllocs.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestMultiMgrs.cpp Bug 559953: Add a |const nsTArray<Subactor*>& ManagedFoo();| accessor. r=bent 2010-04-26 20:11:47 -05:00
TestMultiMgrs.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestNestedLoops.cpp Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron 2011-10-17 10:59:28 -04:00
TestNestedLoops.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestOpens.cpp Test for bug 763228. 2012-06-11 20:41:46 -07:00
TestOpens.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRaceDeferral.cpp Test for bug 572134. a=b 2011-01-12 01:07:17 -06:00
TestRaceDeferral.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRacyReentry.cpp Test for bug 592002. a=test 2010-09-01 13:01:50 -05:00
TestRacyReentry.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRacyRPCReplies.cpp Bug 518881: Fix unused-result warnings in IPDL/C++ unit tests. 2010-04-27 00:43:01 -05:00
TestRacyRPCReplies.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRacyUndefer.cpp Test for bug 648935. 2011-05-04 15:55:54 -05:00
TestRacyUndefer.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRPCErrorCleanup.cpp Bug 540097: Add a ProcessingError(what) notification interface for top-level actors. r=bent 2010-08-20 18:24:40 -05:00
TestRPCErrorCleanup.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestRPCRaces.cpp Bug 518881: Fix unused-result warnings in IPDL/C++ unit tests. 2010-04-27 00:43:01 -05:00
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
TestSanity.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSelfManageRoot.cpp Bug 559898: Allow (sub-)protocols to manage themselves. r=bsmedberg 2010-04-26 20:11:48 -05:00
TestSelfManageRoot.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestShmem.cpp Tests for bug 598866. 2010-11-05 02:17:07 -05:00
TestShmem.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestShutdown.cpp Bug 562424: Switch IPDL interfaces to infallible TArray. r=bent a=blocking 2010-11-08 20:49:00 -06:00
TestShutdown.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestStackHooks.cpp Bug 525181, part 3: Turn on "soft" state checking, NS_WARNING()ing on bad transitions. Fix tests. r=bent 2010-07-15 14:27:43 -05:00
TestStackHooks.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSyncError.cpp Test for bug 671189. 2011-07-13 22:43:43 -07:00
TestSyncError.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSyncHang.cpp Bug 535077 - Fixes hang caused by failure to execute sync launch r=cjones a=blocking2.0 2010-08-10 14:14:10 -07:00
TestSyncHang.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSyncWakeup.cpp No bug: Test RPC round-trip times and warn before sleep()ing. no r=, test only 2010-02-04 21:40:42 -06:00
TestSyncWakeup.h Bug 702877 - Replace NS_OVERRIDE with MOZ_OVERRIDE. r=ehsan 2012-07-06 13:15:45 -05:00
TestSysVShmem.cpp Tests for bug 598866. 2010-11-05 02:17:07 -05:00
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.