summaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl/CLProgramTest.java
diff options
context:
space:
mode:
authorWade Walker <[email protected]>2014-02-23 18:23:57 -0600
committerWade Walker <[email protected]>2014-02-23 18:23:57 -0600
commit54ced2cf5d801470c106275291be17583e5e206d (patch)
tree3983673d769c898b515c46adf5f058af218b7710 /test/com/jogamp/opencl/CLProgramTest.java
parent10f9ddfad21c8ab1d4287742d1b524ae11e916c8 (diff)
Fix OpenCL test failures on Solaris.
Since nobody currently makes an OpenCL driver for Solaris, all the tests used to fail, which told us nothing. This commit adds code to check whether OpenCL is unavailable and the OS is Solaris, in which case the test contents are skipped. If an OpenCL driver ever appears for Solaris, or if we start testing on another platform with no OpenCL driver, there's now one single place to add or remove checks that will allow for this.
Diffstat (limited to 'test/com/jogamp/opencl/CLProgramTest.java')
-rw-r--r--test/com/jogamp/opencl/CLProgramTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java
index eaf954e9..7fb7bc32 100644
--- a/test/com/jogamp/opencl/CLProgramTest.java
+++ b/test/com/jogamp/opencl/CLProgramTest.java
@@ -28,6 +28,7 @@
package com.jogamp.opencl;
+import com.jogamp.opencl.test.util.MiscUtils;
import com.jogamp.opencl.test.util.UITestCase;
import com.jogamp.opencl.util.CLBuildConfiguration;
import com.jogamp.opencl.util.CLProgramConfiguration;
@@ -78,6 +79,8 @@ public class CLProgramTest extends UITestCase {
public void rebuildProgramTest() throws IOException {
out.println(" - - - CLProgramTest; rebuild program test - - - ");
+ if(MiscUtils.isOpenCLUnavailable())
+ return;
CLContext context = CLContext.create();
CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl"));
@@ -117,6 +120,8 @@ public class CLProgramTest extends UITestCase {
public void programBinariesTest() throws IOException {
out.println(" - - - CLProgramTest; down-/upload binaries test - - - ");
+ if(MiscUtils.isOpenCLUnavailable())
+ return;
CLContext context = CLContext.create();
CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl"))
@@ -194,6 +199,8 @@ public class CLProgramTest extends UITestCase {
@Test
public void builderTest() throws IOException, ClassNotFoundException, InterruptedException {
out.println(" - - - CLProgramTest; program builder test - - - ");
+ if(MiscUtils.isOpenCLUnavailable())
+ return;
CLContext context = CLContext.create();
CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl"));
@@ -276,6 +283,9 @@ public class CLProgramTest extends UITestCase {
@Test
public void kernelTest() {
+ if(MiscUtils.isOpenCLUnavailable())
+ return;
+
String source = "__attribute__((reqd_work_group_size(1, 1, 1))) kernel void foo(float a, int b, short c) { }\n";
CLContext context = CLContext.create();
@@ -324,6 +334,9 @@ public class CLProgramTest extends UITestCase {
@Test
public void createAllKernelsTest() {
+ if(MiscUtils.isOpenCLUnavailable())
+ return;
+
String source = "kernel void foo(int a) { }\n"+
"kernel void bar(float b) { }\n";