1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-22 23:04:12 -07:00

Improve the usability of the test suite:

1. "make test" now reports the name of the test case before running it, so that when you look back through the test output you can see which test case failed.
2. "make test" now collects the standard output from all the tests to a log file in /tmp, so that this does not clutter the user's terminal, and so that nothing is lost if the output exceeds the terminal's scrollback.
3. Each test case now prints a success message ("Conclusion: Failed to find any defects.") to standard output (not standard error) so that these messages do not clutter up the terminal when running "make test".
4. Each test case now uses its result code (not the printed message) to indicate whether it succeeded or failed.
5. More of the diagnostic messages from the test cases now start by printing argv[0] so that it is easier to tell which test case was running.

Copied from Perforce
 Change: 181071
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2013-03-07 13:13:32 +00:00
parent 61290172be
commit 296ac3bccf
39 changed files with 165 additions and 195 deletions

View file

@ -1,7 +1,7 @@
/* abqtest.c: AVAILABLE BLOCK QUEUE TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include "abq.h"
@ -149,7 +149,6 @@ static void step(void)
extern int main(int argc, char *argv[])
{
Res res;
mps_arena_t arena;
int i;
@ -160,26 +159,23 @@ extern int main(int argc, char *argv[])
die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
"mps_arena_create");
res = ABQInit((Arena)arena, &abq, NULL, ABQ_SIZE);
if (res == ResOK) {
abqSize = ABQ_SIZE;
} else {
printf("ABQCreate returned %d\n",res);
return 1;
}
die(ABQInit((Arena)arena, &abq, NULL, ABQ_SIZE),
"ABQInit");
abqSize = ABQ_SIZE;
for (i = 0; i < TEST_ITER; i++) {
step();
}
printf("All tests passed.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -315,7 +315,7 @@ static void test(mps_arena_t arena)
mps_fmt_destroy(format);
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -334,15 +334,14 @@ int main(int argc, char **argv)
report(arena);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*/
@ -249,7 +249,7 @@ static void *test(void *arg, size_t s)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -266,15 +266,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*
* .posix: This is Posix only.
@ -310,7 +310,7 @@ static void *fooey(void* childIsFinishedReturn)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_thr_t thread;
pthread_t pthread1;
@ -337,15 +337,14 @@ int main(int argc, char **argv)
report(arena);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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-2002, 2006 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 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
@ -198,7 +198,7 @@ static void *test(void *arg, size_t haveAmbigous)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_thr_t thread;
mps_fmt_t format;
@ -247,15 +247,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002, 2006 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*
* .design: Adapted from amsss.c.
*/
@ -155,7 +155,7 @@ static void *test(void *arg, size_t s)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -170,15 +170,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -171,7 +171,7 @@ static void testInArena(mps_arena_t arena, mps_pool_debug_option_s *options)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_pool_debug_option_s *bothOptions;
@ -191,15 +191,14 @@ int main(int argc, char **argv)
testInArena(arena, bothOptions);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 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).
@ -402,7 +402,7 @@ static void testSize(Size size)
#define TEST_ARENA_SIZE ((Size)16<<22)
int main(void)
int main(int argc, char *argv[])
{
void *block;
@ -416,15 +416,14 @@ int main(void)
testSize(TEST_ARENA_SIZE);
fflush(stdout); /* synchronize */
fprintf(stderr, "Conclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*
* DESIGN
*
@ -294,7 +294,7 @@ static void *setup(void *v, size_t s)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
struct guff_s guff;
mps_arena_t arena;
@ -316,15 +316,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*
* DESIGN
*
@ -297,7 +297,7 @@ static void *setup(void *v, size_t s)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
struct guff_s guff;
mps_arena_t arena;
@ -319,15 +319,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*
* DESIGN
*
@ -309,7 +309,7 @@ static void *setup_thr(void *v)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
pthread_t pthread1;
@ -327,15 +327,14 @@ int main(int argc, char **argv)
pthread_join(pthread1, NULL);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*
* .readership: MPS developers
*
@ -564,14 +564,14 @@ int main(int argc, char *argv[])
btTests(btlo, bthi, btSize);
printf("\nNo problems detected.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 @@
/* cbstest.c: COALESCING BLOCK STRUCTURE TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include "cbs.h"
@ -649,14 +649,14 @@ extern int main(int argc, char *argv[])
printf("Number of deleted large blocks: %ld\n", NDeleteBlocks);
printf("Number of grown large blocks: %ld\n", NGrowBlocks);
printf("Number of shrunk large blocks: %ld\n", NShrinkBlocks);
printf("\nNo problems detected.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -232,10 +232,17 @@ all: mpmss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
# mv2test cannot be run because MV2 is broken
# %%TARGET: When adding a new target, if target is suitable for the
# overnight tests, then add it here.
testrun: mpmss apss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
mpsicv lockcov poolncv locv qs finalcv finaltest arenacv \
abqtest cbstest btcv messtest steptest walkt0
$(^:%=date && $(PFM)/$(VARIETY)/% &&) true
TESTCASES=abqtest amcss amcsshe amsss amssshe apss arenacv awlut \
awluthe btcv cbstest finalcv finaltest lockcov locv \
messtest mpmss mpsicv poolncv qs sacss segsmss steptest \
walkt0
testrun: $(TESTCASES)
OUTPUT=$$(mktemp /tmp/mps-XXXXXX.log); \
echo "Logging test output to $$OUTPUT"; \
$(^:%=(TESTCASE=$(PFM)/$(VARIETY)/%; \
echo "\n\n-- Running $$TESTCASE at $$(date) --" >> $$OUTPUT && \
echo "Running $$TESTCASE" && \
$$TESTCASE >> $$OUTPUT) &&) true
# These convenience targets allow one to type "make foo" to build target
# foo in selected varieties (or none, for the latter rule).

View file

@ -134,7 +134,7 @@ static void evlog(unsigned int level, const char *format, ...)
static void error(const char *format, ...)
{
va_list args;
fprintf(stderr, "Fatal error: ");
fprintf(stderr, "Fatal error: ");
va_start(args, format);
vlog(LOG_ALWAYS, format, args);
va_end(args);
@ -964,7 +964,7 @@ int main(int argc, char *argv[])
/* COPYRIGHT AND LICENSE
*
* Copyright (C) 2012 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2012-2013 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,2003 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 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
@ -248,7 +248,7 @@ static void *test(void *arg, size_t s)
return NULL;
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -266,15 +266,14 @@ int main(int argc, char **argv)
report(arena);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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,2003 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* DESIGN
@ -254,7 +254,7 @@ static void *test(void *arg, size_t s)
}
int main(void)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -267,14 +267,14 @@ int main(void)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2003 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* DESIGN
@ -210,7 +210,7 @@ static void *test(void *arg, size_t s)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -225,15 +225,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* DESIGN
@ -239,7 +239,7 @@ static void *test(void *arg, size_t s)
}
int main(void)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -252,14 +252,14 @@ int main(void)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -19,17 +19,15 @@
void libcbt_assert_fail(const char *);
mps_clock_t libcbt_clock(void);
int main(void)
int main(int argc, char *argv[])
{
int res;
int defects = 0;
mps_arena_t arena;
res = mps_lib_callback_register("not a callback", (void(*)(void))0);
if(MPS_RES_OK == res) {
printf("mps_lib_callback_register claims to successfully register\n"
"an interface that does not exist.\n");
++ defects;
error("mps_lib_callback_register claims to successfully register\n"
"an interface that does not exist.\n");
}
die(mps_lib_callback_register("mps_lib_assert_fail",
(void(*)(void))libcbt_assert_fail),
@ -44,11 +42,8 @@ int main(void)
"register clock");
die(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1000*1000),
"mps_arena_create");
if(defects) {
printf("Conclusion: Defects detected.\n");
} else {
printf("Conclusion: Failed to find any defects.\n");
}
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
@ -71,7 +66,7 @@ mps_clock_t libcbt_clock(void)
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2005 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2005-2013 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 @@
/* locbwcss.c: LOCUS BACKWARDS COMPATIBILITY STRESS TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include "mpscmvff.h"
@ -176,9 +176,9 @@ static void testInArena(mps_arena_t arena)
reportResults(histat, "the high MVFF pool");
if (lostat->max > histat->min) {
printf("\nFOUND PROBLEM - low range overlaps high\n");
error("\nFOUND PROBLEM - low range overlaps high\n");
} else if (lostat->ncCount != 0 || histat->ncCount != 0) {
printf("\nFOUND POSSIBLE PROBLEM - some non-contiguous allocations\n");
error("\nFOUND POSSIBLE PROBLEM - some non-contiguous allocations\n");
} else {
printf("\nNo problems detected.\n");
}
@ -188,7 +188,7 @@ static void testInArena(mps_arena_t arena)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
@ -201,13 +201,14 @@ int main(int argc, char **argv)
mps_arena_destroy(arena);
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 @@
/* lockcov.c: LOCK COVERAGE TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include "mpm.h"
@ -9,7 +9,7 @@
#include <stdlib.h> /* for malloc & free */
int main(void)
int main(int argc, char *argv[])
{
Lock a = malloc(LockSize());
Lock b = malloc(LockSize());
@ -44,15 +44,14 @@ int main(void)
free(a);
free(b);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include "mpm.h"
@ -64,7 +64,7 @@ DWORD WINAPI thread0(void *p)
}
int main(void)
int main(int argc, char *argv[])
{
DWORD id;
HANDLE t[10];
@ -87,15 +87,14 @@ int main(void)
LockFinish(lock);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 @@
/* locusss.c: LOCUS STRESS TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include "mpscmvff.h"
@ -229,7 +229,7 @@ static void runArenaTest(size_t size,
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
randomize(argc, argv);
@ -249,7 +249,7 @@ int main(int argc, char **argv)
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 @@
/* locv.c: LEAF OBJECT POOL CLASS COVERAGE TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*
* This is (not much of) a coverage test for the Leaf Object
* pool (PoolClassLO).
@ -39,7 +39,7 @@ static mps_fmt_A_s locv_fmt =
static mps_addr_t roots[4];
int main(void)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_pool_t pool;
@ -92,8 +92,7 @@ int main(void)
mps_root_destroy(root);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
@ -168,7 +167,7 @@ static void stepper(mps_addr_t addr, mps_fmt_t fmt, mps_pool_t pool,
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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-2003 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include "mpm.h"
@ -268,14 +268,14 @@ extern int main(int argc, char *argv[])
testInterleaving(arena);
testDisabling(arena);
printf("\nNo problems detected.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2003 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -180,7 +180,7 @@ static int testInArena(mps_arena_t arena, mps_pool_debug_option_s *options)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_pool_debug_option_s *bothOptions;
@ -199,15 +199,14 @@ int main(int argc, char **argv)
testInArena(arena, &fenceOptions);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 @@
/* mpsicv.c: MPSI COVERAGE TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*/
@ -572,7 +572,7 @@ static void *test(void *arg, size_t s)
#define TEST_ARENA_SIZE ((size_t)16<<20)
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -598,15 +598,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002, 2008 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
*/
#include <stdio.h>
@ -315,18 +315,19 @@ static void stress_with_arena_class(mps_arena_class_t aclass)
}
int main(void)
int main(int argc, char *argv[])
{
stress_with_arena_class(mps_arena_class_vm());
stress_with_arena_class(mps_arena_class_vmnz());
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -10,9 +10,8 @@
#include "testlib.h"
static Bool testit(ArenaClass class, ...)
static void testit(ArenaClass class, ...)
{
Bool eflag = FALSE;
Arena arena;
Pool pool;
Res res;
@ -26,32 +25,25 @@ static Bool testit(ArenaClass class, ...)
die(PoolCreate(&pool, arena, PoolClassN()), "PoolNCreate");
res = PoolAlloc(&p, pool, 1, /* withReservoirPermit */ FALSE);
if (res == ResOK) {
fprintf(stderr,
"Error: Unexpectedly succeeded in"
"allocating block from PoolN\n");
eflag = TRUE;
error("Error: Unexpectedly succeeded in"
"allocating block from PoolN\n");
}
PoolDestroy(pool);
ArenaDestroy(arena);
return eflag;
}
int main(void)
int main(int argc, char *argv[])
{
if (testit((ArenaClass)mps_arena_class_vm(), (Size)600000)) {
fprintf(stderr, "Conclusion: Defects found.\n");
} else {
fprintf(stderr, "Conclusion: Failed to find any defects.\n");
}
testit((ArenaClass)mps_arena_class_vm(), (Size)600000);
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -510,7 +510,7 @@ static void copy(mps_addr_t object, mps_addr_t to)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
void *r;
@ -521,15 +521,14 @@ int main(int argc, char **argv)
mps_tramp(&r, &go, NULL, 0);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*/
@ -186,7 +186,7 @@ static int testInArena(mps_arena_t arena)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
@ -197,15 +197,14 @@ int main(int argc, char **argv)
testInArena(arena);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*
* .design: Adapted from amsss.c (because AMS already supports
@ -841,7 +841,7 @@ static void *test(void *arg, size_t s)
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -856,15 +856,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 1998-2013 Ravenbrook Limited. See end of file for license.
*
* Loosely based on <code/amcss.c>.
*/
@ -485,7 +485,7 @@ static void *test(void *arg, size_t s)
return NULL;
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
prepare_clock();
@ -507,15 +507,14 @@ int main(int argc, char **argv)
++ test_number;
}
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 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.
@ -252,7 +252,7 @@ mps_addr_t rnd_addr(void)
* (New from 2010-03-22, changelist 170093)
*/
void randomize(int argc, char **argv)
void randomize(int argc, char *argv[])
{
int i;
int n;
@ -262,7 +262,8 @@ void randomize(int argc, char **argv)
if (argc > 1) {
n = sscanf(argv[1], "%lu", &seed0);
Insist(n == 1);
printf("randomize(): resetting initial state (v3) to: %lu.\n", seed0);
printf("%s: randomize(): resetting initial state (v3) to: %lu.\n",
argv[0], seed0);
rnd_state_set(seed0);
} else {
/* time_t uses an arbitrary encoding, but hopefully the low order */
@ -288,7 +289,8 @@ void randomize(int argc, char **argv)
}
seed0 = rnd_state();
printf("randomize(): choosing initial state (v3): %lu.\n", seed0);
printf("%s: randomize(): choosing initial state (v3): %lu.\n",
argv[0], seed0);
rnd_state_set(seed0);
}
}
@ -386,7 +388,7 @@ void cdie(int res, const char *s)
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002, 2008 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 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.h: TEST LIBRARY INTERFACE
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2013 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.
@ -212,7 +212,7 @@ extern mps_addr_t rnd_addr(void);
* line argument) and initializes the generator to the same state.
*/
extern void randomize(int argc, char **argv);
extern void randomize(int argc, char *argv[]);
#endif /* testlib_h */

View file

@ -1,7 +1,7 @@
/* walkt0.c: WALK TEST 0
*
* $Id$
* Copyright (C) 1998,2003 Ravenbrook Limited. See end of file for license.
* Copyright (c) 1998-2013 Ravenbrook Limited. See end of file for license.
*
* Loosely based on <code/steptest.c>.
*/
@ -194,7 +194,7 @@ static void *test(void *arg, size_t s)
return NULL;
}
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
mps_arena_t arena;
mps_thr_t thread;
@ -210,15 +210,14 @@ int main(int argc, char **argv)
mps_thread_dereg(thread);
mps_arena_destroy(arena);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2003 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -835,7 +835,7 @@ static void testscriptA(const char *script)
/* main -- runs various test scripts
*
*/
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
randomize(argc, argv);
@ -929,15 +929,14 @@ int main(int argc, char **argv)
testscriptA("Arena(size 16777216), Katalog(), Collect.");
*/
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002, 2008 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -484,7 +484,7 @@ Bool TIMCA_remote(void)
/* main -- runs various test scripts
*
*/
int main(int argc, char **argv)
int main(int argc, char *argv[])
{
randomize(argc, argv);
@ -563,15 +563,14 @@ int main(int argc, char **argv)
TIMCA_setup(""); /* must reset it! */
}
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
printf("%s: Conclusion: Failed to find any defects.\n", argv[0]);
return 0;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002, 2008 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (c) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*