mirror of
https://github.com/arabine/open-story-teller.git
synced 2025-12-06 17:09:06 +01:00
fix win32 build (tentative)
This commit is contained in:
parent
9c6df3c9b6
commit
b76add6793
3 changed files with 61 additions and 37 deletions
36
.github/workflows/vitepress.yml
vendored
36
.github/workflows/vitepress.yml
vendored
|
|
@ -1,36 +0,0 @@
|
||||||
name: Deploy-Documentation
|
|
||||||
on:
|
|
||||||
workflow_dispatch: {}
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: '**/package-lock.json'
|
|
||||||
- run: npm ci
|
|
||||||
working-directory: docs
|
|
||||||
- name: Build
|
|
||||||
run: npm run docs:build
|
|
||||||
working-directory: docs
|
|
||||||
- uses: actions/configure-pages@v2
|
|
||||||
- uses: actions/upload-pages-artifact@v3
|
|
||||||
with:
|
|
||||||
path: docs/.vitepress/dist
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
|
|
@ -237,3 +237,63 @@ TEST_CASE("Print with multiple arguments") {
|
||||||
Chip32::Machine machine;
|
Chip32::Machine machine;
|
||||||
machine.QuickExecute(assembly);
|
machine.QuickExecute(assembly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE("Print with format placeholders") {
|
||||||
|
auto printNode = std::make_shared<PrintNode>("print-node");
|
||||||
|
|
||||||
|
// L'utilisateur utilise maintenant {0}, {1}, etc.
|
||||||
|
printNode->SetText("Résultat: {0} + {1} = {2}");
|
||||||
|
|
||||||
|
auto var_a = std::make_shared<Variable>("a");
|
||||||
|
var_a->SetIntegerValue(10);
|
||||||
|
|
||||||
|
auto var_b = std::make_shared<Variable>("b");
|
||||||
|
var_b->SetIntegerValue(20);
|
||||||
|
|
||||||
|
std::vector<std::shared_ptr<Variable>> variables = {var_a, var_b};
|
||||||
|
|
||||||
|
auto functionEntry = std::make_shared<FunctionEntryNode>("function-entry-node");
|
||||||
|
auto varNodeA = std::make_shared<VariableNode>("variable-node");
|
||||||
|
varNodeA->SetVariableUuid(var_a->GetUuid());
|
||||||
|
|
||||||
|
auto varNodeB = std::make_shared<VariableNode>("variable-node");
|
||||||
|
varNodeB->SetVariableUuid(var_b->GetUuid());
|
||||||
|
|
||||||
|
auto addNode = std::make_shared<OperatorNode>("operator-node");
|
||||||
|
addNode->SetOperationType(OperatorNode::OperationType::ADD);
|
||||||
|
|
||||||
|
std::vector<std::shared_ptr<BaseNode>> nodes = {
|
||||||
|
functionEntry, varNodeA, varNodeB, addNode, printNode
|
||||||
|
};
|
||||||
|
|
||||||
|
// Connexions...
|
||||||
|
std::vector<std::shared_ptr<Connection>> connections;
|
||||||
|
// [Ajouter les connexions comme dans les tests existants]
|
||||||
|
|
||||||
|
// Générer le code
|
||||||
|
ASTBuilder builder(nodes, connections);
|
||||||
|
auto pathTree = builder.BuildAST();
|
||||||
|
|
||||||
|
AssemblyGenerator::GeneratorContext context(
|
||||||
|
variables, "2025-01-10 10:00:00", "test-format", true, true, 1024
|
||||||
|
);
|
||||||
|
|
||||||
|
AssemblyGeneratorChip32 generator(context);
|
||||||
|
generator.Reset();
|
||||||
|
generator.GenerateHeader();
|
||||||
|
generator.StartSection(AssemblyGenerator::Section::DATA);
|
||||||
|
generator.GenerateNodesVariables(nodes);
|
||||||
|
generator.GenerateGlobalVariables();
|
||||||
|
generator.StartSection(AssemblyGenerator::Section::TEXT);
|
||||||
|
generator.GenerateTextSection(pathTree);
|
||||||
|
generator.GenerateExit();
|
||||||
|
|
||||||
|
std::string assembly = generator.GetAssembly();
|
||||||
|
|
||||||
|
// Vérifier que le format a été converti de {0} {1} {2} en %d %d %d
|
||||||
|
REQUIRE(assembly.find("\"Résultat: %d + %d = %d\"") != std::string::npos);
|
||||||
|
|
||||||
|
std::cout << "\n===== Assembly avec format converti =====\n"
|
||||||
|
<< assembly << std::endl;
|
||||||
|
}
|
||||||
|
|
@ -44,7 +44,7 @@ add_compile_definitions(CUSTOM_IMGUIFILEDIALOG_CONFIG="${CMAKE_SOURCE_DIR}/src/C
|
||||||
add_compile_definitions(IMGUI_INCLUDE="imgui.h")
|
add_compile_definitions(IMGUI_INCLUDE="imgui.h")
|
||||||
add_subdirectory(libs/ImGuiFileDialog)
|
add_subdirectory(libs/ImGuiFileDialog)
|
||||||
|
|
||||||
include_directories(externals/ImNodeFlow/src)
|
include_directories(externals/ImNodeFlow/src externals/ImNodeFlow/include)
|
||||||
|
|
||||||
add_subdirectory(externals/ImNodeFlow EXCLUDE_FROM_ALL)
|
add_subdirectory(externals/ImNodeFlow EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue