浏览代码

Tests: Added test for check_prototype_definition.

Andreas Schneider 14 年之前
父节点
当前提交
93c56a7040
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      Tests/TryCompile/CMakeLists.txt

+ 13 - 0
Tests/TryCompile/CMakeLists.txt

@@ -232,3 +232,16 @@ IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
   CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES)
   TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes")
 ENDIF()
+
+#######################################################################
+#
+# also test that the check_prototype_definition macro works
+
+include(CheckPrototypeDefinition)
+
+check_prototype_definition(remove
+  "int remove(const char *pathname)"
+  "0"
+  "stdio.h"
+  TEST_REMOVE_PROTO)
+test_assert(TEST_REMOVE_PROTO "check_prototype_definition for remove() failed")