Changeset 217182 in webkit


Ignore:
Timestamp:
May 19, 2017 8:31:28 PM (7 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Enable testapi on Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=172354

Reviewed by Alex Christensen.

This patch makes testapi buildable and runnable for Mac CMake port.

  • API/tests/DateTests.mm:

(+[DateTests JSDateToNSDateTest]):
(+[DateTests roundTripThroughJSDateTest]):
This test only works with the en_US locale.

  • shell/CMakeLists.txt:
  • shell/PlatformMac.cmake:

Some of tests rely on ARC. We enable ARC for those files.

  • shell/PlatformWin.cmake:

Clean up.

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/tests/DateTests.mm

    r179450 r217182  
    6868    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    6969    [formatter setDateFormat:@"MMMM dd',' yyyy hh:mm:ss"];
     70    [formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
    7071    NSDate *februaryFourth2014 = [formatter dateFromString:@"February 4, 2014 11:40:03"];
    7172    NSDateComponents *components = [[NSCalendar currentCalendar] components:unitFlags fromDate:februaryFourth2014];
     
    9495    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    9596    [formatter setDateFormat:@"MMMM dd',' yyyy hh:mm:ss"];
     97    [formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
    9698    NSDate *februaryFourth2014 = [formatter dateFromString:@"February 4, 2014 11:40:03"];
    9799    NSDateComponents *components = [[NSCalendar currentCalendar] components:unitFlags fromDate:februaryFourth2014];
  • trunk/Source/JavaScriptCore/ChangeLog

    r217179 r217182  
     12017-05-19  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] Enable testapi on Mac CMake build
     4        https://bugs.webkit.org/show_bug.cgi?id=172354
     5
     6        Reviewed by Alex Christensen.
     7
     8        This patch makes testapi buildable and runnable for Mac CMake port.
     9
     10        * API/tests/DateTests.mm:
     11        (+[DateTests JSDateToNSDateTest]):
     12        (+[DateTests roundTripThroughJSDateTest]):
     13        This test only works with the en_US locale.
     14
     15        * shell/CMakeLists.txt:
     16        * shell/PlatformMac.cmake:
     17        Some of tests rely on ARC. We enable ARC for those files.
     18
     19        * shell/PlatformWin.cmake:
     20        Clean up.
     21
    1222017-05-19  Mark Lam  <mark.lam@apple.com>
    223
  • trunk/Source/JavaScriptCore/shell/CMakeLists.txt

    r216914 r217182  
    1717endif ()
    1818
     19set(TESTAPI_SOURCES
     20    ../API/tests/CompareAndSwapTest.cpp
     21    ../API/tests/CustomGlobalObjectClassTest.c
     22    ../API/tests/ExecutionTimeLimitTest.cpp
     23    ../API/tests/FunctionOverridesTest.cpp
     24    ../API/tests/GlobalContextWithFinalizerTest.cpp
     25    ../API/tests/JSONParseTest.cpp
     26    ../API/tests/JSObjectGetProxyTargetTest.cpp
     27    ../API/tests/MultithreadedMultiVMExecutionTest.cpp
     28    ../API/tests/PingPongStackOverflowTest.cpp
     29    ../API/tests/TypedArrayCTest.cpp
     30    ../API/tests/testapi.c
     31)
     32
    1933WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
    2034
    2135WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
     36WEBKIT_WRAP_SOURCELIST(${TESTAPI_SOURCES})
    2237include_directories(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
    2338include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
     
    5671    target_link_libraries(testair ${JSC_LIBRARIES})
    5772
    58     set(TESTAPI_SOURCES
    59         ../API/tests/CompareAndSwapTest.cpp
    60         ../API/tests/CustomGlobalObjectClassTest.c
    61         ../API/tests/ExecutionTimeLimitTest.cpp
    62         ../API/tests/FunctionOverridesTest.cpp
    63         ../API/tests/GlobalContextWithFinalizerTest.cpp
    64         ../API/tests/JSONParseTest.cpp
    65         ../API/tests/JSObjectGetProxyTargetTest.cpp
    66         ../API/tests/MultithreadedMultiVMExecutionTest.cpp
    67         ../API/tests/PingPongStackOverflowTest.cpp
    68         ../API/tests/TypedArrayCTest.cpp
    69         ../API/tests/testapi.c
    70     )
    7173    add_executable(testapi ${TESTAPI_SOURCES})
    7274    target_link_libraries(testapi ${JSC_LIBRARIES})
     75endif ()
    7376
    74     file(COPY
    75         "${JAVASCRIPTCORE_DIR}/API/tests/testapi.js"
    76         DESTINATION
    77         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
    78     )
    79     file(COPY
    80         "${JAVASCRIPTCORE_DIR}/API/tests/testapi-function-overrides.js"
    81         DESTINATION
    82         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
    83     )
    84 endif ()
     77file(COPY
     78    "${JAVASCRIPTCORE_DIR}/API/tests/testapi.js"
     79    DESTINATION
     80    ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
     81)
     82file(COPY
     83    "${JAVASCRIPTCORE_DIR}/API/tests/testapi-function-overrides.js"
     84    DESTINATION
     85    ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
     86)
  • trunk/Source/JavaScriptCore/shell/PlatformMac.cmake

    r216924 r217182  
    1 list(APPEND TESTAPI_SOURCES
     1set(TESTAPI_OBJC_SOURCES
    22    ../API/tests/CurrentThisInsideBlockGetterTest.mm
    33    ../API/tests/DateTests.mm
     
    77    ../API/tests/testapi.mm
    88)
     9list(APPEND TESTAPI_SOURCES ${TESTAPI_OBJC_SOURCES})
     10
     11set_source_files_properties(${TESTAPI_OBJC_SOURCES} PROPERTIES COMPILE_FLAGS -fobjc-arc)
  • trunk/Source/JavaScriptCore/shell/PlatformWin.cmake

    r216460 r217182  
    2626target_link_libraries(testRegExpLib JavaScriptCore)
    2727
    28 add_library(testapiLib SHARED
    29     ../API/tests/CompareAndSwapTest.cpp
    30     ../API/tests/CustomGlobalObjectClassTest.c
    31     ../API/tests/ExecutionTimeLimitTest.cpp
    32     ../API/tests/FunctionOverridesTest.cpp
    33     ../API/tests/GlobalContextWithFinalizerTest.cpp
    34     ../API/tests/JSONParseTest.cpp
    35     ../API/tests/JSObjectGetProxyTargetTest.cpp
    36     ../API/tests/PingPongStackOverflowTest.cpp
    37     ../API/tests/MultithreadedMultiVMExecutionTest.cpp
    38     ../API/tests/testapi.c
    39     ../API/tests/TypedArrayCTest.cpp
    40 )
     28add_library(testapiLib SHARED ${TESTAPI_SOURCES})
    4129set_source_files_properties(../API/tests/CustomGlobalObjectClassTest.c PROPERTIES COMPILE_FLAGS "/TP /MT")
    4230set_source_files_properties(../API/tests/testapi.c PROPERTIES COMPILE_FLAGS "/TP /MT")
     
    4634add_dependencies(testapi testapiLib)
    4735target_link_libraries(testapiLib JavaScriptCore)
    48 
    49 file(COPY
    50     "${JAVASCRIPTCORE_DIR}/API/tests/testapi.js"
    51     DESTINATION
    52     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
    53 )
    54 file(COPY
    55     "${JAVASCRIPTCORE_DIR}/API/tests/testapi-function-overrides.js"
    56     DESTINATION
    57     ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
    58 )
Note: See TracChangeset for help on using the changeset viewer.