Skip to content

Commit 6d62afb

Browse files
Added tests to check functionality of main script
1 parent c918f38 commit 6d62afb

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

dpctl/tests/test_service.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import os
2424
import os.path
2525
import re
26+
import subprocess
2627
import sys
2728

2829
import pytest
@@ -153,3 +154,31 @@ def test_syclinterface():
153154
), "Installation does not have DPCTLSyclInterface.dll"
154155
else:
155156
raise RuntimeError("Unsupported system")
157+
158+
159+
def test_main_includes():
160+
res = subprocess.run(
161+
[sys.executable, "-m", "dpctl", "--includes"], capture_output=True
162+
)
163+
assert res.returncode == 0
164+
assert res.stdout
165+
assert res.stdout.decode("utf-8").startswith("-I")
166+
167+
168+
def test_main_library():
169+
res = subprocess.run(
170+
[sys.executable, "-m", "dpctl", "--library"], capture_output=True
171+
)
172+
assert res.returncode == 0
173+
assert res.stdout
174+
assert res.stdout.decode("utf-8").startswith("-L")
175+
176+
177+
def test_cmakedir():
178+
res = subprocess.run(
179+
[sys.executable, "-m", "dpctl", "--cmakedir"], capture_output=True
180+
)
181+
assert res.returncode == 0
182+
assert res.stdout
183+
cmake_dir = res.stdout.decode("utf-8").strip()
184+
assert os.path.exists(os.path.join(cmake_dir, "FindDpctl.cmake"))

0 commit comments

Comments
 (0)