Skip to content

Commit

Permalink
fix tmpdir
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuenni authored and RagnarGrootKoerkamp committed Feb 15, 2024
1 parent 0eb4fa9 commit 79c2d36
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bin/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def _run_helper(self, testcase, constraints, args):
if testcase.in_path.is_relative_to(self.problem.tmpdir):
cwd = testcase.in_path.with_suffix('.feedbackdir')
else:
cwd = self.problem.tmpdir / 'tool_runs' / self.path.relative_to(self.problem.path) / testcase.short_path.with_suffix('.feedbackdir')
name = self.tmpdir.relative_to(self.problem.tmpdir)
cwd = self.problem.tmpdir / 'tool_runs' / name / testcase.short_path.with_suffix('.feedbackdir')
cwd.mkdir(parents=True, exist_ok=True)
arglist = []
if args is not None:
Expand Down Expand Up @@ -259,7 +260,7 @@ def __str__(self):
subdir = 'output_validators'
source_dirs = ['output_validator', 'output_validators']

def run(self, testcase, run_or_mode, constraints=None, args=None):
def run(self, testcase, mode, constraints=None, args=None):
"""
Run this validator on the given testcase.
Expand All @@ -277,16 +278,16 @@ def run(self, testcase, run_or_mode, constraints=None, args=None):
in_path = testcase.in_path.resolve()
ans_path = testcase.ans_path.resolve()
path = (
run_or_mode.out_path
if hasattr(run_or_mode, 'out_path')
mode.out_path
if hasattr(mode, 'out_path')
else (testcase.out_path.resolve() if testcase.root == 'invalid_outputs' else ans_path)
)

if self.language in Validator.FORMAT_VALIDATOR_LANGUAGES:
raise ValueError("Invalid output validator language")

cwd, constraints_path, arglist = self._run_helper(testcase, constraints, args)
feedbackdir = run_or_mode.feedbackdir if hasattr(run_or_mode, 'feedbackdir') else cwd
feedbackdir = mode.feedbackdir if hasattr(mode, 'feedbackdir') else cwd
flags = self.problem.settings.validator_flags
invocation = self.run_command + [in_path, ans_path, feedbackdir] + flags

Expand Down

0 comments on commit 79c2d36

Please sign in to comment.