From 6c9c141c3e74e6becaba697269d5edaa2c6d2e01 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 2 Apr 2020 16:34:07 +0530 Subject: [PATCH] Add a command to easily run rapydscript tests --- setup/commands.py | 5 +++-- setup/test.py | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/setup/commands.py b/setup/commands.py index ef8e39f9ab..402e1f394e 100644 --- a/setup/commands.py +++ b/setup/commands.py @@ -13,7 +13,7 @@ __all__ = [ 'git_version', 'develop', 'install', 'kakasi', 'rapydscript', 'cacerts', 'recent_uas', 'resources', - 'check', 'to3', 'unicode_check', 'iterators_check', 'test', + 'check', 'to3', 'unicode_check', 'iterators_check', 'test', 'test_rs', 'sdist', 'bootstrap', 'extdev', 'manual', 'tag_release', 'upload_to_server', @@ -70,8 +70,9 @@ to3 = To3() unicode_check = UnicodeCheck() iterators_check = IteratorsCheck() -from setup.test import Test +from setup.test import Test, TestRS test = Test() +test_rs = TestRS() from setup.resources import Resources, Kakasi, CACerts, RapydScript, RecentUAs resources = Resources() diff --git a/setup/test.py b/setup/test.py index 2ded632a16..1fc075250f 100644 --- a/setup/test.py +++ b/setup/test.py @@ -175,3 +175,12 @@ class Test(Command): if opts.exclude_test_name: tests = remove_tests_by_name(tests, *opts.exclude_test_name) run_cli(tests, verbosity=opts.test_verbosity) + + +class TestRS(Command): + + description = 'Run tests for RapydScript code' + + def run(self, opts): + from calibre.utils.rapydscript import run_rapydscript_tests + run_rapydscript_tests()