mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-05 05:05:43 -07:00
Started to setup for codebase validation tests.
Fleshed out initial version of AST::is_equal( AST* ) Setup the test directory with initial files for each major validation test.
This commit is contained in:
33
test/validate.singleheader.cpp
Normal file
33
test/validate.singleheader.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||
#define GEN_EXPOSE_BACKEND
|
||||
#define GEN_BENCHMARK
|
||||
#include "gen.hpp"
|
||||
#include "gen.builder.hpp"
|
||||
#include "gen.scanner.hpp"
|
||||
using namespace gen;
|
||||
|
||||
void check_singleheader_ast()
|
||||
{
|
||||
#define project_dir "../"
|
||||
gen::init();
|
||||
log_fmt("\ncheck_singleheader_ast:\n");
|
||||
|
||||
FileContents file = file_read_contents( GlobalAllocator, true, project_dir "singleheader/gen/gen.hpp" );
|
||||
u64 time_start = time_rel_ms();
|
||||
CodeBody ast = parse_global_body( { file.size, (char const*)file.data } );
|
||||
|
||||
log_fmt("\nAst generated. Time taken: %llu ms\n", time_rel_ms() - time_start);
|
||||
|
||||
log_fmt("\nSerializng ast:\n");
|
||||
time_start = time_rel_ms();
|
||||
|
||||
Builder
|
||||
builder = Builder::open( "gen/singleheader_copy.gen.hpp" );
|
||||
builder.print( ast );
|
||||
builder.write();
|
||||
|
||||
log_fmt("passed!! Time taken: %llu ms\n", time_rel_ms() - time_start);
|
||||
|
||||
gen::deinit();
|
||||
}
|
Reference in New Issue
Block a user