- # Initialize test variables
- #
- # Must be called before test execution.
- # FIXME should be before_all
- fun build_test_env is before do
- var test_path = "NIT_TESTING_PATH".environ.dirname
- var test_src = test_path / "../../../tests/test_prog"
-
- # build model
- var toolcontext = new ToolContext
- var model = new Model
- var modelbuilder = new ModelBuilder(model, toolcontext)
- var mmodules = modelbuilder.parse_full([test_src])
- modelbuilder.run_phases
- toolcontext.run_global_phases(mmodules)
-
- # create index
- var index = new CodeIndex(toolcontext)
- for mmodule in mmodules do
- index.index_mentity(mmodule)
+ redef fun build_test_env do
+ super
+ for mmodule in test_model.mmodules do
+ test_index.index_mentity(mmodule)