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:
2023-08-22 16:01:50 -04:00
parent 49a2cd7b2c
commit 5e79e8ba65
35 changed files with 697 additions and 19 deletions

View File

@ -0,0 +1,13 @@
# Test : Eskil Steenberg's Game Pipeline
***Note: This validation test has not been implemented yet.***
Repo : https://github.com/valiet/quel_solaar
This is a AST reconstruction test of the gamepipeline library.
1. Download the library
2. Grab all header and source file paths
3. Generate an ast for each file and serialize it to a file called <name of file>.gen.<h/c>
4. Reconstruct the ast from the generated file
5. Compare the original ast to the reconstructed ast

View File

15
test/Godot/Readme.md Normal file
View File

@ -0,0 +1,15 @@
# Test : Godot full AST reconstruction and compile validation
***Note: This validation test has not been implemented yet.***
Repo : https://github.com/godotengine/godot
* Download the Unreal source code
* Find paths of every header and source file
* Generate an ast for each file and serialize it to a file called `<name of file>.gen.<h/c>`
* Reconstruct the ast from the generated file
* Compare the original ast to the reconstructed ast
* If all ASTs are considered valid, overwrite the original files with the generated files
* Compile the engine.
Currently the most involved test planned for the library.

View File

0
test/Godot/validate.ps1 Normal file
View File

25
test/Unreal/Readme.md Normal file
View File

@ -0,0 +1,25 @@
# Unreal Header & Source reconstruction tests
***Note: This validation test has not been implemented yet.***
Will test the following modules + plugins:
* Kismet
* Slate
* RTTI Bases
* Gameframework
* Actor & Component Bases
* Lyra
In the future I could attempt to do a similar test to that of the godot engine full compilation test.
For now it just does the following:
* Download the Unreal source code
* For each module
1. Grab all header and source file paths
2. Generate an ast for each file and serialize it to a file called `<name of file>.gen.<h/c>`
3. Reconstruct the ast from the generated file
4. Compare the original ast to the reconstructed ast
This wil most likely be the most difficult test along-side godot's full compilation test.

0
test/Unreal/validate.ps1 Normal file
View File

View File

18
test/ZPL-C/Readme.md Normal file
View File

@ -0,0 +1,18 @@
# Test : ZPL-C Reconstruction
***Note: This validation test has not been implemented yet.***
Repo : https://github.com/zpl-c/zpl
This is a AST reconstruction test of the ZPL-C library.
Much of the dependency code used in gencpp is derived from the ZPL-C library.
In the future I could directly generate that related code from the ZPL-C library.
For now it just does the following:
1. Download the ZPL-C library
2. Grab all header and source file paths
3. Generate an ast for each file and serialize it to a file called <name of file>.gen.<h/c>
4. Reconstruct the ast from the generated file
5. Compare the original ast to the reconstructed ast

0
test/ZPL-C/validate.ps1 Normal file
View File

View File

View File

@ -0,0 +1,21 @@
#ifdef GEN_TIME
#define GEN_FEATURE_PARSING
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
#define GEN_ENFORCE_STRONG_CODE_TYPES
#define GEN_EXPOSE_BACKEND
#define GEN_BENCHMARK
#include "gen.hpp"
void check_parsing()
{
using namespace gen;
log_fmt("\nupfront: ");
gen::init();
// TODO
gen::deinit();
log_fmt("Passed!\n");
}
#endif

View File

@ -4,6 +4,11 @@
#define GEN_ENFORCE_STRONG_CODE_TYPES
#define GEN_EXPOSE_BACKEND
#define GEN_BENCHMARK
#define GEN_GLOBAL_BUCKET_SIZE megabytes(10)
#define GEN_CODE_POOL_BLOCK_SIZE megabytes(32)
#define GEN_STRING_ARENA_SIZE megabytes(1)
#include "gen.hpp"
#include "gen.builder.hpp"

View File

@ -7,7 +7,7 @@
#include "gen.builder.cpp"
#include "sanity.cpp"
#include "SOA.cpp"
#include "test.singleheader_ast.cpp"
#include "test.singleheader.cpp"
int gen_main()
{
@ -18,8 +18,7 @@ int gen_main()
// check_SOA();
check_singleheader_ast();
// check_singleheader_ast();
return 0;
}
#endif

View File

@ -12,7 +12,7 @@ void check_upfront()
log_fmt("\nupfront: ");
gen::init();
// TODO
gen::deinit();
log_fmt("Passed!\n");

View File

@ -1,3 +0,0 @@
// Constructs an AST from the singlheader generated gen files, then serializes it to a set of files.
// Using the new set of serialized files, reconstructs the AST and then serializes it again (to different set of files).
// The two sets of serialized files should be identical. (Verified by comparing the file hashes)