Add integration test parsing the standard library
This commit is contained in:
parent
e355e7a653
commit
bcf65703d7
3 changed files with 146 additions and 22 deletions
|
|
@ -23,13 +23,11 @@ inline void write_file(const char* name, const char* code)
|
|||
file << code;
|
||||
}
|
||||
|
||||
inline std::unique_ptr<cppast::cpp_file> parse(const cppast::cpp_entity_index& idx,
|
||||
const char* name, const char* code)
|
||||
inline std::unique_ptr<cppast::cpp_file> parse_file(const cppast::cpp_entity_index& idx,
|
||||
const char* name)
|
||||
{
|
||||
using namespace cppast;
|
||||
|
||||
write_file(name, code);
|
||||
|
||||
libclang_compile_config config;
|
||||
config.set_flags(cpp_standard::cpp_latest);
|
||||
|
||||
|
|
@ -42,6 +40,13 @@ inline std::unique_ptr<cppast::cpp_file> parse(const cppast::cpp_entity_index& i
|
|||
return result;
|
||||
}
|
||||
|
||||
inline std::unique_ptr<cppast::cpp_file> parse(const cppast::cpp_entity_index& idx,
|
||||
const char* name, const char* code)
|
||||
{
|
||||
write_file(name, code);
|
||||
return parse_file(idx, name);
|
||||
}
|
||||
|
||||
class test_generator : public cppast::code_generator
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue