summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPavel Balaev <mail@void.so>2021-12-22 16:18:35 +0300
committerPavel Balaev <mail@void.so>2021-12-22 16:18:35 +0300
commit04937af6cb1571682befb67fb36ceda7229252c7 (patch)
treea960edd57ffe7eb00549f10d93062a5485b3ac31 /test
parent878e1d94e3a9f5cca00b2cd8525a85baedd5dd60 (diff)
test: use python tap
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt6
-rw-r--r--test/utils.py9
-rw-r--r--test/vm_test.py9
3 files changed, 24 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..51258ec
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_custom_target(test
+ DEPENDS nemu
+ COMMENT "Run UI tests:"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND NEMU_BIN_DIR=${CMAKE_BINARY_DIR} python -m tap *_test.py
+ )
diff --git a/test/utils.py b/test/utils.py
new file mode 100644
index 0000000..77110ac
--- /dev/null
+++ b/test/utils.py
@@ -0,0 +1,9 @@
+import os
+
+class Nemu():
+ def setup():
+ print("setup")
+ print(os.getenv("NEMU_BIN_DIR"))
+
+ def cleanup():
+ print("cleanup")
diff --git a/test/vm_test.py b/test/vm_test.py
new file mode 100644
index 0000000..d72563a
--- /dev/null
+++ b/test/vm_test.py
@@ -0,0 +1,9 @@
+import unittest
+from utils import Nemu
+
+class TestVm(unittest.TestCase):
+ def test_install(self):
+ """Test VM install"""
+ Nemu.setup()
+ self.assertTrue(1 == 1)
+ Nemu.cleanup()