Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single target testing #6556

Merged
merged 8 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,32 @@ if(NOT CHAKRACORE_BUILD_SH)
option(INTL_ICU "Enable Intl" ON)
option(EMBED_ICU "Build ICU within ChakraCore build" OFF)
set(ICU_INCLUDE_PATH "" CACHE STRING "libicu iclude path")
endif(NOT CHAKRACORE_BUILD_SH)
else(NOT CHAKRACORE_BUILD_SH)

# Keep CMake from caching static/shared library
# option. Otherwise, CMake fails to update cached
# references
# Keep CMake from caching static/shared library
# option. Otherwise, CMake fails to update cached
# references

# todo: create a sub cmake file to take care of _SH uncaching...
if(SHARED_LIBRARY_SH)
# todo: create a sub cmake file to take care of _SH uncaching...
if(SHARED_LIBRARY_SH)
unset(SHARED_LIBRARY_SH CACHE)
unset(STATIC_LIBRARY_SH CACHE)
unset(STATIC_LIBRARY CACHE)
set(SHARED_LIBRARY 1)
endif()
unset(STATIC_LIBRARY CACHE)
set(SHARED_LIBRARY 1)
endif()

if(STATIC_LIBRARY_SH)
unset(SHARED_LIBRARY_SH CACHE)
unset(STATIC_LIBRARY_SH CACHE)
unset(SHARED_LIBRARY CACHE)
set(STATIC_LIBRARY 1)
endif()
if(STATIC_LIBRARY_SH)
unset(SHARED_LIBRARY_SH CACHE)
unset(STATIC_LIBRARY_SH CACHE)
unset(SHARED_LIBRARY CACHE)
set(STATIC_LIBRARY 1)
endif()

if(LIBS_ONLY_BUILD_SH)
unset(LIBS_ONLY_BUILD_SH CACHE)
set(CC_LIBS_ONLY_BUILD 1)
endif()
if(LIBS_ONLY_BUILD_SH)
unset(LIBS_ONLY_BUILD_SH CACHE)
set(CC_LIBS_ONLY_BUILD 1)
endif()
endif(NOT CHAKRACORE_BUILD_SH)

if(CC_USES_SYSTEM_ARCH_SH OR NOT CHAKRACORE_BUILD_SH)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
Expand Down
55 changes: 45 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,52 @@ trigger:
- release/*

jobs:
- job: Linux
timeoutInMinutes: 0
pool:
vmImage: 'ubuntu-latest'
- job: CMake
timeoutInMinutes: 120
strategy:
matrix:
debug:
Linux.Debug:
image_name: 'ubuntu-latest'
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
build_type: 'Debug'
test_target: 'check'
libtype_flag: ''
Linux.ReleaseWithDebug:
image_name: 'ubuntu-latest'
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
build_type: 'RelWithDebInfo'
test_target: 'check'
libtype_flag: ''
Linux.Release:
image_name: 'ubuntu-latest'
deps: 'sudo apt-get install -y ninja-build clang libicu-dev'
build_type: 'Release'
test_target: 'all'
libtype_flag: ''
OSX.Debug:
image_name: 'macOS-latest'
deps: 'brew install ninja icu4c'
ppenzin marked this conversation as resolved.
Show resolved Hide resolved
build_type: 'Debug'
release_with_debug:
test_target: 'check'
libtype_flag: '-DSTATIC_LIBRARY=ON'
OSX.ReleaseWithDebug:
image_name: 'macOS-latest'
deps: 'brew install ninja icu4c'
build_type: 'RelWithDebInfo'
test_target: 'check'
libtype_flag: ''
OSX.Release:
image_name: 'macOS-latest'
deps: 'brew install ninja icu4c'
build_type: 'Release'
test_target: 'all'
libtype_flag: ''

pool:
vmImage: $(image_name)

steps:
- script: sudo apt-get install -y ninja-build clang libicu-dev
- script: $(deps)
displayName: 'Install dependencies'

- script: |
Expand All @@ -24,13 +57,15 @@ jobs:

- script: |
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
cmake -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $LIBTYPE -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
displayName: CMake
env:
BUILD_TYPE: $(build_type)
LIBTYPE: $(libtype_flag)

- script: |
cd build
ninja
ninja check
ninja $TARGET
displayName: 'Build and test'
env:
TARGET: $(test_target)
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ add_custom_target(check
DEPENDS ch
)

if (NOT STATIC_LIBRARY)
add_dependencies(check ChakraCore)
endif()