Skip to content

Commit

Permalink
Dont verify test order in default contest type
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Aug 6, 2024
1 parent 4a8820e commit 799dc66
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sinol_make/commands/inwer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from functools import cmp_to_key
from typing import Dict, List

from sinol_make import util
from sinol_make import util, contest_types
from sinol_make.structs.inwer_structs import TestResult, InwerExecution, VerificationResult, TableData
from sinol_make.helpers import package_util, printer, paths, parsers
from sinol_make.interfaces.BaseCommand import BaseCommand
Expand Down Expand Up @@ -206,6 +206,7 @@ def run(self, args: argparse.Namespace):

self.cpus = args.cpus or util.default_cpu_count()
self.tests = package_util.get_tests(self.task_id, args.tests)
self.contest_type = contest_types.get_contest_type()

if len(self.tests) == 0:
util.exit_with_error('No tests found.')
Expand All @@ -224,7 +225,7 @@ def run(self, args: argparse.Namespace):

if len(failed_tests) > 0:
util.exit_with_error(f'Verification failed for tests: {", ".join(failed_tests)}')
else:
elif self.contest_type.verify_tests_order():
print("Verifying tests order...")
self.verify_tests_order()
print(util.info('Verification successful.'))
print(util.info('Verification successful.'))
6 changes: 6 additions & 0 deletions src/sinol_make/contest_types/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,9 @@ def preferred_timetool(self):
Returns preferred time tool
"""
return 'oiejq'

def verify_tests_order(self):
"""
Whether to verify tests order
"""
return False
3 changes: 3 additions & 0 deletions src/sinol_make/contest_types/icpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ def max_score_per_test(self):

def preferred_timetool(self):
return "time"

def verify_tests_order(self):
return True
3 changes: 3 additions & 0 deletions src/sinol_make/contest_types/oi.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ def verify_pre_gen(self):

def allow_per_test_limits(self):
return False

def verify_tests_order(self):
return True
3 changes: 3 additions & 0 deletions src/sinol_make/contest_types/oij.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ def verify_pre_gen(self):
total_score = sum(config['scores'].values())
if total_score != 100:
util.exit_with_error(f"Total score in config is {total_score}, but should be 100.")

def verify_tests_order(self):
return True
1 change: 1 addition & 0 deletions tests/packages/wer/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
title: Test package for veryfing inwer command
memory_limit: 16000
time_limit: 1000
sinol_contest_type: oi

scores:
1: 33
Expand Down

0 comments on commit 799dc66

Please sign in to comment.