ipc/ipdl/test/cxx/README.txt

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 To add a new IPDL C++ unit test, you need to create (at least) the
     2 following files (for a test "TestFoo"):
     4   - PTestFoo.ipdl, specifying the top-level protocol used for the test
     6   - TestFoo.h, declaring the top-level parent/child actors used for
     7     the test
     9   - TestFoo.cpp, defining the top-level actors
    11   - (make sure all are in the namespace mozilla::_ipdltest)
    13 Next
    15   - add PTestFoo.ipdl to ipdl.mk
    17   - append TestFoo to the variable IPDLTESTS in Makefile.in
    19 You must define three methods in your |TestFooParent| class:
    21   - static methods |bool RunTestInProcesses()| and
    22     |bool RunTestInThreads()|.  These methods control whether
    23     to execute the test using actors in separate processes and
    24     threads respectively.  Generally, both should return true.
    26   - an instance method |void Main()|.  The test harness wil first
    27     initialize the processes or threads, create and open both actors,
    28     and then kick off the test using |Main()|.  Make sure you define
    29     it.
    31 If your test passes its criteria, please call
    32 |MOZ_IPDL_TESTPASS("msg")| and "exit gracefully".
    34 If your tests fails, please call |MOZ_IPDL_TESTFAIL("msg")| and "exit
    35 ungracefully", preferably by abort()ing.
    38 If all goes well, running
    40   make -C $OBJDIR/ipc/ipdl/test/cxx
    42 will update the file IPDLUnitTests.cpp (the test launcher), and your
    43 new code will be built automatically.
    46 You can launch your new test by invoking one of
    48   make -C $OBJDIR/ipc/ipdl/test/cxx check-proc     (test process-based tests)
    49   make -C $OBJDIR/ipc/ipdl/test/cxx check-threads  (test thread-based tests)
    50   make -C $OBJDIR/ipc/ipdl/test/cxx check          (tests both)
    52 If you want to launch only your test, run
    54   cd $OBJDIR/dist/bin
    55   ./run-mozilla.sh ./ipdlunittest TestFoo          (test in two processes, if appl.)
    56   ./run-mozilla.sh ./ipdlunittest thread:TestFoo   (test in two threads, if appl.)
    59 For a bare-bones example of adding a test, take a look at
    60 PTestSanity.ipdl, TestSanity.h, TestSanity.cpp, and how "TestSanity"
    61 is included in ipdl.mk and Makefile.in.

mercurial