Skip to content

Commit dab7603

Browse files
authored
Single target testing (#6556)
Single target testing Enable building and testing via a single target (check) - require chakracore shared library to be built before the test run. Use that to run tests for debug builds and only build in release mode. Expand CI matrix to include OSX. Set timeout to 2 hours and make OSX debug build static (to work around #5876). For #6547
1 parent 1ad850b commit dab7603

File tree

3 files changed

+69
-29
lines changed

3 files changed

+69
-29
lines changed

CMakeLists.txt

+20-19
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,32 @@ if(NOT CHAKRACORE_BUILD_SH)
1010
option(INTL_ICU "Enable Intl" ON)
1111
option(EMBED_ICU "Build ICU within ChakraCore build" OFF)
1212
set(ICU_INCLUDE_PATH "" CACHE STRING "libicu iclude path")
13-
endif(NOT CHAKRACORE_BUILD_SH)
13+
else(NOT CHAKRACORE_BUILD_SH)
1414

15-
# Keep CMake from caching static/shared library
16-
# option. Otherwise, CMake fails to update cached
17-
# references
15+
# Keep CMake from caching static/shared library
16+
# option. Otherwise, CMake fails to update cached
17+
# references
1818

19-
# todo: create a sub cmake file to take care of _SH uncaching...
20-
if(SHARED_LIBRARY_SH)
19+
# todo: create a sub cmake file to take care of _SH uncaching...
20+
if(SHARED_LIBRARY_SH)
2121
unset(SHARED_LIBRARY_SH CACHE)
2222
unset(STATIC_LIBRARY_SH CACHE)
23-
unset(STATIC_LIBRARY CACHE)
24-
set(SHARED_LIBRARY 1)
25-
endif()
23+
unset(STATIC_LIBRARY CACHE)
24+
set(SHARED_LIBRARY 1)
25+
endif()
2626

27-
if(STATIC_LIBRARY_SH)
28-
unset(SHARED_LIBRARY_SH CACHE)
29-
unset(STATIC_LIBRARY_SH CACHE)
30-
unset(SHARED_LIBRARY CACHE)
31-
set(STATIC_LIBRARY 1)
32-
endif()
27+
if(STATIC_LIBRARY_SH)
28+
unset(SHARED_LIBRARY_SH CACHE)
29+
unset(STATIC_LIBRARY_SH CACHE)
30+
unset(SHARED_LIBRARY CACHE)
31+
set(STATIC_LIBRARY 1)
32+
endif()
3333

34-
if(LIBS_ONLY_BUILD_SH)
35-
unset(LIBS_ONLY_BUILD_SH CACHE)
36-
set(CC_LIBS_ONLY_BUILD 1)
37-
endif()
34+
if(LIBS_ONLY_BUILD_SH)
35+
unset(LIBS_ONLY_BUILD_SH CACHE)
36+
set(CC_LIBS_ONLY_BUILD 1)
37+
endif()
38+
endif(NOT CHAKRACORE_BUILD_SH)
3839

3940
if(CC_USES_SYSTEM_ARCH_SH OR NOT CHAKRACORE_BUILD_SH)
4041
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")

azure-pipelines.yml

+45-10
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,52 @@ trigger:
33
- release/*
44

55
jobs:
6-
- job: Linux
7-
timeoutInMinutes: 0
8-
pool:
9-
vmImage: 'ubuntu-latest'
6+
- job: CMake
7+
timeoutInMinutes: 120
108
strategy:
119
matrix:
12-
debug:
10+
Linux.Debug:
11+
image_name: 'ubuntu-latest'
12+
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
13+
build_type: 'Debug'
14+
test_target: 'check'
15+
libtype_flag: ''
16+
Linux.ReleaseWithDebug:
17+
image_name: 'ubuntu-latest'
18+
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
19+
build_type: 'RelWithDebInfo'
20+
test_target: 'check'
21+
libtype_flag: ''
22+
Linux.Release:
23+
image_name: 'ubuntu-latest'
24+
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
25+
build_type: 'Release'
26+
test_target: 'all'
27+
libtype_flag: ''
28+
OSX.Debug:
29+
image_name: 'macOS-latest'
30+
deps: 'brew install ninja icu4c'
1331
build_type: 'Debug'
14-
release_with_debug:
32+
test_target: 'check'
33+
libtype_flag: '-DSTATIC_LIBRARY=ON'
34+
OSX.ReleaseWithDebug:
35+
image_name: 'macOS-latest'
36+
deps: 'brew install ninja icu4c'
1537
build_type: 'RelWithDebInfo'
38+
test_target: 'check'
39+
libtype_flag: ''
40+
OSX.Release:
41+
image_name: 'macOS-latest'
42+
deps: 'brew install ninja icu4c'
43+
build_type: 'Release'
44+
test_target: 'all'
45+
libtype_flag: ''
1646

47+
pool:
48+
vmImage: $(image_name)
49+
1750
steps:
18-
- script: sudo apt-get install -y ninja-build clang libicu-dev
51+
- script: $(deps)
1952
displayName: 'Install dependencies'
2053

2154
- script: |
@@ -24,13 +57,15 @@ jobs:
2457
2558
- script: |
2659
cd build
27-
cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
60+
cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $LIBTYPE -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
2861
displayName: CMake
2962
env:
3063
BUILD_TYPE: $(build_type)
64+
LIBTYPE: $(libtype_flag)
3165
3266
- script: |
3367
cd build
34-
ninja
35-
ninja check
68+
ninja $TARGET
3669
displayName: 'Build and test'
70+
env:
71+
TARGET: $(test_target)

test/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ add_custom_target(check
1515
DEPENDS ch
1616
)
1717

18+
if (NOT STATIC_LIBRARY)
19+
add_dependencies(check ChakraCore)
20+
endif()
21+

0 commit comments

Comments
 (0)