tinymist/editors/neovim/spec/main.py
Myriad-Dreamin c03898cd3d
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
feat: add a neovim plugin as the canonical lsp client implementation (#1842)
* fix: bad link

* feat(neovim): init lsp

* feat(neovim): add bootstrap script

* build: add notice
2025-06-25 22:12:55 +08:00

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)