Skip to content

Commit

Permalink
(#3) Text2D unit tests, simplify headless check
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasstarsz committed Apr 12, 2021
1 parent 4fdc7c4 commit 22bbdbf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/test/java/unittest/testcases/graphics/text/Text2DTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import io.github.lucasstarsz.fastj.graphics.gameobject.text.Text2D;
import io.github.lucasstarsz.fastj.math.Maths;
import io.github.lucasstarsz.fastj.math.Pointf;
import io.github.lucasstarsz.fastj.systems.render.Display;
import io.github.lucasstarsz.fastj.systems.control.Scene;
import org.junit.jupiter.api.BeforeEach;
import io.github.lucasstarsz.fastj.systems.render.Display;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import unittest.mock.MockManager;

Expand All @@ -21,11 +21,13 @@

public class Text2DTests {

@BeforeEach
public void onlyRunOnWindows() {
// hate to do it to ya, unix, but idk how to run github actions in non-headless mode
String headless = System.getProperty("java.awt.headless");
assumeTrue(!GraphicsEnvironment.isHeadless() || headless != null && headless.equalsIgnoreCase("false"));
@BeforeAll
public static void onlyRunIfNotHeadless() {
// because idk how to run github actions in non-headless mode
assumeTrue(
!GraphicsEnvironment.isHeadless(),
"Well that's unfortunate... this device isn't running in headless mode, so Text2D tests cannot be conducted."
);
}

@Test
Expand Down

0 comments on commit 22bbdbf

Please sign in to comment.