[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 90ff03ab78add92e685a43c5e6238652e13e3ada..8071d61f97ac3b8ec75cb458fbd93b53f239462b 100644 (file)
@@ -135,6 +135,13 @@ SET(WebCoreTestSupport_LIBRARY_TYPE STATIC)
 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
 # -----------------------------------------------------------------------------
index 8e44fee522ecb0419ea1e28db2b772ef5e72cb2e..7041f9483104cf27bb9f2f3a0cf693407dfd90a5 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 5dbabfd50d6eb40e09e4c8e23d89f885ceb2aa85..7614d4154d87391e552b42dfa8ddae287d69b656 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 a3fd109119c05f4e78da34950de6b1f4c17304ad..f6800af57e17dbcf4b886868007b7752b76f4c7d 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 68b3515446a400223cd39f92f71494d2e632b16b..37b28dda22451ca6781032d80008a4c2b2c71712 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 5374ae95c6432d70230dd20f8b341db7e258f075..9870e0e2e925a83f9a70eb52adf2e9ef3b01f3f1 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 32ea38363b5a8c1a8c90f07e141a62019ea6cea6..889f22e64a8c97cf460af01c86f02fc6f0c5fb12 100644 (file)
@@ -15,12 +15,6 @@ ADD_DEFINITIONS(-DBUILDING_EFL__=1)
 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
 # -----------------------------------------------------------------------------
@@ -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 5cf3586cf2f6231b0daee61faaf8df573abb04aa..2e93826f6e94ecfe106df2aa58bbe50d1103d658 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 515823221ec6d28ed7f12d8741127531ba5c3a15..035bd10eb766475992ca923b186e6f02691a848e 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