1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-15 03:11:54 -07:00
emacs/mps/test
Gareth Rees fd3136bb30 Fix mmqa function test cases so that they run on windows. in detail:
1. On w3i6mv, int and long are 32 bits, so these types can't be used to hold a size_t or an mps_word_t. See 26.c, 38.c, 47.c, 66.c, 123.c, 136.c, 164.c, 165.c, 200.c, 203.c, 204.c, 205.c, 206.c, 207.c, 215.c, 223.c.
2. The Windows command line doesn't cope with parentheses. See 170.c.
3. The natural platform alignment is 16 bytes on w3i6mv, so allocations into pools using the default alignment need to be rounded up. See 21.c, 22.c, 203.c, 204.c, 205.c.
4. Microsoft Visual C/C++ is fussy about signed/unsigned comparison. See 226.c.
5. windows.h defines a SIZE macro so you can't use it as a parameter. See 232.c.

Copied from Perforce
 Change: 191569
 ServerID: perforce.ravenbrook.com
2016-04-22 15:44:58 +01:00
..
argerr Get the mmqa test system working on windows. in detail: 2016-04-22 15:00:27 +01:00
conerr Get the mmqa test system working on windows. in detail: 2016-04-22 15:00:27 +01:00
function Fix mmqa function test cases so that they run on windows. in detail: 2016-04-22 15:44:58 +01:00
misc Long delayed maintenance of test suite: 2013-05-25 10:33:30 +01:00
test Get the mmqa test system working on windows. in detail: 2016-04-22 15:00:27 +01:00
testsets Catch-up merge from master sources to branch/2015-08-11/compact. 2016-04-11 14:40:44 +01:00
README Get the mmqa test system working on windows. in detail: 2016-04-22 15:00:27 +01:00

$Id$

This is the Memory Management QA test harness. To use it you need
perl 5 (or higher). Go "perl qa help" for help, "perl qa options"
to see what version of the harness you have (or look at the
file "test/version").


Testing on Unix
---------------

From the test directory::

    PLATFORM=lii6ll # substitute your platform
    VARIETY=cool # or hot
    CODE=../code # code directory of the branch you are testing
    make -B -C $CODE -f $PLATFORM.gmk VARIETY=$VARIETY $PLATFORM/$VARIETY/mps.o
    alias qa="perl test/qa -i $CODE -l $CODE/$PLATFORM/$VARIETY/mps.o"
    qa clib
    qa run function/5.c
    qa runset testsets/passing

Each test case is compiled in its turn to the file
``test/obj/$(uname -s)_$(uname -r)_$(uname -p)__unix/tmp_test``
so you can debug it with::

    lldb test/obj/$(uname -s)_$(uname -r)_$(uname -p)__unix/tmp_test

Or ``gdb`` instead of ``lldb``. MMQA sets its own assertion handler,
so you'll probably want to set a breakpoint on mmqa_assert_handler.


Testing on OS X
---------------

From the test directory, build mpslib.a using the Xcode project::

    xcodebuild -project ../code/mps.xcodeproj -target mps

(You can also use "make" from the project root.)  Then::

    perl test/qa -i ../code -l ../code/xc/Debug/libmps.a clib
    perl test/qa -i ../code -l ../code/xc/Debug/libmps.a run function/232.c

etc.  See "Testing on Unix" above.


Testing on Windows
------------------

In a Cygwin shell, from the test directory::

    PLATFORM=w3i6mv # substitute your platform
    VARIETY=cool # or hot
    CODE=../code # code directory of the branch you are testing
    pushd $CODE
    nmake /f $PLATFORM.nmk VARIETY=$VARIETY $PLATFORM/$VARIETY/mps.obj
    popd
    export LANG=C # avoid locale warnings from Perl.
    alias qa="perl test/qa -i $CODE -l $CODE/$PLATFORM/$VARIETY/mps.obj"
    qa clib
    qa run function/5.c
    qa runset testsets/passing

The runset command can result in this error::

    LINK : fatal error LNK1168: cannot open test/obj/nt_AMD64__pc/tmp_test.exe for writing

You may be able to avoid this by running "View Local Services" from
the Windows Control Panel, double-clicking the "Application
Experience" service, and switching "Startup type" to "Automatic". See
the documentation for LNK1168_.

.. _LNK1168: https://msdn.microsoft.com/en-us/library/hhbdtt6d.aspx

At present, the easiest way to debug a test case is to edit
test/test/script/platform and set::

    $comwrap = "vsjitdebugger \"";

But see job004020_.

.. _job004020: https://www.ravenbrook.com/project/mps/issue/job004020/