Compare commits
No commits in common. "3eb98c1e8125287ec6e4ab33ab75981bf16a2511" and "3998c4127a615bbdaf5eca9e95ae15005d4757c6" have entirely different histories.
3eb98c1e81
...
3998c4127a
6 changed files with 10 additions and 77 deletions
14
.drone.yml
14
.drone.yml
|
@ -25,13 +25,13 @@ trigger:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: unit tests
|
- name: unit tests
|
||||||
image: amd64_gcc_unit_tests:latest
|
image: unit_tests:latest
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
commands:
|
commands:
|
||||||
- ./tools/ci/amd64/gcc/unit_tests.sh
|
- ./tools/ci/amd64/gcc/unit_tests.sh
|
||||||
|
|
||||||
- name: valgrind
|
- name: valgrind
|
||||||
image: amd64_gcc_valgrind:latest
|
image: valgrind:latest
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
commands:
|
commands:
|
||||||
- ./tools/ci/amd64/gcc/valgrind.sh
|
- ./tools/ci/amd64/gcc/valgrind.sh
|
||||||
|
@ -45,20 +45,14 @@ trigger:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: code coverage
|
|
||||||
image: amd64_clang_coverage:latest
|
|
||||||
pull: if-not-exists
|
|
||||||
commands:
|
|
||||||
- ./tools/ci/amd64/clang/coverage.sh
|
|
||||||
|
|
||||||
- name: leak sanitizer
|
- name: leak sanitizer
|
||||||
image: amd64_clang_lsan:latest
|
image: leak_sanitizer:latest
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
commands:
|
commands:
|
||||||
- ./tools/ci/amd64/clang/lsan.sh
|
- ./tools/ci/amd64/clang/lsan.sh
|
||||||
|
|
||||||
- name: memory sanitizer
|
- name: memory sanitizer
|
||||||
image: amd64_clang_msan:latest
|
image: memory_sanitizer:latest
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
commands:
|
commands:
|
||||||
- ./tools/ci/amd64/clang/msan.sh
|
- ./tools/ci/amd64/clang/msan.sh
|
||||||
|
|
|
@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.14)
|
||||||
project(Light)
|
project(Light)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
|
||||||
add_option(ENABLE_TESTS "Enables the building of the test modules")
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/functions.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/functions.cmake)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/definitions.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/definitions.cmake)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/dependencies.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/dependencies.cmake)
|
||||||
|
@ -12,15 +11,6 @@ if (ENABLE_STATIC_ANALYSIS)
|
||||||
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;--warnings-as-errors=*;--allow-no-checks")
|
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;--warnings-as-errors=*;--allow-no-checks")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_option(ENABLE_LCOV "Enables the code coverage instrumentation for clang")
|
add_option(ENABLE_TESTS "Enables the building of the test modules")
|
||||||
if(ENABLE_LCOV)
|
|
||||||
if (CMAKE_CXX_COMPILER_ID NOT STREQUAL "Clang")
|
|
||||||
message(FATAL_ERROR "ENABLE_LCOV option is only supported when compiling with clang")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
|
|
||||||
add_link_options(-fprofile-instr-generate -fcoverage-mapping)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/glad)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/glad)
|
||||||
|
|
|
@ -12,7 +12,6 @@ class LightRecipe(ConanFile):
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
"enable_tests": [True, False],
|
"enable_tests": [True, False],
|
||||||
"enable_lcov": [True, False],
|
|
||||||
"enable_static_analysis": [True, False],
|
"enable_static_analysis": [True, False],
|
||||||
"use_mold": [True, False],
|
"use_mold": [True, False],
|
||||||
"export_compile_commands": [True, False],
|
"export_compile_commands": [True, False],
|
||||||
|
@ -20,7 +19,6 @@ class LightRecipe(ConanFile):
|
||||||
|
|
||||||
default_options = {
|
default_options = {
|
||||||
"enable_tests": True,
|
"enable_tests": True,
|
||||||
"enable_lcov": False,
|
|
||||||
"enable_static_analysis": False,
|
"enable_static_analysis": False,
|
||||||
"use_mold": False,
|
"use_mold": False,
|
||||||
"export_compile_commands": True,
|
"export_compile_commands": True,
|
||||||
|
@ -46,9 +44,8 @@ class LightRecipe(ConanFile):
|
||||||
tc.cache_variables["CMAKE_LINKER_TYPE"] = "MOLD"
|
tc.cache_variables["CMAKE_LINKER_TYPE"] = "MOLD"
|
||||||
|
|
||||||
tc.cache_variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = self.options.export_compile_commands
|
tc.cache_variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = self.options.export_compile_commands
|
||||||
tc.cache_variables["ENABLE_TESTS"] = self.options.enable_tests
|
|
||||||
tc.cache_variables["ENABLE_LCOV"] = self.options.enable_lcov
|
|
||||||
tc.cache_variables["ENABLE_STATIC_ANALYSIS"] = self.options.enable_static_analysis
|
tc.cache_variables["ENABLE_STATIC_ANALYSIS"] = self.options.enable_static_analysis
|
||||||
|
tc.cache_variables["ENABLE_TESTS"] = self.options.enable_tests
|
||||||
|
|
||||||
repo = git.Repo(search_parent_directories=True)
|
repo = git.Repo(search_parent_directories=True)
|
||||||
tc.cache_variables["GIT_HASH"] = repo.head.object.hexsha
|
tc.cache_variables["GIT_HASH"] = repo.head.object.hexsha
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
FROM archlinux:latest
|
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm && \
|
|
||||||
pacman -S --noconfirm \
|
|
||||||
bash \
|
|
||||||
base-devel \
|
|
||||||
git \
|
|
||||||
cmake \
|
|
||||||
ninja \
|
|
||||||
python \
|
|
||||||
python-pip \
|
|
||||||
clang \
|
|
||||||
llvm \
|
|
||||||
mesa \
|
|
||||||
mold \
|
|
||||||
ninja \
|
|
||||||
curl \
|
|
||||||
wget \
|
|
||||||
zlib
|
|
||||||
|
|
||||||
RUN pip install --no-cache-dir --break-system-packages conan gitpython \
|
|
||||||
&& conan profile detect
|
|
||||||
|
|
||||||
RUN clang --version \
|
|
||||||
&& pip --version \
|
|
||||||
&& conan --version \
|
|
||||||
&& cmake --version \
|
|
||||||
&& g++ --version \
|
|
||||||
&& clang --version \
|
|
||||||
&& ninja --version \
|
|
||||||
&& mold --version \
|
|
||||||
&& llvm-profdata --version \
|
|
||||||
&& llvm-cov --version
|
|
||||||
|
|
||||||
RUN git clone 'https://git.light7734.com/light7734/light.git' \
|
|
||||||
&& cd light; git checkout 'ci/code_cov' \
|
|
||||||
&& conan build . \
|
|
||||||
-c tools.system.package_manager:mode=install \
|
|
||||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
|
||||||
-c tools.build:compiler_executables='{"c": "clang", "cpp": "clang++"}' \
|
|
||||||
-s build_type=Release \
|
|
||||||
-s compiler=clang \
|
|
||||||
-s compiler.version=20 \
|
|
||||||
-s compiler.libcxx=libc++ \
|
|
||||||
-o use_mold=True \
|
|
||||||
-o enable_lcov=True \
|
|
||||||
--build=missing \
|
|
||||||
&& rm -r ../light/
|
|
|
@ -7,13 +7,16 @@ rm -rf ./build
|
||||||
conan build . \
|
conan build . \
|
||||||
-c tools.system.package_manager:mode=install \
|
-c tools.system.package_manager:mode=install \
|
||||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||||
|
-c tools.build:cxxflags='["-fprofile-instr-generate", "-fcoverage-mapping"]' \
|
||||||
|
-c tools.build:sharedlinkflags='["-fprofile-instr-generate", "-fcoverage-mapping"]' \
|
||||||
|
-c tools.build:exelinkflags='["-fprofile-instr-generate", "-fcoverage-mapping"]' \
|
||||||
|
-c tools.info.package_id:confs='["tools.build:cxxflags","tools.build:sharedlinkflags","tools.build:exelinkflags"]' \
|
||||||
-c tools.build:compiler_executables='{"c": "clang", "cpp": "clang++"}' \
|
-c tools.build:compiler_executables='{"c": "clang", "cpp": "clang++"}' \
|
||||||
-s build_type=Release \
|
-s build_type=Release \
|
||||||
-s compiler=clang \
|
-s compiler=clang \
|
||||||
-s compiler.version=20 \
|
-s compiler.version=20 \
|
||||||
-s compiler.libcxx=libc++ \
|
-s compiler.libcxx=libc++ \
|
||||||
-o use_mold=True \
|
-o use_mold=True \
|
||||||
-o enable_lcov=True \
|
|
||||||
--build=missing
|
--build=missing
|
||||||
|
|
||||||
for test in $(find ./build -type f -name '*_tests' -executable); do
|
for test in $(find ./build -type f -name '*_tests' -executable); do
|
||||||
|
|
|
@ -15,9 +15,6 @@ docker build -t amd64_gcc_unit_tests -f $CI_DIR/amd64/gcc/unit_tests.dockerfile
|
||||||
echo "==> Building image: amd64_gcc_valgrind"
|
echo "==> Building image: amd64_gcc_valgrind"
|
||||||
docker build -t amd64_gcc_valgrind -f $CI_DIR/amd64/gcc/valgrind.dockerfile .
|
docker build -t amd64_gcc_valgrind -f $CI_DIR/amd64/gcc/valgrind.dockerfile .
|
||||||
|
|
||||||
echo "==> Building image: amd64_clang_coverage"
|
|
||||||
docker build -t amd64_clang_coverage -f $CI_DIR/amd64/clang/coverage.dockerfile .
|
|
||||||
|
|
||||||
echo "==> Building image: amd64_clang_lsan"
|
echo "==> Building image: amd64_clang_lsan"
|
||||||
docker build -t amd64_clang_lsan -f $CI_DIR/amd64/clang/lsan.dockerfile .
|
docker build -t amd64_clang_lsan -f $CI_DIR/amd64/clang/lsan.dockerfile .
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue