[CMake] Proper handling of ENABLE_API_TESTS build option
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 17:25:14 +0000 (17:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 17:25:14 +0000 (17:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=91221

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-07-13
Reviewed by Rob Buis.

.:

Make the flag reusable across the ports using CMake. We are about to enable the WTF,
WebCore and WebKit 2 API's at Tools/TestWebKitAPI and other ports using CMake can get
it almost for free.

* CMakeLists.txt:
* Source/cmake/OptionsEfl.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:

Source/WebKit:

Build unit tests only if ENABLE_API_TESTS is set.

* PlatformEfl.cmake:

Source/WebKit2:

Build unit tests only if ENABLE_API_TESTS is set.

* PlatformEfl.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122601 268f45cc-cd09-0410-ab3c-d52691b4dbfc

CMakeLists.txt
ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/PlatformEfl.cmake
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/cmake/OptionsEfl.cmake
Source/cmake/WebKitFeatures.cmake
Source/cmakeconfig.h.cmake

index 90ff03a..8071d61 100644 (file)
@@ -136,6 +136,13 @@ INCLUDE(OptionsCommon)
 INCLUDE(Options${PORT})
 
 # -----------------------------------------------------------------------------
+# Enable API unit tests and create a target for the test runner
+# -----------------------------------------------------------------------------
+IF (ENABLE_API_TESTS)
+    ENABLE_TESTING()
+ENDIF ()
+
+# -----------------------------------------------------------------------------
 # Install JavaScript shell
 # -----------------------------------------------------------------------------
 OPTION(SHOULD_INSTALL_JS_SHELL "generate an installation rule to install the built JavaScript shell")
index 8e44fee..7041f94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2012-07-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        [CMake] Proper handling of ENABLE_API_TESTS build option
+        https://bugs.webkit.org/show_bug.cgi?id=91221
+
+        Reviewed by Rob Buis.
+
+        Make the flag reusable across the ports using CMake. We are about to enable the WTF,
+        WebCore and WebKit 2 API's at Tools/TestWebKitAPI and other ports using CMake can get
+        it almost for free.
+
+        * CMakeLists.txt:
+        * Source/cmake/OptionsEfl.cmake:
+        * Source/cmake/WebKitFeatures.cmake:
+        * Source/cmakeconfig.h.cmake:
+
 2012-07-11  Matt Falkenhagen  <falken@chromium.org>
 
         Add dialog element feature toggle to InternalSettings
index 5dbabfd..7614d41 100644 (file)
@@ -1,3 +1,14 @@
+2012-07-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        [CMake] Proper handling of ENABLE_API_TESTS build option
+        https://bugs.webkit.org/show_bug.cgi?id=91221
+
+        Reviewed by Rob Buis.
+
+        Build unit tests only if ENABLE_API_TESTS is set.
+
+        * PlatformEfl.cmake:
+
 2012-07-12  Simon Hausmann  <simon.hausmann@nokia.com>
 
         Typo in path in generate-webkitversion.pl
index a3fd109..f6800af 100644 (file)
@@ -350,13 +350,15 @@ SET(EWKUnitTests_BINARIES
     test_ewk_view
 )
 
-FOREACH(testName ${EWKUnitTests_BINARIES})
-    ADD_EXECUTABLE(${testName} ${WEBKIT_EFL_TEST_DIR}/${testName}.cpp ${WEBKIT_EFL_TEST_DIR}/test_runner.cpp)
-    ADD_TEST(${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testName})
-    TARGET_LINK_LIBRARIES(${testName} ${EWKUnitTests_LIBRARIES} ewkTestUtils gtest pthread)
-    ADD_TARGET_PROPERTIES(${testName} LINK_FLAGS "${EWKUnitTests_LINK_FLAGS}")
-    SET_TARGET_PROPERTIES(${testName} PROPERTIES FOLDER "WebKit")
-ENDFOREACH()
+IF (ENABLE_API_TESTS)
+    FOREACH (testName ${EWKUnitTests_BINARIES})
+        ADD_EXECUTABLE(${testName} ${WEBKIT_EFL_TEST_DIR}/${testName}.cpp ${WEBKIT_EFL_TEST_DIR}/test_runner.cpp)
+        ADD_TEST(${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testName})
+        TARGET_LINK_LIBRARIES(${testName} ${EWKUnitTests_LIBRARIES} ewkTestUtils gtest pthread)
+        ADD_TARGET_PROPERTIES(${testName} LINK_FLAGS "${EWKUnitTests_LINK_FLAGS}")
+        SET_TARGET_PROPERTIES(${testName} PROPERTIES FOLDER "WebKit")
+    ENDFOREACH ()
+ENDIF ()
 
 IF (ENABLE_INSPECTOR)
     SET(WEB_INSPECTOR_DIR ${CMAKE_BINARY_DIR}/WebKit/efl/webinspector)
index 68b3515..37b28dd 100644 (file)
@@ -1,3 +1,14 @@
+2012-07-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        [CMake] Proper handling of ENABLE_API_TESTS build option
+        https://bugs.webkit.org/show_bug.cgi?id=91221
+
+        Reviewed by Rob Buis.
+
+        Build unit tests only if ENABLE_API_TESTS is set.
+
+        * PlatformEfl.cmake:
+
 2012-07-13  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL][WK2] Make new public Ewk headers as installable
index 5374ae9..9870e0e 100644 (file)
@@ -220,9 +220,11 @@ SET(EWK2UnitTests_BINARIES
     test_ewk2_view
 )
 
-FOREACH(testName ${EWK2UnitTests_BINARIES})
-    ADD_EXECUTABLE(${testName} ${WEBKIT2_EFL_TEST_DIR}/${testName}.cpp)
-    ADD_TEST(${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testName})
-    SET_TESTS_PROPERTIES(${testName} PROPERTIES TIMEOUT 60)
-    TARGET_LINK_LIBRARIES(${testName} ${EWK2UnitTests_LIBRARIES} ewk2UnitTestUtils gtest pthread)
-ENDFOREACH()
+IF (ENABLE_API_TESTS)
+    FOREACH (testName ${EWK2UnitTests_BINARIES})
+        ADD_EXECUTABLE(${testName} ${WEBKIT2_EFL_TEST_DIR}/${testName}.cpp)
+        ADD_TEST(${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testName})
+        SET_TESTS_PROPERTIES(${testName} PROPERTIES TIMEOUT 60)
+        TARGET_LINK_LIBRARIES(${testName} ${EWK2UnitTests_LIBRARIES} ewk2UnitTestUtils gtest pthread)
+    ENDFOREACH ()
+ENDIF ()
index 32ea383..889f22e 100644 (file)
@@ -16,12 +16,6 @@ ADD_DEFINITIONS(-DWTF_PLATFORM_EFL=1)
 SET(WTF_PLATFORM_EFL 1)
 
 # -----------------------------------------------------------------------------
-# Enable CTest for the public API unit testing
-# -----------------------------------------------------------------------------
-ENABLE_TESTING()
-SET(ENABLE_API_TESTS ON)
-
-# -----------------------------------------------------------------------------
 # Determine which font backend will be used
 # -----------------------------------------------------------------------------
 SET(ALL_FONT_BACKENDS freetype pango)
@@ -73,6 +67,7 @@ SET(THEME_BINARY_DIR ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
 SET(VERSION_SCRIPT "-Wl,--version-script,${CMAKE_MODULE_PATH}/eflsymbols.filter")
 
 WEBKIT_OPTION_BEGIN()
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BATTERY_STATUS ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BLOB ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_IMAGE_SET ON)
index 5cf3586..2e93826 100644 (file)
@@ -11,6 +11,7 @@ MACRO (WEBKIT_OPTION_DEFAULT_PORT_VALUE _name _value)
 ENDMACRO ()
 
 MACRO (WEBKIT_OPTION_BEGIN)
+    WEBKIT_OPTION_DEFINE(ENABLE_API_TESTS "Enable public API unit tests" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_3D_RENDERING "Toggle 3D rendering support" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_ACCELERATED_2D_CANVAS "Toggle accelerated 2D canvas support" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_ANIMATION_API "Toggle animation API support" OFF)
index 5158232..035bd10 100644 (file)
@@ -5,6 +5,7 @@
 #cmakedefine WEBKIT_USER_AGENT_MINOR_VERSION @WEBKIT_USER_AGENT_MINOR_VERSION@
 
 
+#cmakedefine01 ENABLE_API_TESTS
 #cmakedefine01 ENABLE_3D_RENDERING
 #cmakedefine01 ENABLE_ACCELERATED_2D_CANVAS
 #cmakedefine01 ENABLE_AS_IMAGE