mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-22 07:44:45 -08:00
Test building & generation fixed with altest scripts
This commit is contained in:
parent
2f7836b191
commit
05fa62eced
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@ -10,7 +10,7 @@
|
|||||||
"name": "Debug gentime lldb",
|
"name": "Debug gentime lldb",
|
||||||
"program": "${workspaceFolder}/test/test.exe",
|
"program": "${workspaceFolder}/test/test.exe",
|
||||||
"args": [],
|
"args": [],
|
||||||
"cwd": "${workspaceFolder}/test/gen/",
|
"cwd": "${workspaceFolder}/test/",
|
||||||
"postRunCommands": [
|
"postRunCommands": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -20,7 +20,7 @@
|
|||||||
"name": "Debug gentime vsdbg",
|
"name": "Debug gentime vsdbg",
|
||||||
"program": "${workspaceFolder}/test/build/test.exe",
|
"program": "${workspaceFolder}/test/build/test.exe",
|
||||||
"args": [],
|
"args": [],
|
||||||
"cwd": "${workspaceFolder}/test/gen/",
|
"cwd": "${workspaceFolder}/test/",
|
||||||
"visualizerFile": "${workspaceFolder}/scripts/gencpp.natvis"
|
"visualizerFile": "${workspaceFolder}/scripts/gencpp.natvis"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ struct String
|
|||||||
header->Capacity = capacity;
|
header->Capacity = capacity;
|
||||||
header->Length = 0;
|
header->Length = 0;
|
||||||
|
|
||||||
String result = { (char*)allocation + header_size };
|
String result = { rcast(char*, allocation) + header_size };
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,7 +298,6 @@ if ( $vendor -match "msvc" )
|
|||||||
#endregion Configuration
|
#endregion Configuration
|
||||||
|
|
||||||
#region Building
|
#region Building
|
||||||
|
|
||||||
$path_build = Join-Path $path_root build
|
$path_build = Join-Path $path_root build
|
||||||
$path_project = Join-Path $path_root project
|
$path_project = Join-Path $path_root project
|
||||||
$path_scripts = Join-Path $path_root scripts
|
$path_scripts = Join-Path $path_root scripts
|
||||||
@ -348,14 +347,14 @@ if ( $singleheader )
|
|||||||
New-Item -ItemType Directory -Path $path_gen
|
New-Item -ItemType Directory -Path $path_gen
|
||||||
}
|
}
|
||||||
|
|
||||||
$includes = @($path_project)
|
$includes = @( $path_project )
|
||||||
$unit = join-path $path_singleheader "singleheader.cpp"
|
$unit = join-path $path_singleheader "singleheader.cpp"
|
||||||
$executable = join-path $path_build "singleheader.exe"
|
$executable = join-path $path_build "singleheader.exe"
|
||||||
|
|
||||||
build-simple $includes $unit $executable
|
build-simple $includes $unit $executable
|
||||||
|
|
||||||
Push-Location $path_singleheader
|
Push-Location $path_singleheader
|
||||||
if ( Test-Path($executable) ) {
|
if ( Test-Path( $executable ) ) {
|
||||||
write-host "`nRunning singleheader generator"
|
write-host "`nRunning singleheader generator"
|
||||||
$time_taken = Measure-Command { & $executable
|
$time_taken = Measure-Command { & $executable
|
||||||
| ForEach-Object {
|
| ForEach-Object {
|
||||||
@ -385,13 +384,11 @@ if ( $test )
|
|||||||
|
|
||||||
$path_bootstrap = join-path $path_project gen
|
$path_bootstrap = join-path $path_project gen
|
||||||
|
|
||||||
$include = $path_bootstrap
|
$includes = @( $path_bootstrap )
|
||||||
$unit = join-path $path_test "test.cpp"
|
$unit = join-path $path_test "test.cpp"
|
||||||
$object = join-path $path_build "test.obj"
|
|
||||||
$executable = join-path $path_build "test.exe"
|
$executable = join-path $path_build "test.exe"
|
||||||
$pdb = join-path $path_build "test.pdb"
|
|
||||||
|
|
||||||
build-simple $include $unit $executable
|
build-simple $includes $unit $executable
|
||||||
|
|
||||||
Push-Location $path_test
|
Push-Location $path_test
|
||||||
if ( Test-Path( $executable ) ) {
|
if ( Test-Path( $executable ) ) {
|
||||||
@ -408,7 +405,6 @@ if ( $test )
|
|||||||
#endregion Building
|
#endregion Building
|
||||||
|
|
||||||
#region Formatting
|
#region Formatting
|
||||||
|
|
||||||
function format-cpp
|
function format-cpp
|
||||||
{
|
{
|
||||||
param( $path, $include, $exclude )
|
param( $path, $include, $exclude )
|
||||||
@ -457,7 +453,12 @@ if ( $singleheader -and (Test-Path (Join-Path $path_singleheader "gen/gen.hpp"))
|
|||||||
|
|
||||||
if ( $test )
|
if ( $test )
|
||||||
{
|
{
|
||||||
|
$path_gen = join-path $path_test gen
|
||||||
|
$include = @(
|
||||||
|
'*.gen.hpp'
|
||||||
|
)
|
||||||
|
$exclude = $null
|
||||||
|
format-cpp $path_gen $include $exclude
|
||||||
}
|
}
|
||||||
#endregion Formatting
|
#endregion Formatting
|
||||||
|
|
||||||
|
@ -63,8 +63,7 @@ void check_sanity()
|
|||||||
log_fmt("Num String Cache Arenas : %llu TotalSize: %llu !\n", StringArenas.num(), StringArenas.num() * SizePer_StringArena);
|
log_fmt("Num String Cache Arenas : %llu TotalSize: %llu !\n", StringArenas.num(), StringArenas.num() * SizePer_StringArena);
|
||||||
log_fmt("Num String Cache : %llu\n", StringCache.Entries.num(), StringCache);
|
log_fmt("Num String Cache : %llu\n", StringCache.Entries.num(), StringCache);
|
||||||
|
|
||||||
Builder builder;
|
Builder builder = Builder::open( "./gen/sanity.gen.hpp" );
|
||||||
builder.open( "gen/sanity.gen.hpp" );
|
|
||||||
|
|
||||||
idx = typedefs.num();
|
idx = typedefs.num();
|
||||||
#ifdef GEN_BENCHMARK
|
#ifdef GEN_BENCHMARK
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#if GEN_TIME
|
||||||
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
||||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||||
#define GEN_EXPOSE_BACKEND
|
#define GEN_EXPOSE_BACKEND
|
||||||
@ -8,13 +9,12 @@
|
|||||||
#include "SOA.cpp"
|
#include "SOA.cpp"
|
||||||
#include "test.singleheader_ast.cpp"
|
#include "test.singleheader_ast.cpp"
|
||||||
|
|
||||||
#if GEN_TIME
|
|
||||||
int gen_main()
|
int gen_main()
|
||||||
{
|
{
|
||||||
using namespace gen;
|
using namespace gen;
|
||||||
log_fmt("\ngen_time:");
|
log_fmt("\ngen_time:");
|
||||||
|
|
||||||
check_sanity();
|
// check_sanity();
|
||||||
|
|
||||||
// check_SOA();
|
// check_SOA();
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ using namespace gen;
|
|||||||
|
|
||||||
void check_singleheader_ast()
|
void check_singleheader_ast()
|
||||||
{
|
{
|
||||||
#define project_dir "../../"
|
#define project_dir "../"
|
||||||
gen::init();
|
gen::init();
|
||||||
log_fmt("\ncheck_singleheader_ast:\n");
|
log_fmt("\ncheck_singleheader_ast:\n");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user