diff --git a/example_package/config.yml b/example_package/config.yml index c92d203d..ea26639d 100644 --- a/example_package/config.yml +++ b/example_package/config.yml @@ -58,6 +58,10 @@ override_limits: # extra_compilation_files: ['__ID__lib.cpp', '__ID__lib.py'] +# Alternative interactor used for running test runs in interactive via IO tasks. Not required. If not provided and +# the task is interactive via IO (and has test runs configured), then the default interactor will be used. +testrun_soc: __ID__soc_testrun.soc + ### Keys used by sinol-make: diff --git a/src/sinol_make/commands/export/__init__.py b/src/sinol_make/commands/export/__init__.py index 4d3dee07..218e0b8b 100644 --- a/src/sinol_make/commands/export/__init__.py +++ b/src/sinol_make/commands/export/__init__.py @@ -288,6 +288,12 @@ def run(self, args: argparse.Namespace): config = package_util.get_config() package_util.validate_fake_time(config) + testrun_soc = config.get('testrun_soc', None) + if testrun_soc is not None: + if not os.path.exists(os.path.join(os.getcwd(), "prog", testrun_soc)): + util.exit_with_error(f"Testrun interactor file `{testrun_soc}` does not exist. " + f"It should be in `prog` directory.") + export_package_path = paths.get_cache_path('export', self.task_id) if os.path.exists(export_package_path): shutil.rmtree(export_package_path) diff --git a/src/sinol_make/commands/verify/__init__.py b/src/sinol_make/commands/verify/__init__.py index 44d2fa1f..8320dabc 100644 --- a/src/sinol_make/commands/verify/__init__.py +++ b/src/sinol_make/commands/verify/__init__.py @@ -77,7 +77,7 @@ def remove_cache(self): def check_extra_files(self): """ - Checks if extra_compilation_files and extra_execution_files exist. + Checks if extra_compilation_files, extra_execution_files and testrun_soc exist. """ extra_compilation_files = self.config.get('extra_compilation_files', []) for file in extra_compilation_files: @@ -96,6 +96,12 @@ def check_extra_files(self): if extra_execution_files: print(util.info("All extra execution files exist.")) + testrun_soc = self.config.get('testrun_soc', None) + if testrun_soc is not None: + if not os.path.exists(os.path.join(os.getcwd(), "prog", testrun_soc)): + util.exit_with_error(f"Testrun interactor file `{testrun_soc}` does not exist. " + f"It should be in `prog` directory.") + def verify_scores(self, scored_groups): config_scores = self.config.get('scores', {}) if not config_scores: diff --git a/src/sinol_make/util.py b/src/sinol_make/util.py index 51622676..10098944 100644 --- a/src/sinol_make/util.py +++ b/src/sinol_make/util.py @@ -96,6 +96,7 @@ def save_config(config): "sinol_undocumented_time_tool", "sinol_undocumented_test_limits", "fake_time", + "testrun_soc", "num_processes", "memory_limit", "memory_limits",