diff --git a/.github/workflows/auto-sync.yml b/.github/workflows/auto-sync.yml index c0b2fb5e274..0459bb5e00d 100644 --- a/.github/workflows/auto-sync.yml +++ b/.github/workflows/auto-sync.yml @@ -8,15 +8,24 @@ on: jobs: check: runs-on: ubuntu-latest + defaults: + run: + working-directory: shared-models steps: - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.11' + - name: Check out repository + uses: actions/checkout@v4 - name: Install auto-sync package run: | cd suite/auto-sync/ - pip install -e . + pip install . + cd src/autosync - name: Check formatting run: | - ufmt check src + ufmt check . + - name: CppTranslator - Patch tests + run: | + python -m unittest discover cpptranslator/Tests/ \ No newline at end of file diff --git a/suite/auto-sync/src/autosync/cpptranslator/Tests/test_patches.py b/suite/auto-sync/src/autosync/cpptranslator/Tests/test_patches.py index a8efc7fba75..3eab7744597 100644 --- a/suite/auto-sync/src/autosync/cpptranslator/Tests/test_patches.py +++ b/suite/auto-sync/src/autosync/cpptranslator/Tests/test_patches.py @@ -8,6 +8,7 @@ from autosync.cpptranslator import CppTranslator from autosync.cpptranslator.Configurator import Configurator +from autosync.Helper import get_path from tree_sitter import Node, Query @@ -15,7 +16,7 @@ class TestPatches(unittest.TestCase): @classmethod def setUpClass(cls): - configurator = Configurator("ARCH", Path("test_config.json")) + configurator = Configurator("ARCH", get_path("{CPP_TRANSLATOR_TEST_CONFIG}")) cls.translator = CppTranslator.Translator(configurator) cls.ts_cpp_lang = configurator.get_cpp_lang() cls.parser = configurator.get_parser() diff --git a/suite/auto-sync/src/autosync/path_vars.json b/suite/auto-sync/src/autosync/path_vars.json index baaf45537b5..cc4f3ebaf99 100644 --- a/suite/auto-sync/src/autosync/path_vars.json +++ b/suite/auto-sync/src/autosync/path_vars.json @@ -8,6 +8,8 @@ "{CPP_TRANSLATOR_DIR}": "{AUTO_SYNC_SRC}/cpptranslator/", "{CPP_TRANSLATOR_CONFIG}": "{CPP_TRANSLATOR_DIR}/arch_config.json", + "{CPP_TRANSLATOR_TEST_DIR}": "{CPP_TRANSLATOR_DIR}/Tests/", + "{CPP_TRANSLATOR_TEST_CONFIG}": "{CPP_TRANSLATOR_TEST_DIR}/test_config.json", "{INC_PATCH_DIR}": "{AUTO_SYNC_ROOT}/inc_patches/", "{CS_INCLUDE_DIR}": "{CS_ROOT}/include/capstone/",