-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcleanup.py
More file actions
65 lines (46 loc) · 2 KB
/
Copy pathcleanup.py
File metadata and controls
65 lines (46 loc) · 2 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""Remove generated outputs and processed results from all registered VVP suites."""
import shutil
import subprocess
import sys
from pathlib import Path
# ======================================================================================
# Bootstrap VVP imports
# ======================================================================================
REPO_DIR = Path(__file__).resolve().parent
# Support running this script from any working directory without installing VVP.
if str(REPO_DIR) not in sys.path:
sys.path.insert(0, str(REPO_DIR))
# ======================================================================================
# Load suite configuration
# ======================================================================================
from configs.launch_config import LAUNCH_CONFIG
# ======================================================================================
# Clean registered suites
# ======================================================================================
for suite in LAUNCH_CONFIG:
suite_dir = REPO_DIR / suite
cleaner = suite_dir / "cleanup.py"
if not suite_dir.is_dir():
raise FileNotFoundError(f"Suite directory not found: {suite_dir}")
if not cleaner.is_file():
print(f"Skip suite without cleanup.py: {suite}")
continue
print("=" * 80)
print(f"Cleaning suite: {suite}")
print("=" * 80)
subprocess.run(
[sys.executable, str(cleaner)],
cwd=suite_dir,
check=True,
)
# ======================================================================================
# Remove collected results
# ======================================================================================
results_dir = REPO_DIR / "results"
if results_dir.is_dir():
shutil.rmtree(results_dir)
# ======================================================================================
# Summary
# ======================================================================================
print()
print("Cleanup complete.")