[arrayfire] 05/79: Added test to check the validity of the headers in C

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Jun 15 13:38:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository arrayfire.

commit c8ad7cbd2556c878c003e58f04907252b3caa380
Author: Umar Arshad <umar at arrayfire.com>
Date:   Wed Jun 3 23:39:41 2015 -0400

    Added test to check the validity of the headers in C
---
 test/CMakeLists.txt |  6 ++++--
 test/basic_c.c      | 17 +++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 80d6bf6..f98f5ff 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -12,7 +12,9 @@ MACRO(CREATE_TESTS BACKEND GTEST_LIBS OTHER_LIBS)
         SET(TEST_NAME ${FNAME}_${BACKEND})
 
         ADD_TEST(Test_${TEST_NAME} ${TEST_NAME})
-        ADD_EXECUTABLE(${TEST_NAME} ${FNAME}.cpp)
+
+        FILE(GLOB TEST_FILE "${FNAME}.cpp" "${FNAME}.c")
+        ADD_EXECUTABLE(${TEST_NAME} ${TEST_FILE})
         TARGET_LINK_LIBRARIES(${TEST_NAME}  af${BACKEND}
                       ${THREAD_LIB_FLAG}
                       ${GTEST_LIBS} ${OTHER_LIBS})
@@ -73,7 +75,7 @@ ENDIF()
 ENDIF(NOT ${USE_RELATIVE_TEST_DIR})
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-FILE(GLOB FILES "*.cpp")
+FILE(GLOB FILES "*.cpp" "*.c")
 
 IF(${BUILD_CPU})
     CREATE_TESTS(cpu "${GTEST_LIBRARIES}" "")
diff --git a/test/basic_c.c b/test/basic_c.c
new file mode 100644
index 0000000..c8ab564
--- /dev/null
+++ b/test/basic_c.c
@@ -0,0 +1,17 @@
+/*******************************************************
+ * Copyright (c) 2014, ArrayFire
+ * All rights reserved.
+ *
+ * This file is distributed under 3-clause BSD license.
+ * The complete license agreement can be obtained at:
+ * http://arrayfire.com/licenses/BSD-3-Clause
+ ********************************************************/
+
+#include "../include/arrayfire.h"
+
+int main() {
+    af_array out = 0;
+    dim_t s[] = {10, 10, 1, 1};
+    af_err e = af_randu(&out, 4, s, f32);
+    return (AF_SUCCESS != e);
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list