forked from DMOJ/judge-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PAS.py
29 lines (24 loc) · 766 Bytes
/
PAS.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from dmoj.cptbox.filesystem_policies import ExactFile
from dmoj.executors.compiled_executor import CompiledExecutor
class Executor(CompiledExecutor):
ext = 'pas'
command = 'fpc'
compiler_read_fs = [
ExactFile('/etc/fpc.cfg'),
]
compiler_time_limit = 20
test_program = """\
var line : string;
begin
readln(line);
writeln(line);
end.
"""
def get_compile_args(self):
return [self.get_command(), '-Fe/dev/stderr', '-O2', self._code]
def get_compile_output(self, process):
output = super().get_compile_output(process)
return output if b'Fatal:' in output or b'Warning:' in output or b'Note:' in output else b''
@classmethod
def get_version_flags(cls, command):
return ['-help']