mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-07 21:15:03 +00:00

Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
* fix: bad link * feat(neovim): init lsp * feat(neovim): add bootstrap script * build: add notice
64 lines
2.2 KiB
Python
64 lines
2.2 KiB
Python
# -- packpath := justfile_directory() / "packpath"
|
|
# -- scripts := justfile_directory() / "scripts"
|
|
# -- doc := justfile_directory() / "doc"
|
|
# -- src := justfile_directory() / "lua"
|
|
# -- lean := src / "lean"
|
|
# -- spec := justfile_directory() / "spec"
|
|
# -- fixtures := spec / "fixtures"
|
|
# -- demos := justfile_directory() / "demos"
|
|
|
|
# -- init_lua := scripts / "minimal_init.lua"
|
|
# -- clean_config := justfile_directory() / ".test-config"
|
|
|
|
# -- # Rebuild some test fixtures used in the test suite.
|
|
# -- _rebuild-test-fixtures:
|
|
# -- cd "{{ fixtures }}/example-project/"; lake build && lake build ProofWidgets Mathlib.Tactic.Widget.Conv
|
|
|
|
# -- # Run the lean.nvim test suite.
|
|
# -- [group('testing')]
|
|
# -- test: _rebuild-test-fixtures _clone-test-dependencies
|
|
# -- @just retest
|
|
|
|
# -- # Run the test suite without rebuilding or recloning any dependencies.
|
|
# -- [group('testing')]
|
|
# -- retest *test_files=spec:
|
|
# -- nvim --headless --clean -u {{ init_lua }} -c 'lua require("inanis").run{ specs = vim.split("{{ test_files }}", " "), minimal_init = "{{ init_lua }}", sequential = vim.env.TEST_SEQUENTIAL ~= nil }'
|
|
|
|
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
def run_tests(test_files=None):
|
|
"""
|
|
Run the Neovim test suite with the specified test files.
|
|
If no test files are specified, it runs all tests in the 'spec' directory.
|
|
"""
|
|
init_lua = os.path.realpath(os.path.join(__file__, '../../scripts/minimal_init.lua'))
|
|
|
|
if test_files is None:
|
|
# all test files in the 'spec' directory
|
|
test_files = []
|
|
for root, _, files in os.walk(os.path.dirname(__file__)):
|
|
test_files.extend( os.path.join(root, f) for f in files if f.endswith('_spec.lua') )
|
|
test_files = ' '.join(test_files)
|
|
|
|
command = [
|
|
'nvim',
|
|
'--headless',
|
|
'--clean',
|
|
'-u', init_lua,
|
|
'-c', f'lua require("inanis").run{{ specs = vim.split("{test_files}", " "), minimal_init = "{init_lua}", sequential = vim.env.TEST_SEQUENTIAL ~= nil }}'
|
|
]
|
|
|
|
subprocess.run(command, check=True)
|
|
|
|
if __name__ == "__main__":
|
|
# Check if any test files are provided as command line arguments
|
|
if len(sys.argv) > 1:
|
|
test_files = ' '.join(sys.argv[1:])
|
|
else:
|
|
test_files = None
|
|
|
|
run_tests(test_files)
|
|
|