From 8de5c7be3ab5a072f6633b00e14a4a995014390e Mon Sep 17 00:00:00 2001 From: Maurice Heumann Date: Fri, 4 Apr 2025 14:53:31 +0200 Subject: [PATCH] Run icicle tests --- .github/workflows/build.yml | 15 +++++++++++++-- src/windows-emulator/windows_emulator.cpp | 8 ++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77423174..ab0b53d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -268,6 +268,9 @@ jobs: - Linux x86_64 Clang - macOS arm64 - macOS x86_64 + emulator: + - Unicorn + - Icicle emulation-root: - Windows 2025 - Windows 2022 @@ -298,11 +301,16 @@ jobs: with: submodules: recursive - - name: Setup Environment Variables + - name: Setup Asan Environment Variables if: ${{ contains(matrix.platform, 'Sanitizer') }} run: | echo "ASAN_OPTIONS=detect_odr_violation=0" >> $GITHUB_ENV + - name: Setup Icicle Environment Variables + if: ${{ matrix.emulator == 'Icicle' }} + run: | + echo "EMULATOR_ICICLE=1" >> $GITHUB_ENV + - name: Download Test Configuration uses: actions/download-artifact@v4.2.1 with: @@ -348,6 +356,9 @@ jobs: architecture: - x86_64 #- arm64-v8a + emulator: + - Unicorn + - Icicle emulation-root: - Windows 2025 - Windows 2022 @@ -398,7 +409,7 @@ jobs: with: api-level: 29 arch: ${{matrix.architecture}} - script: "adb push build/${{matrix.preset}}/artifacts/* /data/local/tmp && adb shell \"cd /data/local/tmp && export LD_LIBRARY_PATH=. && chmod +x ./analyzer && ./analyzer -e ./root c:/test-sample.exe\"" + script: "adb push build/${{matrix.preset}}/artifacts/* /data/local/tmp && adb shell \"cd /data/local/tmp && export LD_LIBRARY_PATH=. && chmod +x ./analyzer && EMULATOR_ICICLE=${{ matrix.emulator == 'Icicle' }} ./analyzer -e ./root c:/test-sample.exe\"" summary: name: Pipeline Summary diff --git a/src/windows-emulator/windows_emulator.cpp b/src/windows-emulator/windows_emulator.cpp index cccbb3fb..b9abddab 100644 --- a/src/windows-emulator/windows_emulator.cpp +++ b/src/windows-emulator/windows_emulator.cpp @@ -210,6 +210,14 @@ namespace std::unique_ptr create_default_x64_emulator() { +#if MOMO_ENABLE_RUST_CODE + const auto* env = getenv("EMULATOR_ICICLE"); + if (env && (env == "1"sv || env == "true"sv)) + { + return icicle::create_x64_emulator(); + } +#endif + return unicorn::create_x64_emulator(); }