-
Notifications
You must be signed in to change notification settings - Fork 1
/
preparetest.py
28 lines (23 loc) · 893 Bytes
/
preparetest.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
import argparse
import pathlib
import shutil
import subprocess
from util.path import *
parser = argparse.ArgumentParser(description="rcauto.pyのテストの準備をする。")
parser.add_argument("--clean", action='store_true')
args = parser.parse_args()
downloadDir = mkdir("down")
if args.clean:
print("Clean up")
pathlib.Path("tested.txt").unlink(True)
if getOutputDir().exists():
shutil.rmtree(getOutputDir())
if pathlib.Path("work").exists():
shutil.rmtree("work")
shutil.make_archive(downloadDir / "testrender", "zip", ".", "testrender")
subprocess.run(["g++", "-o", "test", "test.cpp"], cwd = "testrender2")
shutil.make_archive(downloadDir / "testrender2", "zip", ".", "testrender2")
(pathlib.Path(__file__).parent / "downloads.txt").write_text(
str(downloadDir / "testrender.zip") + "\n" +
str(downloadDir / "testrender2.zip")
)