1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-27 01:01:52 -07:00

Catch-up merge from master sources to branch/2014-03-21/pellesc.

Copied from Perforce
 Change: 184973
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2014-03-24 12:20:49 +00:00
commit a3575822cc
50 changed files with 413 additions and 232 deletions

View file

@ -1,7 +1,7 @@
/* abqtest.c: AVAILABLE BLOCK QUEUE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*/
#include "abq.h"
@ -154,8 +154,7 @@ extern int main(int argc, char *argv[])
mps_arena_t arena;
int i;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
abqSize = 0;
@ -178,7 +177,7 @@ extern int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* amcss.c: POOL CLASS AMC STRESS TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -306,8 +306,7 @@ int main(int argc, char *argv[])
mps_arena_t arena;
mps_thr_t thread;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), 2*testArenaSIZE),
"arena_create");
@ -331,7 +330,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* amcsshe.c: POOL CLASS AMC STRESS TEST WITH HEADER
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*/
@ -262,8 +262,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), 3*testArenaSIZE),
"arena_create\n");
@ -285,7 +284,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* amcssth.c: POOL CLASS AMC STRESS TEST WITH TWO THREADS
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*
* .posix: This is Posix only.
@ -322,8 +322,7 @@ int main(int argc, char *argv[])
void *r;
int childIsFinished = 0;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"arena_create");
@ -358,7 +357,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* amsss.c: POOL CLASS AMS STRESS TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*
* .design: Adapted from amcss.c, but not counting collections, just
@ -207,8 +207,7 @@ int main(int argc, char *argv[])
mps_pool_t pool;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"arena_create");
@ -280,7 +279,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* amssshe.c: POOL CLASS AMS STRESS TEST WITH HEADERS
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* .design: Adapted from amsss.c.
*/
@ -162,8 +162,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"arena_create");
@ -179,7 +178,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* apss.c: AP MANUAL ALLOC STRESS TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -190,8 +190,7 @@ int main(int argc, char *argv[])
bothOptions = MPS_PF_ALIGN == 8 ? &bothOptions8 : &bothOptions16;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), 2*testArenaSIZE),
"mps_arena_create");
@ -226,7 +225,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* arenacv.c: ARENA COVERAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* .coverage: At the moment, we're only trying to cover the new code
* (partial mapping of the page table and vm overflow).
@ -399,7 +399,8 @@ static void testSize(Size size)
int main(int argc, char *argv[])
{
void *block;
testlib_unused(argc);
testlib_init(argc, argv);
testPageTable((ArenaClass)mps_arena_class_vm(), TEST_ARENA_SIZE, 0, TRUE);
testPageTable((ArenaClass)mps_arena_class_vm(), TEST_ARENA_SIZE, 0, FALSE);
@ -417,7 +418,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* awlut.c: POOL CLASS AWL UNIT TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* DESIGN
*
@ -316,8 +316,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
initialise_wrapper(wrapper_wrapper);
initialise_wrapper(string_wrapper);
@ -339,7 +338,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* awluthe.c: POOL CLASS AWL UNIT TEST WITH OBJECT HEADERS
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* DESIGN
*
@ -319,8 +319,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
initialise_wrapper(wrapper_wrapper);
initialise_wrapper(string_wrapper);
@ -342,7 +341,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* awlutth.c: THREADING UNIT TEST USING POOL CLASS AWL
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* DESIGN
*
@ -316,8 +316,7 @@ int main(int argc, char *argv[])
mps_arena_t arena;
pthread_t pthread1;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
initialise_wrapper(wrapper_wrapper);
initialise_wrapper(string_wrapper);
@ -337,7 +336,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* btss.c: BIT TABLE COVERAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* .readership: MPS developers
*
@ -550,8 +550,7 @@ int main(int argc, char *argv[])
/* tests need 4 whole words plus a few extra bits */
btSize = MPS_WORD_WIDTH * 4 + 10;
testlib_unused(argc);
testlib_unused(argv);
testlib_init(argc, argv);
die(mps_arena_create(&mpsArena, mps_arena_class_vm(), testArenaSIZE),
"mps_arena_create");
@ -572,7 +571,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* bttest.c: BIT TABLE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*/
@ -366,7 +366,7 @@ extern int main(int argc, char *argv[])
bt = NULL;
btSize = 0;
testlib_unused(argc); testlib_unused(argv);
testlib_init(argc, argv);
die(mps_arena_create((mps_arena_t*)&arena, mps_arena_class_vm(),
testArenaSIZE),
@ -387,7 +387,7 @@ extern int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (C) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -221,32 +221,55 @@ endif
LIB_TARGETS=mps.a mpsplan.a
# If it is suitable for running regularly (for example, after every
# build) as an automated test case, add it to AUTO_TEST_TARGETS.
# Test executables go in TEST_TARGETS.
AUTO_TEST_TARGETS=abqtest amcss amcsshe amcssth amsss amssshe apss \
arenacv awlut awluthe awlutth btcv exposet0 expt825 fbmtest \
finalcv finaltest fotest locbwcss lockcov locusss locv messtest \
mpmss mpsicv mv2test poolncv qs sacss segsmss steptest walkt0 \
TEST_TARGETS=\
abqtest \
amcss \
amcsshe \
amcssth \
amsss \
amssshe \
apss \
arenacv \
awlut \
awluthe \
awlutth \
btcv \
bttest \
djbench \
exposet0 \
expt825 \
fbmtest \
finalcv \
finaltest \
fotest \
gcbench \
locbwcss \
lockcov \
locusss \
locv \
messtest \
mpmss \
mpsicv \
mv2test \
poolncv \
qs \
sacss \
segsmss \
steptest \
teletest \
walkt0 \
zcoll \
zmess
# If it is not runnable as an automated test case, but is buildable,
# add it to OTHER_TEST_TARGETS with a note.
#
# bttest and teletest -- interactive and so cannot be run unattended.
# djbench and gcbench -- benchmarks, not test cases.
# zcoll -- takes too long to be useful as a regularly run smoke test.
OTHER_TEST_TARGETS=bttest teletest djbench gcbench zcoll
# This target records programs that we were once able to build but
# can't at the moment:
#
# replay -- depends on the EPVM pool.
UNBUILDABLE_TARGETS=replay
UNBUILDABLE_TARGETS=\
replay # depends on the EPVM pool
ALL_TARGETS=$(LIB_TARGETS) $(AUTO_TEST_TARGETS) $(OTHER_TEST_TARGETS) $(EXTRA_TARGETS)
ALL_TARGETS=$(LIB_TARGETS) $(TEST_TARGETS) $(EXTRA_TARGETS)
# == Pseudo-targets ==
@ -256,8 +279,8 @@ all: $(ALL_TARGETS)
# Run the automated tests.
testrun: $(AUTO_TEST_TARGETS)
../tool/testrun.sh $(addprefix $(PFM)/$(VARIETY)/,$(AUTO_TEST_TARGETS))
testrun: $(TEST_TARGETS)
../tool/testrun.sh "$(PFM)/$(VARIETY)"
# These convenience targets allow one to type "make foo" to build target
# foo in selected varieties (or none, for the latter rule).

View file

@ -53,16 +53,12 @@ variety: $(PFM)\$(VARIETY)\$(TARGET)
!ENDIF
!ENDIF
mpsicv.cov:
$(MAKE) /nologo /f $(PFM).nmk TARGET=$@ VARIETY=cv variety
# testrun
# Runs automated test cases.
testrun: $(AUTO_TEST_TARGETS)
testrun: $(TEST_TARGETS)
!IFDEF VARIETY
set MPS_TESTLIB_NOABORT=true
..\tool\testrun.bat $(PFM) $(VARIETY) $(AUTO_TEST_TARGETS)
..\tool\testrun.bat $(PFM) $(VARIETY)
!ELSE
$(MAKE) /nologo /f $(PFM).nmk VARIETY=hot testrun
$(MAKE) /nologo /f $(PFM).nmk VARIETY=cool testrun

View file

@ -50,25 +50,45 @@
LIB_TARGETS=mps.lib
# If it is suitable for running regularly (for example, after every
# build) as an automated test case, add it to AUTO_TEST_TARGETS.
# Test cases go in TEST_TARGETS.
AUTO_TEST_TARGETS=abqtest.exe amcss.exe amcsshe.exe amsss.exe \
amssshe.exe apss.exe arenacv.exe awlut.exe awluthe.exe btcv.exe \
exposet0.exe expt825.exe fbmtest.exe finalcv.exe finaltest.exe \
fotest.exe locbwcss.exe lockcov.exe lockutw3.exe locusss.exe \
locv.exe messtest.exe mpmss.exe mpsicv.exe mv2test.exe \
poolncv.exe qs.exe sacss.exe segsmss.exe steptest.exe walkt0.exe \
TEST_TARGETS=\
abqtest.exe \
amcss.exe \
amcsshe.exe \
amsss.exe \
amssshe.exe \
apss.exe \
arenacv.exe \
awlut.exe \
awluthe.exe \
btcv.exe \
bttest.exe \
exposet0.exe \
expt825.exe \
fbmtest.exe \
finalcv.exe \
finaltest.exe \
fotest.exe \
locbwcss.exe \
lockcov.exe \
lockutw3.exe \
locusss.exe \
locv.exe \
messtest.exe \
mpmss.exe \
mpsicv.exe \
mv2test.exe \
poolncv.exe \
qs.exe \
sacss.exe \
segsmss.exe \
steptest.exe \
teletest.exe \
walkt0.exe \
zcoll.exe \
zmess.exe
# If it is not runnable as an automated test case, but is buildable,
# add it to OTHER_TEST_TARGETS with a note.
#
# bttest and teletest -- interactive and so cannot be run unattended.
# zcoll -- takes too long to be useful as a regularly run smoke test.
OTHER_TEST_TARGETS=bttest.exe teletest.exe zcoll.exe
# Stand-alone programs go in EXTRA_TARGETS if they should always be
# built, or in OPTIONAL_TARGETS if they should only be built if
@ -82,7 +102,7 @@ OPTIONAL_TARGETS=mpseventsql.exe
UNBUILDABLE_TARGETS=replay.exe
ALL_TARGETS=$(LIB_TARGETS) $(AUTO_TEST_TARGETS) $(OTHER_TEST_TARGETS) $(EXTRA_TARGETS)
ALL_TARGETS=$(LIB_TARGETS) $(TEST_TARGETS) $(EXTRA_TARGETS)
# PARAMETERS
@ -90,13 +110,57 @@ ALL_TARGETS=$(LIB_TARGETS) $(AUTO_TEST_TARGETS) $(OTHER_TEST_TARGETS) $(EXTRA_TA
#
# %%PART: When adding a new part, add the sources for the new part here.
MPMCOMMON = <abq> <arena> <arenacl> <arenavm> <arg> <boot> <bt> \
<buffer> <cbs> <dbgpool> <dbgpooli> <event> <format> \
<freelist> <global> <ld> <lockw3> <locus> <message> <meter> <mpm> \
<mpsi> <mpsiw3> <pool> <poolabs> <poolmfs> <poolmrg> <poolmv2> \
<poolmv> <protocol> <protw3> <range> <ref> <reserv> <ring> <root> \
<sa> <sac> <seg> <shield> <splay> <ss> <table> <thw3> <trace> \
<traceanc> <tract> <tree> <vmw3> <walk>
MPMCOMMON=\
<abq> \
<arena> \
<arenacl> \
<arenavm> \
<arg> \
<boot> \
<bt> \
<buffer> \
<cbs> \
<dbgpool> \
<dbgpooli> \
<event> \
<format> \
<freelist> \
<global> \
<ld> \
<lockw3> \
<locus> \
<message> \
<meter> \
<mpm> \
<mpsi> \
<mpsiw3> \
<pool> \
<poolabs> \
<poolmfs> \
<poolmrg> \
<poolmv2> \
<poolmv> \
<protocol> \
<protw3> \
<range> \
<ref> \
<reserv> \
<ring> \
<root> \
<sa> \
<sac> \
<seg> \
<shield> \
<splay> \
<ss> \
<table> \
<thw3> \
<trace> \
<traceanc> \
<tract> \
<tree> \
<vmw3> \
<walk>
PLINTH = <mpsliban> <mpsioan>
AMC = <poolamc>
AMS = <poolams> <poolamsi>

View file

@ -1,7 +1,7 @@
/* event.c: EVENT LOGGING
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* .sources: mps.design.event
*
@ -471,7 +471,7 @@ EventStringId EventInternString(const char *label)
UNUSED(label);
/* EventInternString is reached in varieties without events, but the result
is not used for anything. */
return (EventStringId)0x9024EAC8;
return (EventStringId)0x4026EAC8;
}
@ -480,7 +480,7 @@ Word EventInternGenString(size_t len, const char *label)
UNUSED(len); UNUSED(label);
/* EventInternGenString is reached in varieties without events, but
the result is not used for anything. */
return (EventStringId)0x9024EAC8;
return (EventStringId)0x4026EAC8;
}
@ -520,7 +520,7 @@ extern void EventDump(mps_lib_FILE *stream)
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (C) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* exposet0.c: ARENA EXPOSE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* The primary purpose of this test is to test that mps_arena_expose does
@ -255,8 +255,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), 2*testArenaSIZE),
"arena_create");
@ -275,7 +274,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* expt825.c: Test for bug described in job000825
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* DESIGN
@ -262,7 +262,8 @@ int main(int argc, char *argv[])
mps_arena_t arena;
mps_thr_t thread;
void *r;
testlib_unused(argc);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"arena_create\n");
@ -278,7 +279,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* fbmtest.c: FREE BLOCK MANAGEMENT TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* The MPS contains two free block management modules:
*
@ -560,7 +560,7 @@ extern int main(int argc, char *argv[])
CBSStruct cbsStruct;
Align align;
randomize(argc, argv);
testlib_init(argc, argv);
align = (1 << rnd() % 4) * MPS_PF_ALIGN;
NAllocateTried = NAllocateSucceeded = NDeallocateTried =
@ -616,7 +616,7 @@ extern int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* finalcv.c: FINALIZATION COVERAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* DESIGN
@ -217,8 +217,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"arena_create\n");
@ -234,7 +233,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* finaltest.c: LARGE-SCALE FINALIZATION TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* DESIGN
@ -245,7 +245,8 @@ int main(int argc, char *argv[])
mps_arena_t arena;
mps_thr_t thread;
void *r;
testlib_unused(argc);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"arena_create\n");
@ -261,7 +262,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* fotest.c: FAIL-OVER TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* This tests fail-over behaviour in low memory situations. The MVFF
@ -170,8 +170,7 @@ int main(int argc, char *argv[])
mps_pool_t pool;
mps_align_t alignment;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"mps_arena_create");
@ -218,7 +217,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -193,8 +193,7 @@ int main(int argc, char *argv[])
{
mps_arena_t arena;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, testArenaSIZE);

