From b76add6793db607b6f7a2957c7589dadc77cd7fb Mon Sep 17 00:00:00 2001 From: "anthony@rabine.fr" Date: Sun, 5 Oct 2025 10:59:59 +0200 Subject: [PATCH] fix win32 build (tentative) --- .github/workflows/vitepress.yml | 36 -------------------- core/tests/test_print_node.cpp | 60 +++++++++++++++++++++++++++++++++ story-editor/CMakeLists.txt | 2 +- 3 files changed, 61 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/vitepress.yml diff --git a/.github/workflows/vitepress.yml b/.github/workflows/vitepress.yml deleted file mode 100644 index 80f1b9c..0000000 --- a/.github/workflows/vitepress.yml +++ /dev/null @@ -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 diff --git a/core/tests/test_print_node.cpp b/core/tests/test_print_node.cpp index 99cfe55..556d3da 100644 --- a/core/tests/test_print_node.cpp +++ b/core/tests/test_print_node.cpp @@ -236,4 +236,64 @@ TEST_CASE("Print with multiple arguments") { // Execute Chip32::Machine machine; machine.QuickExecute(assembly); +} + + +TEST_CASE("Print with format placeholders") { + auto printNode = std::make_shared("print-node"); + + // L'utilisateur utilise maintenant {0}, {1}, etc. + printNode->SetText("Résultat: {0} + {1} = {2}"); + + auto var_a = std::make_shared("a"); + var_a->SetIntegerValue(10); + + auto var_b = std::make_shared("b"); + var_b->SetIntegerValue(20); + + std::vector> variables = {var_a, var_b}; + + auto functionEntry = std::make_shared("function-entry-node"); + auto varNodeA = std::make_shared("variable-node"); + varNodeA->SetVariableUuid(var_a->GetUuid()); + + auto varNodeB = std::make_shared("variable-node"); + varNodeB->SetVariableUuid(var_b->GetUuid()); + + auto addNode = std::make_shared("operator-node"); + addNode->SetOperationType(OperatorNode::OperationType::ADD); + + std::vector> nodes = { + functionEntry, varNodeA, varNodeB, addNode, printNode + }; + + // Connexions... + std::vector> 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; } \ No newline at end of file diff --git a/story-editor/CMakeLists.txt b/story-editor/CMakeLists.txt index 5b2c239..8f5908f 100644 --- a/story-editor/CMakeLists.txt +++ b/story-editor/CMakeLists.txt @@ -44,7 +44,7 @@ add_compile_definitions(CUSTOM_IMGUIFILEDIALOG_CONFIG="${CMAKE_SOURCE_DIR}/src/C add_compile_definitions(IMGUI_INCLUDE="imgui.h") add_subdirectory(libs/ImGuiFileDialog) -include_directories(externals/ImNodeFlow/src) +include_directories(externals/ImNodeFlow/src externals/ImNodeFlow/include) add_subdirectory(externals/ImNodeFlow EXCLUDE_FROM_ALL)