gencpp/test/NonParsed/Sanity.hpp
Ed_ 0192cd49ef Started sanity test suite (Non-parsed api)
Made some fixes based on errors found while iterating on first generation
2023-06-28 14:43:21 -04:00

48 lines
753 B
C++

#ifdef gen_time
#include "gen.hpp"
using namespace gen;
u32 gen_sanity()
{
Builder
gen_sanity_file;
gen_sanity_file.open("./sanity.gen.hpp");
// Comment
{
Code comment_test = def_comment( StrC::from("Sanity check: def_omment test") );
gen_sanity_file.print(comment_test);
gen_sanity_file.print_fmt("\n");
}
// Class
{
Code fwd = def_class( StrC::from("Test_EmptyClass") );
Code empty_body;
{
Code cmt = def_comment( StrC::from("Empty class") );
Code body = def_class_body( 1, cmt );
empty_body = def_class( StrC::from("Test_EmptyClass"), body );
}
gen_sanity_file.print(fwd);
gen_sanity_file.print(empty_body);
}
gen_sanity_file.print_fmt("\n");
//
{
}
gen_sanity_file.write();
return 0;
}
#endif