diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index eb387ce0ad..6effe5c2bc 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -27,6 +27,8 @@ jobs: run: make - name: make test run: make test + - name: make testmmqa + run: make testmmqa build-windows: @@ -39,5 +41,5 @@ jobs: run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 cd code - nmake /f w3i6mv.nmk + nmake /f w3i6mv.nmk testci testansi testpollnone testmmqa shell: cmd diff --git a/Makefile.in b/Makefile.in index a1e8759406..ddf1cbc02e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -85,6 +85,16 @@ test-xcode-build: test: @TEST_TARGET@ +# [Running the MMQA test suite seems to have the side effects of +# cleaning, so I'm keeping it separate rather than just appending +# "mmqa" to the normal make, for now. RB 2023-01-14] + +testmmqa-make-build: + $(MAKE) $(TARGET_OPTS) testmmqa + +# [How can we run MMQA with Xcode? RB 2023-01-14] + +testmmqa: testmmqa-make-build # C. COPYRIGHT AND LICENSE # diff --git a/test/function/104.c b/test/function/104.c index 392dc6c31b..1931446759 100644 --- a/test/function/104.c +++ b/test/function/104.c @@ -120,7 +120,7 @@ static mps_res_t area_scan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit, void { mycell *obj = base; mps_res_t res; - mps_addr_t p, q; + mps_addr_t p; switch (obj->tag & 0x3) { diff --git a/test/function/136.c b/test/function/136.c index 5ad00dcbf4..a326797ed9 100644 --- a/test/function/136.c +++ b/test/function/136.c @@ -6,7 +6,7 @@ TEST_HEADER link = testlib.o OUTPUT_SPEC assert = true - limit < 160000 + limit_grains < 40 END_HEADER */ @@ -155,22 +155,36 @@ static void test(void *stack_pointer) { mps_thr_t thread; int symm; - size_t grainSize = 4096; + size_t grainSize, smallSize = 8; size_t comlimit; mps_bool_t slotHigh, arenaHigh, firstFit; + mps_pool_t pool; + mps_addr_t addr; MPS_ARGS_BEGIN(args) { MPS_ARGS_ADD(args, MPS_KEY_ARENA_SIZE, 1024*1024*50); - MPS_ARGS_ADD(args, MPS_KEY_ARENA_GRAIN_SIZE, grainSize); cdie(mps_arena_create_k(&arena, mps_arena_class_vm(), args), "create arena"); } MPS_ARGS_END(args); + /* Deduce arena grain size by creating an MVFF pool, allocating a + * small object, and querying the total size. */ + MPS_ARGS_BEGIN(args) { + MPS_ARGS_ADD(args, MPS_KEY_EXTEND_BY, smallSize); + MPS_ARGS_ADD(args, MPS_KEY_MEAN_SIZE, smallSize); + die(mps_pool_create_k(&pool, arena, mps_class_mvff(), args), + "create MVFF pool"); + } MPS_ARGS_END(args); + die(mps_alloc(&addr, pool, smallSize), "allocate small object"); + grainSize = mps_pool_total_size(pool); + mps_free(pool, addr, smallSize); + mps_pool_destroy(pool); + cdie(mps_thread_reg(&thread, arena), "register thread"); for (comlimit = 128 * grainSize; comlimit > 0; comlimit -= grainSize) { mps_arena_commit_limit_set(arena, comlimit); - report("limit", "%d", comlimit); + report("limit_grains", "%d", comlimit / grainSize); symm = ranint(8); slotHigh = (symm >> 2) & 1; arenaHigh = (symm >> 1) & 1; diff --git a/test/function/97.c b/test/function/97.c index c6f0ff24b8..25c1a4f9ac 100644 --- a/test/function/97.c +++ b/test/function/97.c @@ -118,7 +118,7 @@ static mps_res_t area_scan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit, void { mycell *obj = base; mps_res_t res; - mps_addr_t p, q; + mps_addr_t p; switch (obj->tag & 0x3) { diff --git a/test/test/testlib/myfmt.c b/test/test/testlib/myfmt.c index 385d01fa3c..0e05a15b60 100644 --- a/test/test/testlib/myfmt.c +++ b/test/test/testlib/myfmt.c @@ -47,7 +47,7 @@ struct mps_fmt_A_s fmtA = &mypad }; -void fmtargs(mps_arg_s args[MPS_ARGS_MAX]) +void fmtargs(mps_arg_s args[FMTARGS_ARGS_MAX]) { args[0].key = MPS_KEY_ALIGN; args[0].val.align = MPS_PF_ALIGN; @@ -62,6 +62,8 @@ void fmtargs(mps_arg_s args[MPS_ARGS_MAX]) args[5].key = MPS_KEY_FMT_PAD; args[5].val.fmt_pad = mypad; args[6].key = MPS_KEY_ARGS_END; + /* FIXME: Is asserts appropriate here? RB 2023-01-17 */ + asserts(FMTARGS_ARGS_MAX > 6, "not enough room for format arguments"); } mycell *allocheader(mps_ap_t ap, mps_word_t data, diff --git a/test/test/testlib/myfmt.h b/test/test/testlib/myfmt.h index 87db53e4e5..72c92795c9 100644 --- a/test/test/testlib/myfmt.h +++ b/test/test/testlib/myfmt.h @@ -45,6 +45,7 @@ mycell *allocone(mps_ap_t ap, mps_word_t data, mycell *allocheader(mps_ap_t ap, mps_word_t data, mycell *ref0, mycell *ref1, size_t size, size_t header); -void fmtargs(mps_arg_s args[MPS_ARGS_MAX]); +#define FMTARGS_ARGS_MAX 7 +void fmtargs(mps_arg_s args[FMTARGS_ARGS_MAX]); #endif