Skip to content

Commit 6680cbc

Browse files
committed
run cpp macros
1 parent e4acb91 commit 6680cbc

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

test_tutorials/test_tutorials.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
ROOT.gROOT.SetBatch(True)
99

1010
tutorial_dir = pathlib.Path(str(ROOT.gROOT.GetTutorialDir()))
11-
tutorials = list(tutorial_dir.rglob("*.py"))
1211

12+
# ----------------------
13+
# Python tutorials tests
14+
# ----------------------
15+
py_tutorials = list(tutorial_dir.rglob("*.py"))
1316

1417
def test_tutorials_are_detected():
15-
assert len(tutorials) > 0
18+
assert len(py_tutorials) > 0
1619

17-
@pytest.mark.parametrize("tutorial", tutorials, ids=lambda p: p.name)
20+
@pytest.mark.parametrize("tutorial", py_tutorials, ids=lambda p: p.name)
1821
def test_tutorial(tutorial):
1922
env = dict(**os.environ)
2023
# force matplotlib to use a non-GUI backend
@@ -31,4 +34,16 @@ def test_tutorial(tutorial):
3134
# read stderr to see if EOFError occurred
3235
if "EOFError" in e.stderr:
3336
pytest.skip("Skipping tutorial that requires user input")
34-
raise
37+
raise
38+
39+
# ----------------------
40+
# C++ tutorials tests
41+
# ----------------------
42+
cpp_tutorials = list(tutorial_dir.rglob("*.C"))
43+
44+
def test_cpp_tutorials_are_detected():
45+
assert len(cpp_tutorials) > 0
46+
47+
@pytest.mark.parametrize("tutorial", cpp_tutorials, ids=lambda p: p.name)
48+
def test_cpp_tutorial(tutorial):
49+
ROOT.gROOT.ProcessLine(f".x {tutorial}")

0 commit comments

Comments
 (0)