View file

@ -1,7 +1,7 @@
/* lockcov.c: LOCK COVERAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*/
#include "mpm.h"
@ -14,7 +14,8 @@ int main(int argc, char *argv[])
{
Lock a = malloc(LockSize());
Lock b = malloc(LockSize());
testlib_unused(argc);
testlib_init(argc, argv);
Insist(a != NULL);
Insist(b != NULL);
@ -53,7 +54,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* lockutw3.c: LOCK UTILIZATION TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*/
#include "mpm.h"
@ -71,6 +71,8 @@ int main(int argc, char *argv[])
HANDLE t[10];
unsigned i;
testlib_init(argc, argv);
lock = malloc(LockSize());
Insist(lock != NULL);
@ -96,7 +98,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -237,9 +237,7 @@ static void runArenaTest(size_t size,
int main(int argc, char *argv[])
{
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
printf("\nRunning test with no information about peak usage.\n");
runArenaTest(smallArenaSize, FALSE, FALSE);

View file

@ -1,7 +1,7 @@
/* locv.c: LEAF OBJECT POOL CLASS COVERAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* This is (not much of) a coverage test for the Leaf Object
* pool (PoolClassLO).
@ -48,7 +48,8 @@ int main(int argc, char *argv[])
mps_ap_t ap;
mps_addr_t p;
mps_root_t root;
testlib_unused(argc);
testlib_init(argc, argv);
locv_fmt.align = sizeof(void *); /* .fmt.align.delayed */
@ -169,7 +170,7 @@ static void stepper(mps_addr_t addr, mps_fmt_t fmt, mps_pool_t pool,
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* messtest.c: MESSAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*/
#include "mpm.h"
@ -261,8 +261,7 @@ extern int main(int argc, char *argv[])
mps_arena_t mpsArena;
Arena arena;
testlib_unused(argc);
testlib_unused(argv);
testlib_init(argc, argv);
die(mps_arena_create(&mpsArena, mps_arena_class_vm(), testArenaSIZE),
"mps_arena_create");
@ -279,7 +278,7 @@ extern int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* mpmss.c: MPM STRESS TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -188,8 +188,7 @@ int main(int argc, char *argv[])
bothOptions = MPS_PF_ALIGN == 8 ? &bothOptions8 : &bothOptions16;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"mps_arena_create");
@ -208,7 +207,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -3163,7 +3163,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Not listed here:\n# bttest and teletest -- interactive and so cannot be run unattended.\n# djbench and gcbench -- benchmarks, not test cases.\n# zcoll -- takes too long to be useful as a regularly run smoke test.\nTESTCASES=\"abqtest amcss amcsshe amcssth amsss amssshe apss arenacv \\\n awlut awlutth awluthe btcv expt825 exposet0 fbmtest finalcv \\\n finaltest fotest locbwcss lockcov locusss locv messtest mpmss \\\n mpsicv mv2test poolncv qs sacss segsmss steptest walkt0 zmess\"\n\n../tool/testrun.sh $(for TEST in $TESTCASES; do echo $TARGET_BUILD_DIR/$TEST; done)\n";
shellScript = "../tool/testrun.sh \"$TARGET_BUILD_DIR\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

View file

@ -1,7 +1,7 @@
/* mpsicv.c: MPSI COVERAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*/
@ -583,8 +583,7 @@ int main(int argc, char *argv[])
void *r;
void *marker = &marker;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), TEST_ARENA_SIZE),
"arena_create");
@ -609,7 +608,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* mv2test.c: POOLMVT STRESS TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*/
#include <stdio.h>
@ -203,7 +203,7 @@ static void stress_with_arena_class(mps_arena_class_t aclass, Bool zoned)
int main(int argc, char *argv[])
{
randomize(argc, argv);
testlib_init(argc, argv);
stress_with_arena_class(mps_arena_class_vm(), TRUE);
stress_with_arena_class(mps_arena_class_vm(), FALSE);
@ -215,7 +215,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* poolncv.c: NULL POOL COVERAGE TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*/
#include "mpm.h"
@ -33,7 +33,7 @@ static void testit(ArenaClass class, ArgList args)
int main(int argc, char *argv[])
{
testlib_unused(argc);
testlib_init(argc, argv);
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 600000);
testit((ArenaClass)mps_arena_class_vm(), args);
@ -45,7 +45,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* qs.c: QUICKSORT
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* The purpose of this program is to act as a "real" client of the MM.
* It is a test, but (hopefully) less contrived than some of the other
@ -528,8 +528,7 @@ int main(int argc, char *argv[])
{
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"mps_arena_create");
@ -543,7 +542,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* sacss.c: SAC MANUAL ALLOC STRESS TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -191,8 +191,7 @@ int main(int argc, char *argv[])
{
mps_arena_t arena;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"mps_arena_create");
@ -216,7 +215,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* segsmss.c: Segment splitting and merging stress test
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*
* .design: Adapted from amsss.c (because AMS already supports
@ -854,8 +854,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"arena_create");
@ -871,7 +870,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* steptest.c: TEST FOR ARENA STEPPING
*
* $Id$
* Copyright (c) 1998-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 1998-2014 Ravenbrook Limited. See end of file for license.
*
* Loosely based on <code/amcss.c>.
*/
@ -492,8 +492,7 @@ int main(int argc, char *argv[])
{
prepare_clock();
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
while (test_number < TESTS) {
mps_arena_t arena;
@ -519,7 +518,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* teletest.c: TELEMETRY TEST
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* .source: The command parser here was taken and adapted from bttest.c.
*/
@ -200,8 +200,7 @@ static void obeyCommand(char *command)
extern int main(int argc, char *argv[])
{
testlib_unused(argc);
testlib_unused(argv);
testlib_init(argc, argv);
die(mps_arena_create((mps_arena_t*)&arena, mps_arena_class_vm(),
testArenaSIZE),
@ -223,7 +222,7 @@ extern int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (C) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* testlib.c: TEST LIBRARY
*
* $Id$
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* .purpose: A library of functions that may be of use to unit tests.
@ -409,10 +409,18 @@ void assert_die(const char *file, unsigned line, const char *condition)
}
/* testlib_init -- install assertion handler and seed RNG */
void testlib_init(int argc, char *argv[])
{
mps_lib_assert_fail_install(assert_die);
randomize(argc, argv);
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -227,6 +227,11 @@ extern double rnd_double(void);
extern void randomize(int argc, char *argv[]);
/* testlib_init -- install assertion handler and seed RNG */
extern void testlib_init(int argc, char *argv[]);
#endif /* testlib_h */

View file

@ -1,7 +1,7 @@
/* walkt0.c: WALK TEST 0
*
* $Id$
* Copyright (c) 1998-2013 Ravenbrook Limited. See end of file for license.
* Copyright (c) 1998-2014 Ravenbrook Limited. See end of file for license.
*
* Loosely based on <code/steptest.c>.
*/
@ -201,8 +201,7 @@ int main(int argc, char *argv[])
mps_thr_t thread;
void *r;
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
die(mps_arena_create(&arena, mps_arena_class_vm(),
testArenaSIZE),
@ -219,7 +218,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* zcoll.c: Collection test
*
* $Id$
* Copyright (c) 2008 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2008-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* OBJECTIVE
@ -838,8 +838,7 @@ static void testscriptA(const char *script)
*/
int main(int argc, char *argv[])
{
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
/* 1<<19 == 524288 == 1/2 Mebibyte */
/* 16<<20 == 16777216 == 16 Mebibyte */
@ -938,7 +937,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* zmess.c: Message test
*
* $Id$
* Copyright (c) 2008 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2008-2014 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* OBJECTIVE
@ -486,9 +486,7 @@ Bool TIMCA_remote(void)
*/
int main(int argc, char *argv[])
{
randomize(argc, argv);
mps_lib_assert_fail_install(assert_die);
testlib_init(argc, argv);
/* Scripts that should fail (uncomment to show failure is detected) */
/*testscriptA("C.");*/
@ -571,7 +569,7 @@ int main(int argc, char *argv[])
/* C. COPYRIGHT AND LICENSE
*
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -94,7 +94,7 @@ def main(argv):
args = parser.parse_args(argv[1:])
args.depot = DEPOT
args.date = datetime.date.today().strftime('%Y-%m-%d')
fmt = lambda s: s.format_map(vars(args))
fmt = lambda s: s.format(**vars(args))
if not args.project:
# Deduce project from current directory.

View file

@ -25,23 +25,29 @@ This document is not confidential.
2. Tools
--------
================= =========================================================
`gcovfmt.py`_ Formats the output of the ``gcov`` coverage tool into a
summary table. It runs only on OS X, where it is invoked
from the Xcode project after running the test suite for
the “Debug” configuration.
================= ==========================================================
`branch`_ Make a version or development branch.
`gcovfmt`_ Formats the output of the ``gcov`` coverage tool into a
summary table.
`release`_ Make a product release.
`testcoverage`_ Instrument the test suite for coverage, run it, and output
a coverage report.
`testopendylan`_ Download the latest version of Open Dylan and build it
against the MPS sources.
`testrun.bat`_ Implements the ``testrun`` make target on Windows, where
it is invoked from ``commpost.nmk``.
`testrun.sh`_ Implements the ``testrun`` make target on FreeBSD and
Linux, it is invoked from ``comm.gmk``, and on OS X,
where it is invoked from the Xcode project.
`test-runner.py`_ Builds and runs tests. As of 2013-05-24 it is not used.
================= =========================================================
Linux, it is invoked from ``comm.gmk``, and on OS X, where
it is invoked from the Xcode project.
================= ==========================================================
.. _gcovfmt.py: gcovfmt.py
.. _branch: branch
.. _gcovfmt: gcovfmt
.. _release: release
.. _testcoverage: testcoverage
.. _testopendylan: testopendylan
.. _testrun.bat: testrun.bat
.. _testrun.sh: testrun.sh
.. _test-runner.py: test-runner.py
A. References
@ -57,6 +63,8 @@ B. Document History
2013-05-24 GDR_ Added ``gcovfmt.py`` and ``testrun.sh``.
``test-runner.py`` is no longer used.
2014-01-13 GDR_ Converted to reStructuredText. Added ``testrun.bat``.
2014-03-22 GDR_ Add ``branch``, ``release``, ``testcoverage``, and
``testopendylan``.
========== ====== ========================================================
.. _GDR: mailto:gdr@ravenbrook.com

View file

@ -83,7 +83,7 @@ def main(argv):
args = parser.parse_args(argv[1:])
args.depot = DEPOT
args.today = datetime.date.today().strftime('%Y-%m-%d')
fmt = lambda s: s.format_map(vars(args))
fmt = lambda s: s.format(**vars(args))
if not args.project:
# Deduce project from current directory.

View file

@ -12,16 +12,18 @@
#
# This shell script runs the MPS test suite and prepares a test
# coverage report.
#
# Supported platforms: xc.
ARCH=$(uname -m)
OS=$(uname -s)
PROJECT=mps
CONFIGURATION=Debug
TOOL=$(dirname "$0")
CODE=$TOOL/../code
case "$ARCH-$OS" in
*-Darwin)
CONFIGURATION=Debug
(
cd -- "$CODE"
xcodebuild -config "$CONFIGURATION" clean

View file

@ -1,5 +1,16 @@
@rem $Id: //info.ravenbrook.com/project/mps/master/tool/testrun.sh#1 $
@rem Copyright (c) 2013 Ravenbrook Limited. See end of file for license.
@rem
@rem This program runs a series of test cases, capturing the output of
@rem each one to a temporary file. In addition, the output of any test
@rem case that fails gets printed to standard output so that it is not
@rem lost when the test is running on a temporary build server (see
@rem job003489). Finally, it prints a summary of passes and failures, and
@rem if there were any failures, it exits with a non-zero status code.
@rem
@rem Usage::
@rem
@rem testrun.sh PLATFORM VARIETY [CASE1 CASE2 ...]
@echo off
@ -8,7 +19,44 @@ shift
set VARIETY=%1
shift
set ALL_TEST_CASES=^
abqtest.exe ^
amcss.exe ^
amcsshe.exe ^
amsss.exe ^
amssshe.exe ^
apss.exe ^
arenacv.exe ^
awlut.exe ^
awluthe.exe ^
btcv.exe ^
exposet0.exe ^
expt825.exe ^
fbmtest.exe ^
finalcv.exe ^
finaltest.exe ^
fotest.exe ^
locbwcss.exe ^
lockcov.exe ^
lockutw3.exe ^
locusss.exe ^
locv.exe ^
messtest.exe ^
mpmss.exe ^
mpsicv.exe ^
mv2test.exe ^
poolncv.exe ^
qs.exe ^
sacss.exe ^
segsmss.exe ^
steptest.exe ^
walkt0.exe ^
zmess.exe
@rem Ensure that test cases don't pop up dialog box on abort()
set MPS_TESTLIB_NOABORT=true
set TEST_COUNT=0
set PASS_COUNT=0
set FAIL_COUNT=0
set SEPARATOR=----------------------------------------
set LOGDIR=%TMP%\mps-%VARIETY%-log
@ -16,27 +64,31 @@ echo Logging test output to %LOGDIR%
rmdir /q /s %LOGDIR%
mkdir %LOGDIR%
:loop
if "%1"=="" goto continue
set /a TEST_COUNT=%TEST_COUNT%+1
echo Running %1
%PFM%\%VARIETY%\%1 > %LOGDIR%\%1
if "%errorlevel%"=="0" goto success
echo %SEPARATOR%%SEPARATOR%
type %LOGDIR%\%1
echo %SEPARATOR%%SEPARATOR%
set /a FAIL_COUNT=%FAIL_COUNT%+1
:success
shift
goto loop
:continue
if "%1"=="" call :run_tests %ALL_TEST_CASES%
if "%FAIL_COUNT%"=="0" goto allpass
echo Tests: %TEST_COUNT% Failures: %FAIL_COUNT%
if "%FAIL_COUNT%"=="0" (
echo Tests: %TEST_COUNT%. All tests pass.
exit 0
) else (
echo Tests: %TEST_COUNT%. Passes: %PASS_COUNT%. Failures: %FAIL_COUNT%.
exit 1
)
:allpass
echo Tests: %TEST_COUNT% All tests pass.
:run_tests
if "%1"=="" exit /b
set /a TEST_COUNT=%TEST_COUNT%+1
echo Running %1
%PFM%\%VARIETY%\%1 > %LOGDIR%\%1
if "%errorlevel%"=="0" (
set /a PASS_COUNT=%PASS_COUNT%+1
) else (
echo %SEPARATOR%%SEPARATOR%
type %LOGDIR%\%1
echo %SEPARATOR%%SEPARATOR%
set /a FAIL_COUNT=%FAIL_COUNT%+1
)
shift
goto run_tests
@rem C. COPYRIGHT AND LICENSE

View file

@ -1,7 +1,7 @@
#!/bin/sh
#
# $Id$
# Copyright (c) 2013 Ravenbrook Limited. See end of file for license.
# Copyright (c) 2013-2014 Ravenbrook Limited. See end of file for license.
#
# This program runs a series of test cases, capturing the output of
# each one to a temporary file. In addition, the output of any test
@ -12,28 +12,73 @@
#
# Usage::
#
# testrun.sh case1 case2 ...
# testrun.sh DIR [CASE1 CASE2 ...]
ALL_TEST_CASES="
abqtest
amcss
amcsshe
amcssth
amsss
amssshe
apss
arenacv
awlut
awluthe
awlutth
btcv
exposet0
expt825
fbmtest
finalcv
finaltest
fotest
locbwcss
lockcov
locusss
locv
messtest
mpmss
mpsicv
mv2test
poolncv
qs
sacss
segsmss
steptest
walkt0
zmess
"
# bttest -- interactive, so cannot be run unattended
# djbench -- benchmark, not test case
# gcbench -- benchmark, not test case
# teletest -- interactive, so cannot be run unattended
# zcoll -- takes too long to be useful as a regularly run smoke test
# Make a temporary output directory for the test logs.
LOGDIR=$(mktemp -d /tmp/mps.log.XXXXXX)
TEST_DIR=$1
echo "MPS test suite"
echo "Logging test output to $LOGDIR"
echo "Test directory: $TEST_DIR"
shift
TEST_CASES=${*:-${ALL_TEST_CASES}}
SEPARATOR="----------------------------------------"
TEST_COUNT=0
PASS_COUNT=0
FAIL_COUNT=0
for TESTCASE in "$@"; do
TEST="$(basename "$TESTCASE")"
for TESTCASE in $TEST_CASES; do
TEST="$(basename -- "$TESTCASE")"
LOGTEST="$LOGDIR/$TEST"
echo "Running $TEST"
TEST_COUNT=$(expr $TEST_COUNT + 1)
if "$TESTCASE" > "$LOGTEST" 2>&1; then
if "$TEST_DIR/$TESTCASE" > "$LOGTEST" 2>&1; then
PASS_COUNT=$(expr $PASS_COUNT + 1)
else
echo "$TEST failed: log follows"
echo ${SEPARATOR}${SEPARATOR}
cat "$LOGTEST"
cat -- "$LOGTEST"
echo
echo ${SEPARATOR}${SEPARATOR}
FAIL_COUNT=$(expr $FAIL_COUNT + 1)
@ -49,7 +94,7 @@ fi
# C. COPYRIGHT AND LICENSE
#
# Copyright (C) 2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
# Copyright (C) 2013-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
# All rights reserved. This is an open source license. Contact
# Ravenbrook for commercial licensing options.
#