aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/run_tests.py
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2025-10-25 00:30:48 +0800
committer简律纯 <i@jyunko.cn>2025-10-25 00:30:48 +0800
commitcbc653ffd0ea9abf4360623dc7a7651e1a49cc61 (patch)
treeea3c396148158077bae3e77eaa9341f8c1990636 /tests/run_tests.py
parent08299b37dfda86e56e4f2b442f68ccd2da7a82e3 (diff)
downloadconventional_role_play-cbc653ffd0ea9abf4360623dc7a7651e1a49cc61.tar.gz
conventional_role_play-cbc653ffd0ea9abf4360623dc7a7651e1a49cc61.zip
feat: Implement plugin system with combat tracker and dice analyzer
- Added `plugin_system_demo.py` to demonstrate basic plugin usage, processing, and analysis. - Created `CombatTrackerPlugin` for tracking combat statistics including damage and healing. - Developed `DiceAnalyzerPlugin` for analyzing dice rolls and calculating success rates. - Introduced `renderer_demo.py` for rendering output in HTML, Markdown, and JSON formats. - Implemented `rule_system_demo.py` to showcase rule engine capabilities with various examples. - Established core rule engine functionality in `rules.py` with support for conditions and actions. - Enhanced base plugin structure in `base.py` to support different plugin types (Processor, Renderer, Analyzer). - Added custom exception handling in `exceptions.py` for better error management. - Configured logging setup in `logging_config.py` for improved logging capabilities. - Created unit tests in `test_rust_core.py` to validate core functionalities and performance.
Diffstat (limited to 'tests/run_tests.py')
-rw-r--r--tests/run_tests.py12
1 files changed, 0 insertions, 12 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 4cfc2d4..b776062 100644
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -1,34 +1,22 @@
-#!/usr/bin/env python3
-"""
-测试套件运行器
-运行所有单元测试
-"""
-
import sys
import unittest
from pathlib import Path
-# 添加 src 目录到路径
src_path = Path(__file__).parent.parent / "src"
sys.path.insert(0, str(src_path))
def run_all_tests():
- """运行所有测试"""
- # 创建测试加载器
loader = unittest.TestLoader()
- # 从当前目录加载所有测试
suite = loader.discover(
start_dir=Path(__file__).parent,
pattern='test_*.py'
)
- # 运行测试
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
- # 返回结果
return 0 if result.wasSuccessful() else 1