mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
8c296bbcd4
This patch was generated by a script. Here's the source of the script for future reference: function convert() { echo "Converting $1 to $2..." find . ! -wholename "*nsprpub*" \ ! -wholename "*security/nss*" \ ! -wholename "*/.hg*" \ ! -wholename "obj-ff-dbg*" \ ! -name nsXPCOMCID.h \ ! -name prtypes.h \ -type f \ \( -iname "*.cpp" \ -o -iname "*.h" \ -o -iname "*.c" \ -o -iname "*.cc" \ -o -iname "*.idl" \ -o -iname "*.ipdl" \ -o -iname "*.ipdlh" \ -o -iname "*.mm" \) | \ xargs -n 1 sed -i -e "s/\b$1\b/$2/g" } convert PRInt8 int8_t convert PRUint8 uint8_t convert PRInt16 int16_t convert PRUint16 uint16_t convert PRInt32 int32_t convert PRUint32 uint32_t convert PRInt64 int64_t convert PRUint64 uint64_t convert PRIntn int convert PRUintn unsigned convert PRSize size_t convert PROffset32 int32_t convert PROffset64 int64_t convert PRPtrdiff ptrdiff_t convert PRFloat64 double |
||
---|---|---|
.. | ||
app | ||
genIPDLUnitTests.py | ||
ipdl.mk | ||
IPDLUnitTestProcessChild.cpp | ||
IPDLUnitTestProcessChild.h | ||
IPDLUnitTests.h | ||
IPDLUnitTests.template.cpp | ||
IPDLUnitTestSubprocess.cpp | ||
IPDLUnitTestSubprocess.h | ||
IPDLUnitTestTypes.h | ||
Makefile.in | ||
PTestBadActor.ipdl | ||
PTestBadActorSub.ipdl | ||
PTestBlockChild.ipdl | ||
PTestBridgeMain.ipdl | ||
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 | ||
PTestJSON.ipdl | ||
PTestLatency.ipdl | ||
PTestManyChildAllocs.ipdl | ||
PTestManyChildAllocsSub.ipdl | ||
PTestMultiMgrs.ipdl | ||
PTestMultiMgrsBottom.ipdl | ||
PTestMultiMgrsLeft.ipdl | ||
PTestMultiMgrsRight.ipdl | ||
PTestNestedLoops.ipdl | ||
PTestOpens.ipdl | ||
PTestOpensOpened.ipdl | ||
PTestRaceDeferral.ipdl | ||
PTestRacyReentry.ipdl | ||
PTestRacyRPCReplies.ipdl | ||
PTestRacyUndefer.ipdl | ||
PTestRPCErrorCleanup.ipdl | ||
PTestRPCRaces.ipdl | ||
PTestRPCShutdownRace.ipdl | ||
PTestSanity.ipdl | ||
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 | ||
TestBadActor.h | ||
TestBlockChild.cpp | ||
TestBlockChild.h | ||
TestBridgeMain.cpp | ||
TestBridgeMain.h | ||
TestCrashCleanup.cpp | ||
TestCrashCleanup.h | ||
TestDataStructures.cpp | ||
TestDataStructures.h | ||
TestDesc.cpp | ||
TestDesc.h | ||
TestFailedCtor.cpp | ||
TestFailedCtor.h | ||
TestHangs.cpp | ||
TestHangs.h | ||
TestJSON.cpp | ||
TestJSON.h | ||
TestLatency.cpp | ||
TestLatency.h | ||
TestManyChildAllocs.cpp | ||
TestManyChildAllocs.h | ||
TestMultiMgrs.cpp | ||
TestMultiMgrs.h | ||
TestNestedLoops.cpp | ||
TestNestedLoops.h | ||
TestOpens.cpp | ||
TestOpens.h | ||
TestRaceDeferral.cpp | ||
TestRaceDeferral.h | ||
TestRacyReentry.cpp | ||
TestRacyReentry.h | ||
TestRacyRPCReplies.cpp | ||
TestRacyRPCReplies.h | ||
TestRacyUndefer.cpp | ||
TestRacyUndefer.h | ||
TestRPCErrorCleanup.cpp | ||
TestRPCErrorCleanup.h | ||
TestRPCRaces.cpp | ||
TestRPCRaces.h | ||
TestRPCShutdownRace.cpp | ||
TestRPCShutdownRace.h | ||
TestSanity.cpp | ||
TestSanity.h | ||
TestSelfManageRoot.cpp | ||
TestSelfManageRoot.h | ||
TestShmem.cpp | ||
TestShmem.h | ||
TestShutdown.cpp | ||
TestShutdown.h | ||
TestStackHooks.cpp | ||
TestStackHooks.h | ||
TestSyncError.cpp | ||
TestSyncError.h | ||
TestSyncHang.cpp | ||
TestSyncHang.h | ||
TestSyncWakeup.cpp | ||
TestSyncWakeup.h | ||
TestSysVShmem.cpp | ||
TestSysVShmem.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.