@@ -18,9 +18,9 @@ configure_file(
18
18
input : ' constants.h.in' ,
19
19
output : ' constants.h' ,
20
20
configuration : {
21
- ' table' : meson .project_source_root() / ' src ' / ' 04-table.lua' ,
22
- ' metatable' : meson .project_source_root() / ' src ' / ' 05-metatable.lua' ,
23
- ' hooks' : meson .project_source_root() / ' src ' / ' 11-hooks.lua'
21
+ ' table' : meson .current_source_dir() / ' 04-table.lua' ,
22
+ ' metatable' : meson .current_source_dir() / ' 05-metatable.lua' ,
23
+ ' hooks' : meson .current_source_dir() / ' 11-hooks.lua'
24
24
}
25
25
)
26
26
# ==== Example 01: hello world ==== #
@@ -109,22 +109,26 @@ addfn_lua = configure_file(
109
109
# ==== Example 11: hooks ==== #
110
110
hooks_exe = executable (' 11-hooks' , ' 11-hooks.c' , dependencies : lua51_dep)
111
111
112
+ # ==== Example 12: multiple states ==== #
113
+ multi_state_exe = executable (' 12-multi-state' , ' 12-multi-state.c' , dependencies : lua51_dep)
114
+
112
115
if tests
113
116
test (' 01 hello world' , hello_world_exe)
114
117
# This example is expected to fail
115
118
test (' 02 global function' , lua51_bin, args : [ gfunc_lua ], should_fail : true )
116
119
# Setting the 'LUA_CPATH' env prevents the test to fail. This is 'cuz Lua will not find the .so file otherwise if you
117
120
# run `meson test` from other directory
118
- test (' 03 basic library' , lua51_bin, args : [ basic_lib_lua ], env : { ' LUA_CPATH' : meson .build_root() / ' src ' / ' ?.so' })
121
+ test (' 03 basic library' , lua51_bin, args : [ basic_lib_lua ], env : { ' LUA_CPATH' : meson .current_build_dir() / ' ?.so' })
119
122
test (' 04 table' , table_exe)
120
123
test (' 05 metatable' , metatable_exe)
121
- test (' 06 userdata' , lua51_bin, args : [ userdata_lua ], env : { ' LUA_CPATH' : meson .build_root() / ' src ' / ' ?.so' })
124
+ test (' 06 userdata' , lua51_bin, args : [ userdata_lua ], env : { ' LUA_CPATH' : meson .current_build_dir() / ' ?.so' })
122
125
test (' 07 stack dump' , stack_dump_exe)
123
126
test (' 08 versions (5.1)' , versions_51_exe)
124
127
test (' 08 versions (5.2)' , versions_52_exe)
125
128
test (' 08 versions (5.3)' , versions_53_exe)
126
129
test (' 08 versions (5.4)' , versions_54_exe)
127
- test (' 09 newlib (5.2+)' , lua52_bin, args : [ newlib_lua ], env : { ' LUA_CPATH' : meson .build_root() / ' src ' / ' ?.so' })
128
- test (' 10 functions' , lua51_bin, args : [ addfn_lua ], env : { ' LUA_CPATH' : meson .build_root() / ' src ' / ' ?.so' })
130
+ test (' 09 newlib (5.2+)' , lua52_bin, args : [ newlib_lua ], env : { ' LUA_CPATH' : meson .current_build_dir() / ' ?.so' })
131
+ test (' 10 functions' , lua51_bin, args : [ addfn_lua ], env : { ' LUA_CPATH' : meson .current_build_dir() / ' ?.so' })
129
132
test (' 11 hooks' , hooks_exe)
130
- endif
133
+ test (' 12 multi state' , multi_state_exe)
134
+ endif
0 commit comments