diff --git a/demo/cpp/test.py b/demo/cpp/test.py index ca8807eb3..f2670782e 100644 --- a/demo/cpp/test.py +++ b/demo/cpp/test.py @@ -2,6 +2,7 @@ import os from subprocess import run +import sys import pytest @@ -25,6 +26,13 @@ def test_demo(demo, cmake_args): """Test demos.""" demo_source = os.path.join(path, demo) demo_build = os.path.join(path, demo, "_build") + run(f"cmake {cmake_args} -B {demo_build} -S {demo_source}", check=True, shell=True) run(f"cmake --build {demo_build}", check=True, shell=True) - run(os.path.join(demo_build, demo), check=True, shell=True) + + if sys.platform.startswith("win32"): + demo_executable = demo + ".exe" + else: + demo_executable = demo + + run(os.path.join(demo_build, demo_executable), check=True, shell=True)