This commit is contained in:
Egor Matveev 2022-02-28 00:27:52 +03:00
parent 62f5936669
commit 7aa9f31ee8
2 changed files with 30 additions and 0 deletions

View File

@ -61,4 +61,13 @@ languages = [
image="mono",
highlight="csharp",
),
Language(
id=5,
name="Swift",
work_name="Swift",
file_type="swift",
logo_url="https://cdn.worldvectorlogo.com/logos/swift-15.svg",
image="swift",
highlight="swift",
),
]

View File

@ -0,0 +1,21 @@
from os import listdir
from SprintLib.testers.BaseTester import BaseTester, TestException
class SwiftTester(BaseTester):
def before_test(self):
files = [
file
for file in listdir(self.solution.testing_directory)
if file.endswith(".swift")
]
code = self.solution.exec_command(
f'swiftc {" ".join(files)} -o solution'
)
if code != 0:
raise TestException("CE")
@property
def command(self):
return "./solution"