One approach is to first generate list which contains only variations, and then append desired number of other elements, in post_generate.
<'
struct mys_s {
a: int [0..3];
b: int [10, 11];
};
extend sys {
mys_l: list of mys_s;
keep mys_l.is_all_iterations(.a,.b);
!rand_struct: mys_s;
upper_limit: uint;
keep upper_limit == 20;
old_size: uint;
keep old_size in [read_only(mys_l.size())];
new_size: uint;
keep new_size >= read_only(old_size);
keep new_size < upper_limit;
post_generate() is {
for i from 1 to new_size-old_size {
gen rand_struct;
mys_l.add(rand_struct);
};
};
run() is also {
print mys_l;
};
};
'>
Afer this code, your list will have all variations you wanted, but also arbitrary number of other structures, defined by the "upper_limit".
Output for random seed:
Starting the test ...
Running the test ...
mys_l =
item type a b
---------------------------------------------------------------------------
0. mys_s 0 10
1. mys_s 0 11
2. mys_s 1 10
3. mys_s 1 11
4. mys_s 2 10
5. mys_s 2 11
6. mys_s 3 10
7. mys_s 3 11
8. mys_s 3 11
9. mys_s 3 10
10. mys_s 1 11
11. mys_s 1 11
12. mys_s 3 10
13. mys_s 2 11
14. mys_s 0 10
15. mys_s 2 11
16. mys_s 2 11
17. mys_s 2 11
Note that the first 10 elements (0-9) contain variations, and remaining list elements are random sturctures.