Mercurial > pub > dyncall > dyncall
annotate test/call_suite_aggrs/config.lua @ 519:99819b874bac
test/call_suite_aggrs:
- refactored generator code a bit to be simpler, write cleaner output, have better shareability and clarity
- added rtypes w/ default value nil to config.lua, to self document
- shared some code under test/common/
- fixed nonemptyaggrs sigs and cases.h (accidentally overwritten with cases having empty aggrs)
author | Tassilo Philipp |
---|---|
date | Mon, 11 Apr 2022 22:26:07 +0200 |
parents | c9c546f8598b |
children | a2de1d0a73f3 |
rev | line source |
---|---|
432
167faab0c0be
first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff
changeset
|
1 -- user config for rand-sig.lua: |
167faab0c0be
first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff
changeset
|
2 minargs = 0 |
434
3d2c5d156d78
- test/suite_aggrs: support for nested structs, now
Tassilo Philipp
parents:
432
diff
changeset
|
3 maxargs = 16 |
463
bd8f5da2c74b
suite_aggr: added configurable limits to number of struct fields (also simplified allowing (or not) empty ones)
Tassilo Philipp
parents:
462
diff
changeset
|
4 minaggrfields= 0 -- 0 allows for empty structs/unions |
bd8f5da2c74b
suite_aggr: added configurable limits to number of struct fields (also simplified allowing (or not) empty ones)
Tassilo Philipp
parents:
462
diff
changeset
|
5 maxaggrfields= 12 |
502 | 6 maxarraylen = 16 -- see *) |
462 | 7 arraydice = 40 -- how often to turn a member into an array (1 out of arraydice-times) |
432
167faab0c0be
first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff
changeset
|
8 maxaggrdepth = 3 -- max nesting depth of aggregates, 1 = no nesting |
494
d45c582b5457
- sharing sig generator between call_suite and call_suite_aggrs tests
Tassilo Philipp
parents:
492
diff
changeset
|
9 reqaggrinsig = true -- require that every generated signature has at least one aggregate |
453
c497b87552f6
- reducing number of default pregenerated cases for suite_aggrs, as some compilers run out of memory otherwise
Tassilo Philipp
parents:
446
diff
changeset
|
10 ncases = 400 |
519 | 11 types = "BcsijlCSIJLpfd{}<>" -- types to use; use '{','}' for structs, '<','>' for unions |
12 rtypes = nil -- supported return types (set to nil to use "v"..types) | |
434
3d2c5d156d78
- test/suite_aggrs: support for nested structs, now
Tassilo Philipp
parents:
432
diff
changeset
|
13 seed = 2112 |
432
167faab0c0be
first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff
changeset
|
14 |
502 | 15 -- *) note some callconvs pass structs via regs, so using big numbers here will |
16 -- reduce those cases; however special alignment rules are specified in some | |
17 -- ABIs for bigger arrays, which is also worth testing | |
18 | |
19 | |
20 | |
21 -- Notes: specify types more than once to increase relative occurance, e.g.: | |
432
167faab0c0be
first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff
changeset
|
22 |
461 | 23 -- this favors non-aggregate args, especially ints (and also increases avg num of aggregate fields): |
515 | 24 --types = "Bccssiiiiijjllpfd{}" |
432
167faab0c0be
first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff
changeset
|
25 |
461 | 26 -- this heavily favors nested structs, while not having any union: |
515 | 27 --types = "Bcsijlpfd{{{{{{}" |
432
167faab0c0be
first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff
changeset
|
28 |
461 | 29 -- this heavily favors flat and short/empty aggregates: |
515 | 30 --types = "Bcsijlpfd{}}}}}}<>>>>>" |
482
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
31 |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
32 |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
33 |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
34 -- user config for mk-cases.lua |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
35 |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
36 -- if true, aggregates are copied via = operator, otherwise field by field |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
37 aggrcpsimple = true |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
38 |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
39 -- if true, aggregate params are modified in called function, to test whether |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
40 -- they are passed "by value" (important for verifying by-value semantics for |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
41 -- callconvs where hidden pointers are used instead of real copies; aggregate |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
42 -- passing implementations must use of temporary copies in those cases) |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
43 aggrmutabletest = true |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
44 |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
45 -- force aggregate packing, 0=off, pos values set fixed packing, neg values |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
46 -- set a random power-of-2 packing per aggregate, within [1,abs(aggrpacking)] |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
47 aggrpacking = 0 |
0f3b6898078d
suite_aggrs (still ahead of checked in version of dyncall, sorry):
Tassilo Philipp
parents:
463
diff
changeset
|
48 |