Skip to content

Commit cb0f283

Browse files
committed
standardise ref_file resume tests
Signed-off-by: Jack Luar <[email protected]>
1 parent a06b8ae commit cb0f283

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

tools/AutoTuner/test/ref_file_check.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import os
44

55
cur_dir = os.path.dirname(os.path.abspath(__file__))
6-
src_dir = os.path.join(cur_dir, "../src/autotuner")
7-
orfs_dir = os.path.join(cur_dir, "../../../flow")
8-
os.chdir(src_dir)
96

107

118
class RefFileCheck(unittest.TestCase):
@@ -15,11 +12,11 @@ class RefFileCheck(unittest.TestCase):
1512

1613
def setUp(self):
1714
configs = [
18-
"../../test/files/no_sdc_ref.json",
19-
"../../test/files/no_fr_ref.json",
15+
os.path.join(cur_dir, "../../test/files/no_sdc_ref.json"),
16+
os.path.join(cur_dir, "../../test/files/no_fr_ref.json"),
2017
]
2118
self.commands = [
22-
f"python3 distributed.py"
19+
f"python3 -m autotuner.distributed"
2320
f" --design {self.design}"
2421
f" --platform {self.platform}"
2522
f" --config {c}"
@@ -28,7 +25,6 @@ def setUp(self):
2825
for c in configs
2926
]
3027

31-
# Make this a test case
3228
def test_files(self):
3329
for c in self.commands:
3430
out = subprocess.run(c, shell=True)

tools/AutoTuner/test/resume_check.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
from contextlib import contextmanager
77

88
cur_dir = os.path.dirname(os.path.abspath(__file__))
9-
src_dir = os.path.join(cur_dir, "../src/autotuner")
10-
orfs_dir = os.path.join(cur_dir, "../../../flow")
11-
os.chdir(src_dir)
129

1310

1411
@contextmanager
@@ -34,7 +31,13 @@ class ResumeCheck(unittest.TestCase):
3431

3532
def setUp(self):
3633
self.config = os.path.join(
37-
orfs_dir, "designs", self.platform, self.design, "autotuner.json"
34+
cur_dir,
35+
"../../../",
36+
"flow",
37+
"designs",
38+
self.platform,
39+
self.design,
40+
"autotuner.json",
3841
)
3942
self.jobs = self.samples
4043
self.num_cpus = os.cpu_count()
@@ -47,7 +50,7 @@ def setUp(self):
4750
res_per_trial = float("{:.1f}".format(self.num_cpus / self.samples))
4851
options = ["", "--resume"]
4952
self.commands = [
50-
f"python3 distributed.py"
53+
f"python3 -m autotuner.distributed"
5154
f" --design {self.design}"
5255
f" --platform {self.platform}"
5356
f" --config {self.config}"

0 commit comments

Comments
 (0)