{
printf(
"%s:%c:piglet:(%s::%s):%d: %s\n",
- t.chunk.filename.c_str(), get_result_short(t.result),
+ t.chunk->filename.c_str(), get_result_short(t.result),
t.type.c_str(), t.name.c_str(), i, get_result_long(t.result)
);
}
{
printf(
"%d) \x1b[34m%s::%s\x1b[0m: %s\n",
- i, t.type.c_str(), t.name.c_str(), t.chunk.filename.c_str()
+ i, t.type.c_str(), t.name.c_str(), t.chunk->filename.c_str()
);
},
[](const Test& t, unsigned) -> void
{
printf(
"[%u] - %s::%s - %s\n",
- i, t.type.c_str(), t.name.c_str(), t.chunk.filename.c_str()
+ i, t.type.c_str(), t.name.c_str(), t.chunk->filename.c_str()
);
},
static bool setup_globals(lua_State* L, Test& t)
{
// Add script_dir env var
- Lua::set_script_dir(L, SCRIPT_DIR_VARNAME, t.chunk.filename);
+ Lua::set_script_dir(L, SCRIPT_DIR_VARNAME, t.chunk->filename);
return false;
}
return true;
}
- if ( load_chunk(L, t.chunk) )
+ if ( load_chunk(L, *t.chunk) )
{
t.set_error("couldn't load test chunk");
t.set_error(lua_tostring(L, -1));
}
auto p = Manager::instantiate(
- state, t.chunk.target, t.type, t.name, t.use_defaults);
+ state, t.chunk->target, t.type, t.name, t.use_defaults);
// FIXIT-L: This injection is a hack so we can log the test header
// with all the parsed information filled in
ERROR
};
- const Chunk& chunk;
+ const Chunk* chunk;
Timer timer;
Result result = NA;
messages.push_back(s);
}
- Test(const Chunk& ch) : chunk { ch } { }
+ Test(const Chunk& ch) : chunk { &ch } { }
};
} // namespace Piglet