forked from 3b1b/manim
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable CI testing for OpenGL (3b1b#1160)
* add simple circle test for opengl * literally a comma * add rgb tolerance to graphical unit tester * start up xvfb on ubuntu? * black style * reduce tolerance to pixel ? * add msys2 action * add mesa install * ci: windows add msys2 to path Compile moderngl from source add a init tests for CI to work add colour to pytest * minor edits * mild refactor of scene / camera / renderer relationship * flake-d * reverted refactor * reverted opengl split at the level of graphical unit tester * remove unnecessary config in definition * CI: remove python3 from MSYS2 also Co-authored-by: Naveen M K <[email protected]>
- Loading branch information
1 parent
cdd0dde
commit d8d9a01
Showing
6 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import os | ||
|
||
if os.getenv("CI") and os.name == "nt": | ||
location = r"C:\msys64\mingw64\bin" | ||
os.environ["PATH"] = location + os.pathsep + os.getenv("PATH") | ||
import ctypes | ||
|
||
ctypes.CDLL(r"C:\msys64\mingw64\bin\OPENGL32.dll") | ||
if hasattr(os, "add_dll_directory"): | ||
os.add_dll_directory(location) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pytest | ||
|
||
from manim import * | ||
from manim.opengl import * | ||
from ..utils.testing_utils import get_scenes_to_test | ||
from ..utils.GraphicalUnitTester import GraphicalUnitTester | ||
|
||
|
||
class CircleTest(Scene): | ||
def construct(self): | ||
circle = OpenGLCircle().set_color(RED) | ||
self.add(circle) | ||
self.wait() | ||
|
||
|
||
MODULE_NAME = "opengl" | ||
|
||
|
||
@pytest.mark.parametrize("scene_to_test", get_scenes_to_test(__name__), indirect=False) | ||
def test_scene(scene_to_test, tmpdir, show_diff): | ||
with tempconfig({"use_opengl_renderer": True}): | ||
# allow 1/255 RGB value differences with opengl tests because of differences across platforms | ||
GraphicalUnitTester(scene_to_test[1], MODULE_NAME, tmpdir, rgb_atol=1.01).test( | ||
show_diff=show_diff | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters