From 54ced2cf5d801470c106275291be17583e5e206d Mon Sep 17 00:00:00 2001 From: Wade Walker Date: Sun, 23 Feb 2014 18:23:57 -0600 Subject: 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. --- test/com/jogamp/opencl/CLCommandQueueTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/com/jogamp/opencl/CLCommandQueueTest.java') diff --git a/test/com/jogamp/opencl/CLCommandQueueTest.java b/test/com/jogamp/opencl/CLCommandQueueTest.java index c9b1b567..76260289 100644 --- a/test/com/jogamp/opencl/CLCommandQueueTest.java +++ b/test/com/jogamp/opencl/CLCommandQueueTest.java @@ -35,6 +35,7 @@ import org.junit.runners.MethodSorters; import java.util.concurrent.CountDownLatch; +import com.jogamp.opencl.test.util.MiscUtils; import com.jogamp.opencl.test.util.UITestCase; import com.jogamp.opencl.util.MultiQueueBarrier; import com.jogamp.opencl.CLCommandQueue.Mode; @@ -101,6 +102,8 @@ public class CLCommandQueueTest extends UITestCase { public void eventsTest() throws IOException { out.println(" - - - event synchronization test - - - "); + if(MiscUtils.isOpenCLUnavailable()) + return; CLContext context = CLContext.create(); @@ -171,6 +174,8 @@ public class CLCommandQueueTest extends UITestCase { public void eventConditionsTest() throws IOException { out.println(" - - - event conditions test - - - "); + if(MiscUtils.isOpenCLUnavailable()) + return; CLPlatform platform = CLPlatform.getDefault(CLPlatformFilters.queueMode(OUT_OF_ORDER_MODE)); @@ -231,6 +236,8 @@ public class CLCommandQueueTest extends UITestCase { public void profilingEventsTest() throws IOException { out.println(" - - - event synchronization test - - - "); + if(MiscUtils.isOpenCLUnavailable()) + return; CLContext context = CLContext.create(); @@ -286,6 +293,8 @@ public class CLCommandQueueTest extends UITestCase { @Test public void customEventsTest() throws IOException, InterruptedException { out.println(" - - - user events test - - - "); + if(MiscUtils.isOpenCLUnavailable()) + return; CLPlatform[] platforms = CLPlatform.listCLPlatforms(); CLPlatform theChosenOne = platforms[0]; @@ -362,6 +371,8 @@ public class CLCommandQueueTest extends UITestCase { public void eventCallbackTest() throws InterruptedException { out.println(" - - - event callback test - - - "); + if(MiscUtils.isOpenCLUnavailable()) + return; CLPlatform platform = CLPlatform.getDefault(); @@ -402,6 +413,8 @@ public class CLCommandQueueTest extends UITestCase { public void concurrencyTest() throws IOException, InterruptedException { out.println(" - - - QueueBarrier test - - - "); + if(MiscUtils.isOpenCLUnavailable()) + return; final int elements = ONE_MB / SIZEOF_INT * 10; // 20MB per buffer -- cgit v1.2.3