[opengtl-commits] [444] allow to use external data for the tests

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 444
Author:   cyrille
Date:     2008-10-10 09:17:28 +0200 (Fri, 10 Oct 2008)

Log Message:
-----------
allow to use external data for the tests

Modified Paths:
--------------
    trunk/OpenGTL/CMakeLists.txt
    trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt
    trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt
    trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt

Added Paths:
-----------
    trunk/OpenGTL/OpenShiva/tests/vectors/returnvector.shiva


Modified: trunk/OpenGTL/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/CMakeLists.txt	2008-10-10 07:13:41 UTC (rev 443)
+++ trunk/OpenGTL/CMakeLists.txt	2008-10-10 07:17:28 UTC (rev 444)
@@ -18,6 +18,8 @@
 set(SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/OpenGTL/)
 set(GTLIMAGEIO_EXTENSIONS_INSTALL_DIR ${SHARE_INSTALL_DIR}/GTLImageIO/Extensions)
 
+set(OPENGTL_TESTS_DATA "" CACHE FILEPATH "Directory that contains the data of the tests.")
+
 include (TestBigEndian)
 test_big_endian(CMAKE_WORDS_BIGENDIAN)
 configure_file(config-endian.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-endian.h )

Modified: trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt	2008-10-10 07:13:41 UTC (rev 443)
+++ trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt	2008-10-10 07:17:28 UTC (rev 444)
@@ -5,6 +5,6 @@
   )
 
 FOREACH( TEST_FILE ${TESTS_FILES} )
-  ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/../data/fontromeu.png ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE}.png)
+  ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/sources/fontromeu.png ${OPENGTL_TESTS_DATA}/results/${TEST_FILE}.png)
 ENDFOREACH( TEST_FILE )
 

Modified: trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt	2008-10-10 07:13:41 UTC (rev 443)
+++ trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt	2008-10-10 07:17:28 UTC (rev 444)
@@ -6,6 +6,6 @@
   )
 
 FOREACH( TEST_FILE ${TESTS_FILES} )
-  ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE}.png)
+  ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/results/${TEST_FILE}.png)
 ENDFOREACH( TEST_FILE )
 

Modified: trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt	2008-10-10 07:13:41 UTC (rev 443)
+++ trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt	2008-10-10 07:17:28 UTC (rev 444)
@@ -9,7 +9,7 @@
   )
 
 FOREACH( TEST_FILE ${TESTS_FILES} )
-  ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/../data/dsc_0006-23-07-2008.nef ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE}.png)
+  ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/sources/dsc_0006-23-07-2008.nef ${OPENGTL_TESTS_DATA}/results/${TEST_FILE}.png)
 ENDFOREACH( TEST_FILE )
 
-ADD_TEST(PixelGroupingPass2.shiva ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/PixelGroupingPass2.shiva ${CMAKE_CURRENT_SOURCE_DIR}/PixelGroupingPass1.shiva.png ${CMAKE_CURRENT_SOURCE_DIR}/PixelGroupingPass2.shiva.png)
+ADD_TEST(PixelGroupingPass2.shiva ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/PixelGroupingPass2.shiva ${OPENGTL_TESTS_DATA}/results/PixelGroupingPass1.shiva.png ${OPENGTL_TESTS_DATA}/results/PixelGroupingPass2.shiva.png)

Added: trunk/OpenGTL/OpenShiva/tests/vectors/returnvector.shiva
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/vectors/returnvector.shiva	                        (rev 0)
+++ trunk/OpenGTL/OpenShiva/tests/vectors/returnvector.shiva	2008-10-10 07:17:28 UTC (rev 444)
@@ -0,0 +1,20 @@
+kernel MyKernel
+{
+  void evaluatePixel(output pixel result)
+  {
+  }
+  float3 getV()
+  {
+    return float3(0.0,1.0,2.0);
+  }
+  int runTest()
+  {
+    int count = 0;
+    float3 v = getV();
+    if( v[0] != 0.0 ) ++count;
+    if( v[1] != 1.0 ) ++count;
+    if( v[2] != 2.0 ) ++count;
+    return count;
+    
+  }
+}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/