about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTheofilos Augoustis <theofilos.augoustis@tum.de>2025-08-28 13:29:25 +0000
committerTheofilos Augoustis <theofilos.augoustis@tum.de>2025-08-28 13:29:25 +0000
commit4bcee933ed1894b3ead6e5dc4c6f993cf769b523 (patch)
tree30ecfa2ce98474fd4447d2dcf1814d4c16661602
parent7e46de2da5f4d99ab672f5609b0142a4915498fc (diff)
downloadfocaccia-ta/tool-refactor.tar.gz
focaccia-ta/tool-refactor.zip
Move qemu validator tool to our current setup ta/tool-refactor
-rw-r--r--flake.nix5
-rw-r--r--pyproject.toml1
-rw-r--r--src/focaccia/tools/_qemu_tool.py (renamed from tools/_qemu_tool.py)0
-rwxr-xr-xsrc/focaccia/tools/validate_qemu.py (renamed from tools/verify_qemu.py)9
4 files changed, 13 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index 25b5aec..b199e83 100644
--- a/flake.nix
+++ b/flake.nix
@@ -224,6 +224,11 @@
 				program = "${packages.default}/bin/capture-transforms";
 			};
 
+			validate-qemu = {
+				type = "app";
+				program = "${packages.default}/bin/validate-qemu";
+			};
+
 			# Useful for synchronize the uv lockfile
 			uv-sync = {
 				type = "app";
diff --git a/pyproject.toml b/pyproject.toml
index 27e1713..4e323df 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -28,6 +28,7 @@ dev = [
 focaccia = "focaccia.cli:main"
 convert = "focaccia.tools.convert:main"
 capture-transforms = "focaccia.tools.capture_transforms:main"
+validate-qemu = "focaccia.tools.validate_qemu:main"
 
 [build-system]
 requires = ["hatchling"]
diff --git a/tools/_qemu_tool.py b/src/focaccia/tools/_qemu_tool.py
index b365d39..b365d39 100644
--- a/tools/_qemu_tool.py
+++ b/src/focaccia/tools/_qemu_tool.py
diff --git a/tools/verify_qemu.py b/src/focaccia/tools/validate_qemu.py
index 7402852..f5d0bb2 100755
--- a/tools/verify_qemu.py
+++ b/src/focaccia/tools/validate_qemu.py
@@ -19,6 +19,7 @@ import os
 import subprocess
 import sys
 
+import focaccia
 from focaccia.compare import ErrorTypes
 
 verbosity = {
@@ -70,13 +71,13 @@ def try_remove(l: list, v):
     except ValueError:
         pass
 
-if __name__ == "__main__":
+def main():
     prog = make_argparser()
     prog.add_argument('--gdb', default='gdb',
                       help='GDB binary to invoke.')
     args = prog.parse_args()
 
-    filepath = os.path.realpath(__file__)
+    filepath = focaccia.__file__
     qemu_tool_path = os.path.join(os.path.dirname(filepath), '_qemu_tool.py')
 
     # We have to remove all arguments we don't want to pass to the qemu tool
@@ -104,3 +105,7 @@ if __name__ == "__main__":
 
     ret = proc.wait()
     exit(ret)
+
+if __name__ == "__main__":
+    main()
+