88ROOT .gROOT .SetBatch (True )
99
1010tutorial_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
1417def 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 )
1821def 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