From 15b9838d34ea4a6ecbb4f67b496f996494826abf Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 21 Mar 2014 15:37:28 +0000 Subject: [PATCH 1/9] Use .format(**d) instead of .format_map(d) for portability to python 2. Copied from Perforce Change: 184938 ServerID: perforce.ravenbrook.com --- mps/tool/branch | 2 +- mps/tool/release | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mps/tool/branch b/mps/tool/branch index d46a66d2077..f60eccae235 100755 --- a/mps/tool/branch +++ b/mps/tool/branch @@ -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. diff --git a/mps/tool/release b/mps/tool/release index f1613f88b42..b6779b1b3fb 100755 --- a/mps/tool/release +++ b/mps/tool/release @@ -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. From 0567ab1a9031c43924efdc19d738c9c4999eca09 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Sat, 22 Mar 2014 16:17:09 +0000 Subject: [PATCH 2/9] Update tool index. Copied from Perforce Change: 184955 ServerID: perforce.ravenbrook.com --- mps/tool/index.rst | 23 +++++++++++++---------- mps/tool/testcoverage | 4 +++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/mps/tool/index.rst b/mps/tool/index.rst index 9d23b949e7b..7fe991e0510 100644 --- a/mps/tool/index.rst +++ b/mps/tool/index.rst @@ -25,20 +25,23 @@ 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 +.. _gcovfmt: gcovfmt .. _testrun.bat: testrun.bat .. _testrun.sh: testrun.sh .. _test-runner.py: test-runner.py diff --git a/mps/tool/testcoverage b/mps/tool/testcoverage index f8e2066d1e8..ff1967031dd 100755 --- a/mps/tool/testcoverage +++ b/mps/tool/testcoverage @@ -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 From 6d2a13cbcd3da547202ab31e3c4311992f937c86 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Sat, 22 Mar 2014 16:18:29 +0000 Subject: [PATCH 3/9] Fix links. Copied from Perforce Change: 184956 ServerID: perforce.ravenbrook.com --- mps/tool/index.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mps/tool/index.rst b/mps/tool/index.rst index 7fe991e0510..8edc44095af 100644 --- a/mps/tool/index.rst +++ b/mps/tool/index.rst @@ -41,10 +41,13 @@ This document is not confidential. it is invoked from the Xcode project. ================= ========================================================== +.. _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 @@ -60,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 From 15d585558ed032c390d0a0ba0e2baead6bb3cec4 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Sat, 22 Mar 2014 18:04:56 +0000 Subject: [PATCH 4/9] Don't list the test cases to be run in the xcode project: list them in testrun.sh instead so that this is shared with the freebsd and linux platforms. Format the list with one test case per line so that merges are easier. Copied from Perforce Change: 184958 ServerID: perforce.ravenbrook.com --- mps/code/comm.gmk | 65 +++++++++++++++++--------- mps/code/mps.xcodeproj/project.pbxproj | 2 +- mps/tool/testrun.sh | 59 ++++++++++++++++++++--- 3 files changed, 97 insertions(+), 29 deletions(-) diff --git a/mps/code/comm.gmk b/mps/code/comm.gmk index c412ac476e3..04830ec3431 100644 --- a/mps/code/comm.gmk +++ b/mps/code/comm.gmk @@ -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). diff --git a/mps/code/mps.xcodeproj/project.pbxproj b/mps/code/mps.xcodeproj/project.pbxproj index d38f9d81114..d7865d3d4a6 100644 --- a/mps/code/mps.xcodeproj/project.pbxproj +++ b/mps/code/mps.xcodeproj/project.pbxproj @@ -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 */ diff --git a/mps/tool/testrun.sh b/mps/tool/testrun.sh index ff01634b850..1bdaf0aa6d2 100755 --- a/mps/tool/testrun.sh +++ b/mps/tool/testrun.sh @@ -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 . +# Copyright (C) 2013-2014 Ravenbrook Limited . # All rights reserved. This is an open source license. Contact # Ravenbrook for commercial licensing options. # From 9fc55a379f720fa3e38476d8f1d7886f3c79b001 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Sat, 22 Mar 2014 18:15:06 +0000 Subject: [PATCH 5/9] Testrun.sh needs to be run by bash in order to use a list. Copied from Perforce Change: 184959 ServerID: perforce.ravenbrook.com --- mps/tool/testrun.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mps/tool/testrun.sh b/mps/tool/testrun.sh index 1bdaf0aa6d2..5fdfa47bc05 100755 --- a/mps/tool/testrun.sh +++ b/mps/tool/testrun.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # # $Id$ # Copyright (c) 2013-2014 Ravenbrook Limited. See end of file for license. From b530338b868872f2370b93047b422c1bf9bc954b Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Sat, 22 Mar 2014 18:25:33 +0000 Subject: [PATCH 6/9] Better to use /bin/sh and not have such fancy syntax. Copied from Perforce Change: 184960 ServerID: perforce.ravenbrook.com --- mps/tool/testrun.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mps/tool/testrun.sh b/mps/tool/testrun.sh index 5fdfa47bc05..9cecd1c6fd5 100755 --- a/mps/tool/testrun.sh +++ b/mps/tool/testrun.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # # $Id$ # Copyright (c) 2013-2014 Ravenbrook Limited. See end of file for license. @@ -14,7 +14,7 @@ # # testrun.sh DIR [CASE1 CASE2 ...] -ALL_TEST_CASES=( +ALL_TEST_CASES=" abqtest amcss amcsshe @@ -48,12 +48,12 @@ ALL_TEST_CASES=( 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 -) +" +# 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) @@ -62,7 +62,7 @@ echo "MPS test suite" echo "Logging test output to $LOGDIR" echo "Test directory: $TEST_DIR" shift -TEST_CASES=${*:-${ALL_TEST_CASES[*]}} +TEST_CASES=${*:-${ALL_TEST_CASES}} SEPARATOR="----------------------------------------" TEST_COUNT=0 From 333840f54adcd966fe2a8c69d75e523828626603 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 24 Mar 2014 11:41:01 +0000 Subject: [PATCH 7/9] Ensure that all test cases call testlib_init so that the testlib assertion handler is installed: this ensures that on windows you can set mps_testlib_noabort to avoid the dialog box from abort(). Copied from Perforce Change: 184965 ServerID: perforce.ravenbrook.com --- mps/code/abqtest.c | 7 +++---- mps/code/amcss.c | 7 +++---- mps/code/amcsshe.c | 7 +++---- mps/code/amcssth.c | 7 +++---- mps/code/amsss.c | 7 +++---- mps/code/amssshe.c | 7 +++---- mps/code/apss.c | 7 +++---- mps/code/arenacv.c | 7 ++++--- mps/code/awlut.c | 7 +++---- mps/code/awluthe.c | 7 +++---- mps/code/awlutth.c | 7 +++---- mps/code/btcv.c | 7 +++---- mps/code/bttest.c | 6 +++--- mps/code/exposet0.c | 7 +++---- mps/code/expt825.c | 7 ++++--- mps/code/fbmtest.c | 6 +++--- mps/code/finalcv.c | 7 +++---- mps/code/finaltest.c | 7 ++++--- mps/code/fotest.c | 7 +++---- mps/code/locbwcss.c | 3 +-- mps/code/lockcov.c | 7 ++++--- mps/code/lockutw3.c | 6 ++++-- mps/code/locusss.c | 4 +--- mps/code/locv.c | 7 ++++--- mps/code/messtest.c | 7 +++---- mps/code/mpmss.c | 7 +++---- mps/code/mpsicv.c | 7 +++---- mps/code/mv2test.c | 6 +++--- mps/code/poolncv.c | 6 +++--- mps/code/qs.c | 7 +++---- mps/code/sacss.c | 7 +++---- mps/code/segsmss.c | 7 +++---- mps/code/steptest.c | 7 +++---- mps/code/teletest.c | 7 +++---- mps/code/testlib.c | 12 ++++++++++-- mps/code/testlib.h | 5 +++++ mps/code/walkt0.c | 7 +++---- mps/code/zcoll.c | 7 +++---- mps/code/zmess.c | 8 +++----- 39 files changed, 128 insertions(+), 137 deletions(-) diff --git a/mps/code/abqtest.c b/mps/code/abqtest.c index f8e3a2a4bd4..350f0e89f86 100644 --- a/mps/code/abqtest.c +++ b/mps/code/abqtest.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/amcss.c b/mps/code/amcss.c index e3bb32627eb..bf0c6611174 100644 --- a/mps/code/amcss.c +++ b/mps/code/amcss.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/amcsshe.c b/mps/code/amcsshe.c index de8eec82a3a..5ad7c064f5d 100644 --- a/mps/code/amcsshe.c +++ b/mps/code/amcsshe.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/amcssth.c b/mps/code/amcssth.c index e7f8f88233a..f01dbaf9d6b 100644 --- a/mps/code/amcssth.c +++ b/mps/code/amcssth.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/amsss.c b/mps/code/amsss.c index 43d2541f401..a0a1fe666e6 100644 --- a/mps/code/amsss.c +++ b/mps/code/amsss.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/amssshe.c b/mps/code/amssshe.c index ddbda607017..4787ef80e6f 100644 --- a/mps/code/amssshe.c +++ b/mps/code/amssshe.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/apss.c b/mps/code/apss.c index a8d1a7660de..aaa5da0957b 100644 --- a/mps/code/apss.c +++ b/mps/code/apss.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/arenacv.c b/mps/code/arenacv.c index 12ae42ff721..8b149c194bd 100644 --- a/mps/code/arenacv.c +++ b/mps/code/arenacv.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/awlut.c b/mps/code/awlut.c index 25ceb34b29b..8af4bcd4bbc 100644 --- a/mps/code/awlut.c +++ b/mps/code/awlut.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/awluthe.c b/mps/code/awluthe.c index 6b56d05f78d..9fb1281dcc1 100644 --- a/mps/code/awluthe.c +++ b/mps/code/awluthe.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/awlutth.c b/mps/code/awlutth.c index c937535a0cf..f12d8913543 100644 --- a/mps/code/awlutth.c +++ b/mps/code/awlutth.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/btcv.c b/mps/code/btcv.c index 72256a5f693..414c3351161 100644 --- a/mps/code/btcv.c +++ b/mps/code/btcv.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/bttest.c b/mps/code/bttest.c index ea2b00849b8..12a6bd8503f 100644 --- a/mps/code/bttest.c +++ b/mps/code/bttest.c @@ -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 . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/exposet0.c b/mps/code/exposet0.c index b204b59d265..739ccac1e6a 100644 --- a/mps/code/exposet0.c +++ b/mps/code/exposet0.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/expt825.c b/mps/code/expt825.c index 9c7c4556d77..e18905061cf 100644 --- a/mps/code/expt825.c +++ b/mps/code/expt825.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/fbmtest.c b/mps/code/fbmtest.c index 8465234475e..905e90d0a93 100644 --- a/mps/code/fbmtest.c +++ b/mps/code/fbmtest.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/finalcv.c b/mps/code/finalcv.c index 8236df4279b..daed57c7311 100644 --- a/mps/code/finalcv.c +++ b/mps/code/finalcv.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/finaltest.c b/mps/code/finaltest.c index f5ef8a9a99f..205cfefd5ad 100644 --- a/mps/code/finaltest.c +++ b/mps/code/finaltest.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/fotest.c b/mps/code/fotest.c index cab1d0f4e31..ada5f6dec67 100644 --- a/mps/code/fotest.c +++ b/mps/code/fotest.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/locbwcss.c b/mps/code/locbwcss.c index 40f21576270..5807d9c1f7b 100644 --- a/mps/code/locbwcss.c +++ b/mps/code/locbwcss.c @@ -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); diff --git a/mps/code/lockcov.c b/mps/code/lockcov.c index 28c398e4bba..a8237f7de72 100644 --- a/mps/code/lockcov.c +++ b/mps/code/lockcov.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/lockutw3.c b/mps/code/lockutw3.c index c66db7edd77..da5070ecab7 100644 --- a/mps/code/lockutw3.c +++ b/mps/code/lockutw3.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/locusss.c b/mps/code/locusss.c index f293ae7c7b5..b399e58e8da 100644 --- a/mps/code/locusss.c +++ b/mps/code/locusss.c @@ -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); diff --git a/mps/code/locv.c b/mps/code/locv.c index 29881f6c54e..56c9a46d2c5 100644 --- a/mps/code/locv.c +++ b/mps/code/locv.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/messtest.c b/mps/code/messtest.c index b7e178b483d..7f96360f78e 100644 --- a/mps/code/messtest.c +++ b/mps/code/messtest.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/mpmss.c b/mps/code/mpmss.c index c18c4fe07dd..76fbf12c3fe 100644 --- a/mps/code/mpmss.c +++ b/mps/code/mpmss.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/mpsicv.c b/mps/code/mpsicv.c index 142498a4502..3f8d05b92e0 100644 --- a/mps/code/mpsicv.c +++ b/mps/code/mpsicv.c @@ -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 = ▮ - 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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/mv2test.c b/mps/code/mv2test.c index 3302471e733..bc276abfc26 100644 --- a/mps/code/mv2test.c +++ b/mps/code/mv2test.c @@ -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 @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/poolncv.c b/mps/code/poolncv.c index deee10715da..6d77542db58 100644 --- a/mps/code/poolncv.c +++ b/mps/code/poolncv.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/qs.c b/mps/code/qs.c index 13b2070da19..40e290dceec 100644 --- a/mps/code/qs.c +++ b/mps/code/qs.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/sacss.c b/mps/code/sacss.c index 1f9a855b32c..a5fc3734029 100644 --- a/mps/code/sacss.c +++ b/mps/code/sacss.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/segsmss.c b/mps/code/segsmss.c index 2e071e6dc0f..06c6b7c01fb 100644 --- a/mps/code/segsmss.c +++ b/mps/code/segsmss.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/steptest.c b/mps/code/steptest.c index c01b81f21e1..73cc730b790 100644 --- a/mps/code/steptest.c +++ b/mps/code/steptest.c @@ -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 . */ @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/teletest.c b/mps/code/teletest.c index 5f54dc61102..17002585133 100644 --- a/mps/code/teletest.c +++ b/mps/code/teletest.c @@ -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 . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/testlib.c b/mps/code/testlib.c index 2bed23b0f6f..8ef14ca3c78 100644 --- a/mps/code/testlib.c +++ b/mps/code/testlib.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/testlib.h b/mps/code/testlib.h index d58655ca246..d36f26a275c 100644 --- a/mps/code/testlib.h +++ b/mps/code/testlib.h @@ -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 */ diff --git a/mps/code/walkt0.c b/mps/code/walkt0.c index 3e8c8ce8293..3365874c153 100644 --- a/mps/code/walkt0.c +++ b/mps/code/walkt0.c @@ -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 . */ @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/zcoll.c b/mps/code/zcoll.c index 66b4d268b8d..639a323957a 100644 --- a/mps/code/zcoll.c +++ b/mps/code/zcoll.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/zmess.c b/mps/code/zmess.c index 0ad57e09c46..1c87ac56cf2 100644 --- a/mps/code/zmess.c +++ b/mps/code/zmess.c @@ -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 . + * Copyright (c) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * From edd6409964760a7405155e37c281f4945296c7b4 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 24 Mar 2014 12:12:24 +0000 Subject: [PATCH 8/9] Don't list the test cases to be run in commpre.nmk: list them instead in testrun.bat for consistency with other platforms. Format lists of files and test cases with one per line so that merges are easier. Improve testrun.bat: better success/failure output; fewer gotos. Copied from Perforce Change: 184971 ServerID: perforce.ravenbrook.com --- mps/code/commpost.nmk | 8 +-- mps/code/commpre.nmk | 112 +++++++++++++++++++++++++++++++++--------- mps/tool/testrun.bat | 88 ++++++++++++++++++++++++++------- 3 files changed, 160 insertions(+), 48 deletions(-) diff --git a/mps/code/commpost.nmk b/mps/code/commpost.nmk index 808307b3b54..021e37b89e4 100644 --- a/mps/code/commpost.nmk +++ b/mps/code/commpost.nmk @@ -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 diff --git a/mps/code/commpre.nmk b/mps/code/commpre.nmk index 11273ed3966..ec1685a8630 100644 --- a/mps/code/commpre.nmk +++ b/mps/code/commpre.nmk @@ -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 = \ - \ - \ - \ - \ - \ - +MPMCOMMON=\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
\ + \ + \ + \ + \ + \ + \ + PLINTH = AMC = AMS = diff --git a/mps/tool/testrun.bat b/mps/tool/testrun.bat index a6fad0fa334..8bd44952bcd 100755 --- a/mps/tool/testrun.bat +++ b/mps/tool/testrun.bat @@ -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 From a9fbb4853318cdb020b8f6ad8ec97ded52aabeaa Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 24 Mar 2014 12:13:20 +0000 Subject: [PATCH 9/9] Replace hex constant 9024eac8 (gotneach) with 4026eac8 (notreach). Copied from Perforce Change: 184972 ServerID: perforce.ravenbrook.com --- mps/code/event.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mps/code/event.c b/mps/code/event.c index 8198319f26b..05e307cfc12 100644 --- a/mps/code/event.c +++ b/mps/code/event.c @@ -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 * @@ -468,7 +468,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; } @@ -477,7 +477,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; } @@ -517,7 +517,7 @@ extern void EventDump(mps_lib_FILE *stream) /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2013 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. *