annotate test/callback_suite/make-signatures.lua @ 517:f8856e29b512

- tests: made "ordered" signature generation code shareable, and added possibility to specify return types, separately (mainly to include 'void')
author Tassilo Philipp
date Mon, 11 Apr 2022 14:50:35 +0200
parents 1a813b706de4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 require "config"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 require "math"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 require "string"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5
495
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
6 function randomSignatures()
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
7 package.path = '../common/?.lua;' .. package.path
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
8 require"rand-sig"
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9 end
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10
495
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
11
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
12 function orderedSignatures()
517
f8856e29b512 - tests: made "ordered" signature generation code shareable, and added possibility to specify return types, separately (mainly to include 'void')
Tassilo Philipp
parents: 516
diff changeset
13 package.path = '../common/?.lua;' .. package.path
f8856e29b512 - tests: made "ordered" signature generation code shareable, and added possibility to specify return types, separately (mainly to include 'void')
Tassilo Philipp
parents: 516
diff changeset
14 require"ordered-sig"
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15 end
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16
495
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
17
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 function designedSignatures()
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 for line in io.lines(designfile) do
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 io.write( line )
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 io.write( "\n" )
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 end
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23 end
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24
495
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
25
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26 if mode == "random" then
495
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
27 randomSignatures()
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28 elseif mode == "ordered" then
495
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
29 orderedSignatures()
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 elseif mode == "designed" then
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 designedSignatures()
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32 else
495
45ac093ca822 - test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents: 0
diff changeset
33 error("'mode' must be 'random', 'ordered' or 'designed'")
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 end
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 io.flush()
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37