Skip to content

Commit d6e2800

Browse files
committed
Apple Silicon Test Suite updates
- update DateTimeFormat.js which required ICU_Version<72 - update ICU path for native tests (different on Apple Silicon) - use find_package for Python
1 parent af58421 commit d6e2800

File tree

11 files changed

+89
-28
lines changed

11 files changed

+89
-28
lines changed

test/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
find_package (Python COMPONENTS Interpreter)
2+
13
if (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
24
set(TEST_BUILD_TYPE --test)
35
elseif (CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -31,13 +33,13 @@ if (CMAKE_BUILD_TYPE STREQUAL Release)
3133
add_dependencies(check smoke-check)
3234
else()
3335
add_custom_target(bytecode-check
34-
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../tools/regenByteCode.py ${VARIANT} --verify --binary=${CMAKE_BINARY_DIR}/ch
36+
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../tools/regenByteCode.py ${VARIANT} --verify --binary=${CMAKE_BINARY_DIR}/ch
3537
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
3638
USES_TERMINAL
3739
DEPENDS ch
3840
)
3941
add_custom_target(regression-check
40-
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/runtests.py ${TEST_BUILD_TYPE} ${TEST_ICU} ${TEST_VARIANT} --binary=${CMAKE_BINARY_DIR}/ch
42+
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/runtests.py ${TEST_BUILD_TYPE} ${TEST_ICU} ${TEST_VARIANT} --binary=${CMAKE_BINARY_DIR}/ch
4143
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
4244
USES_TERMINAL
4345
DEPENDS ch

test/Intl/DateTimeFormat.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56

@@ -63,18 +64,22 @@ const tests = [
6364
test({ day: "2-digit" }, "01");
6465
test({ day: "numeric" }, "1");
6566

66-
test({ hour: "2-digit" }, "01 AM");
67-
test({ hour: "numeric" }, "1 AM");
67+
if(!isICU || WScript.Platform.ICU_VERSION < 72)
68+
{
69+
test({ hour: "2-digit" }, "01 AM");
70+
test({ hour: "numeric" }, "1 AM");
6871

69-
test({ hour: "numeric", minute: "2-digit" }, "1:01 AM");
70-
test({ hour: "numeric", minute: "numeric" }, "1:01 AM");
72+
test({ hour: "numeric", minute: "2-digit" }, "1:01 AM");
73+
test({ hour: "numeric", minute: "numeric" }, "1:01 AM");
7174

72-
test({ hour: "numeric", minute: "2-digit", second: "2-digit" }, "1:01:01 AM");
75+
test({ hour: "numeric", minute: "2-digit", second: "2-digit" }, "1:01:01 AM");
7376

74-
// WinGlob doesn't have non-2-digit seconds
75-
testPlatformSpecific({ hour: "numeric", minute: "2-digit", second: "numeric" }, "1:01:01 AM", "1:01:1 AM");
77+
// WinGlob doesn't have non-2-digit seconds
78+
testPlatformSpecific({ hour: "numeric", minute: "2-digit", second: "numeric" }, "1:01:01 AM", "1:01:1 AM");
79+
80+
test({ hour: "numeric", hour12: true }, "1 AM");
81+
}
7682

77-
test({ hour: "numeric", hour12: true }, "1 AM");
7883
testPlatformSpecific({ hour: "numeric", hour12: false }, "1:00", "01");
7984

8085
const epochYear = parseInt(ascii(new Intl.DateTimeFormat("en-US", { year: "numeric", timeZone: "UTC" }).format(0)), 10);

test/native-tests/test-shared-basic/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -14,6 +14,7 @@ if (isStaticBuild) {
1414
print("# IGNORE_THIS_TEST");
1515
} else {
1616
var platform = WScript.Platform.OS;
17+
var arch = WScript.Platform.ARCH;
1718
var binaryPath = WScript.Platform.BINARY_PATH;
1819
// discard `ch` from path
1920
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -22,10 +23,15 @@ if (isStaticBuild) {
2223
\n\
2324
LIBRARY_PATH=" + binaryPath + "/\n\
2425
PLATFORM=" + platform + "\n\
26+
ARCH=" + arch + "\n\
2527
LDIR=$(LIBRARY_PATH)/libChakraCore" + sharedExtension + " \n\
2628
\n\
2729
ifeq (darwin, ${PLATFORM})\n\
28-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
30+
\tifeq (ARM64, ${ARCH})\n\
31+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
32+
\t\else\n\
33+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
34+
\tendif\n\
2935
\tCFLAGS=-lstdc++ -std=c++11 -I$(IDIR)\n\
3036
\tFORCE_STARTS=-Wl,-force_load,\n\
3137
\tFORCE_ENDS=\n\

test/native-tests/test-static-c98/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -13,6 +13,7 @@ if (!isStaticBuild) {
1313
print("# IGNORE_THIS_TEST");
1414
} else {
1515
var platform = WScript.Platform.OS;
16+
var arch = WScript.Platform.ARCH;
1617
var binaryPath = WScript.Platform.BINARY_PATH;
1718
// discard `ch` from path
1819
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -21,10 +22,15 @@ if (!isStaticBuild) {
2122
\n\
2223
LIBRARY_PATH=" + binaryPath + "/lib\n\
2324
PLATFORM=" + platform + "\n\
25+
ARCH=" + arch + "\n\
2426
LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
2527
\n\
2628
ifeq (darwin, ${PLATFORM})\n\
27-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
29+
\tifeq (ARM64, ${ARCH})\n\
30+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
31+
\t\else\n\
32+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
33+
\tendif\n\
2834
\tCFLAGS=-lstdc++ -std=c++98 -I$(IDIR)\n\
2935
\tFORCE_STARTS=-Wl,-force_load,\n\
3036
\tFORCE_ENDS=\n\

test/native-tests/test-static-char/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -13,6 +13,7 @@ if (!isStaticBuild) {
1313
print("# IGNORE_THIS_TEST");
1414
} else {
1515
var platform = WScript.Platform.OS;
16+
var arch = WScript.Platform.ARCH;
1617
var binaryPath = WScript.Platform.BINARY_PATH;
1718
// discard `ch` from path
1819
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -21,10 +22,15 @@ if (!isStaticBuild) {
2122
\n\
2223
LIBRARY_PATH=" + binaryPath + "/lib\n\
2324
PLATFORM=" + platform + "\n\
25+
ARCH=" + arch + "\n\
2426
LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
2527
\n\
2628
ifeq (darwin, ${PLATFORM})\n\
27-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
29+
\tifeq (ARM64, ${ARCH})\n\
30+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
31+
\t\else\n\
32+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
33+
\tendif\n\
2834
\tCFLAGS=-lstdc++ -I$(IDIR)\n\
2935
\tFORCE_STARTS=-Wl,-force_load,\n\
3036
\tFORCE_ENDS=\n\

test/native-tests/test-static-char16/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -13,6 +13,7 @@ if (!isStaticBuild) {
1313
print("# IGNORE_THIS_TEST");
1414
} else {
1515
var platform = WScript.Platform.OS;
16+
var arch = WScript.Platform.ARCH;
1617
var binaryPath = WScript.Platform.BINARY_PATH;
1718
// discard `ch` from path
1819
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -21,10 +22,15 @@ if (!isStaticBuild) {
2122
\n\
2223
LIBRARY_PATH=" + binaryPath + "/lib\n\
2324
PLATFORM=" + platform + "\n\
25+
ARCH=" + arch + "\n\
2426
LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
2527
\n\
2628
ifeq (darwin, ${PLATFORM})\n\
27-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
29+
\tifeq (ARM64, ${ARCH})\n\
30+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
31+
\t\else\n\
32+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
33+
\tendif\n\
2834
\tCFLAGS=-lstdc++ -std=c++11 -I$(IDIR)\n\
2935
\tFORCE_STARTS=-Wl,-force_load,\n\
3036
\tFORCE_ENDS=\n\

test/native-tests/test-static-external/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -13,6 +13,7 @@ if (!isStaticBuild) {
1313
print("# IGNORE_THIS_TEST");
1414
} else {
1515
var platform = WScript.Platform.OS;
16+
var arch = WScript.Platform.ARCH;
1617
var binaryPath = WScript.Platform.BINARY_PATH;
1718
// discard `ch` from path
1819
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -21,10 +22,15 @@ if (!isStaticBuild) {
2122
\n\
2223
LIBRARY_PATH=" + binaryPath + "/lib\n\
2324
PLATFORM=" + platform + "\n\
25+
ARCH=" + arch + "\n\
2426
LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
2527
\n\
2628
ifeq (darwin, ${PLATFORM})\n\
27-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
29+
\tifeq (ARM64, ${ARCH})\n\
30+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
31+
\t\else\n\
32+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
33+
\tendif\n\
2834
\tCFLAGS=-lstdc++ -std=c++11 -I$(IDIR)\n\
2935
\tFORCE_STARTS=-Wl,-force_load,\n\
3036
\tFORCE_ENDS=\n\

test/native-tests/test-static-native/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -13,6 +13,7 @@ if (!isStaticBuild) {
1313
print("# IGNORE_THIS_TEST");
1414
} else {
1515
var platform = WScript.Platform.OS;
16+
var arch = WScript.Platform.ARCH;
1617
var binaryPath = WScript.Platform.BINARY_PATH;
1718
// discard `ch` from path
1819
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -21,10 +22,15 @@ if (!isStaticBuild) {
2122
\n\
2223
LIBRARY_PATH=" + binaryPath + "/lib\n\
2324
PLATFORM=" + platform + "\n\
25+
ARCH=" + arch + "\n\
2426
LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
2527
\n\
2628
ifeq (darwin, ${PLATFORM})\n\
27-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
29+
\tifeq (ARM64, ${ARCH})\n\
30+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
31+
\t\else\n\
32+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
33+
\tendif\n\
2834
\tCFLAGS=-lstdc++ -std=c++11 -I$(IDIR)\n\
2935
\tFORCE_STARTS=-Wl,-force_load,\n\
3036
\tFORCE_ENDS=\n\

test/native-tests/test-static-pal/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -13,6 +13,7 @@ if (!isStaticBuild) {
1313
print("# IGNORE_THIS_TEST");
1414
} else {
1515
var platform = WScript.Platform.OS;
16+
var arch = WScript.Platform.ARCH;
1617
var binaryPath = WScript.Platform.BINARY_PATH;
1718
// discard `ch` from path
1819
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -23,10 +24,15 @@ IDIR=" + WScript.Arguments[0] + "/lib/Jsrt \n\
2324
\n\
2425
LIBRARY_PATH=" + binaryPath + "/lib\n\
2526
PLATFORM=" + platform + "\n\
27+
ARCH=" + arch + "\n\
2628
LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
2729
\n\
2830
ifeq (darwin, ${PLATFORM})\n\
29-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
31+
\tifeq (ARM64, ${ARCH})\n\
32+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
33+
\t\else\n\
34+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
35+
\tendif\n\
3036
\tCFLAGS=-lstdc++ -std=c++11 -I$(IDIR) -I$(ROOT) -I$(ROOT)/pal/inc/rt -I$(ROOT)/pal/inc -I$(ROOT)/pal -fms-extensions\n\
3137
\tFORCE_STARTS=-Wl,-force_load,\n\
3238
\tFORCE_ENDS=\n\

test/native-tests/test-static-property-symbol/Platform.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66

@@ -13,6 +13,7 @@ if (!isStaticBuild) {
1313
print("# IGNORE_THIS_TEST");
1414
} else {
1515
var platform = WScript.Platform.OS;
16+
var arch = WScript.Platform.ARCH;
1617
var binaryPath = WScript.Platform.BINARY_PATH;
1718
// discard `ch` from path
1819
binaryPath = binaryPath.substr(0, binaryPath.lastIndexOf(path_sep));
@@ -21,10 +22,15 @@ if (!isStaticBuild) {
2122
\n\
2223
LIBRARY_PATH=" + binaryPath + "/lib\n\
2324
PLATFORM=" + platform + "\n\
25+
ARCH=" + arch + "\n\
2426
LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
2527
\n\
2628
ifeq (darwin, ${PLATFORM})\n\
27-
\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
29+
\tifeq (ARM64, ${ARCH})\n\
30+
\t\tICU4C_LIBRARY_PATH ?= /opt/homebrew/opt/icu4c\n\
31+
\t\else\n\
32+
\t\tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\
33+
\tendif\n\
2834
\tCFLAGS=-lstdc++ -std=c++11 -I$(IDIR)\n\
2935
\tFORCE_STARTS=-Wl,-force_load,\n\
3036
\tFORCE_ENDS=\n\

0 commit comments

Comments
 (0)