etl/.github/workflows/clang-c++23.yml
Roland Reichwein 866c8a315e
Extensions for testing (#1380)
* Extensions for testing

Generalize run-tests.sh

Test all C++ versions at once

Fix combination of big endian and -Wsign-conversion

Failed on s390x (as reference for big endian)

Add github workflow for s390x

Add armhf container files

Devcontainers for i386 and riscv

Add github workflows for armhf, i386 and riscv64

Add run-tests.sh for foreign architectures

Document testing in doc/testing.md

Adjustments from clang-format run

Fix .devcontainer/s390x/Dockerfile for linebreak syntax

Fix exit code of run-test.sh

Previously, "exit $?" was used, actually the return value of
FailedCompilation and FailedTest which are always 0.

Now just using 1.

In run-tests.sh at ctest, use -V for printing number of tests unconditionally

While ctest suppresses individual test list by default, it didn't even
print the number of tests anymore, as run_tests.sh does because
it suppresses it output completely.

Now, by default print number of tests, and in verbose mode, print test list
in addition.

* Support powerpc as foreign architecture

* Add SFINAE constraints to etl::begin/end and reverse iterator free functions

The unconstrained etl::begin(), etl::end(), etl::cbegin(), etl::cend(),
etl::rbegin(), etl::rend(), etl::crbegin(), and etl::crend() templates
in the no-STL code path were matching iterator types during ADL, causing
a hard error with GCC 15's std::ranges::begin. When std::ranges performed
ADL on an etl::*::iterator, it found etl::begin() as a candidate; since
the iterator type has a nested iterator typedef, the return type TContainer::iterator
was valid, but calling .begin() on the iterator failed.

Fix: add etl::void_t<decltype(...)> SFINAE guards to each template,
ensuring they only participate in overload resolution when TContainer
actually has the corresponding member function (.begin(), .end(), etc.).

* - Fix red unit tests on 32 bits big-endian platform.

* Document powerpc architecture for testing

* Use Dockerfiles in cross testing github workflows

Synchronizes environment setup for github workflows to what is
defined in the development Dockerfiles. So they don't need to
be maintained separately.

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Sergei Shirokov <sergej.shirokov@gmail.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-04-15 10:47:52 +02:00

186 lines
5.4 KiB
YAML

name: clang-c++23
on:
push:
branches: [ master, development, pull-request/* ]
pull_request:
branches: [ master, development, pull-request/* ]
types: [opened, synchronize, reopened]
jobs:
build-clang-cpp23-linux-no-stl:
name: Clang C++23 Linux - No STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
# Temporary fix. See https://github.com/actions/runner-images/issues/8659
- name: Install newer Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17
- name: Build
run: |
export CC=clang-17
export CXX=clang++-17
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
cmake -DBUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=23 ./
clang-17 --version
make -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: ./test/etl_tests -v
build-clang-cpp23-linux-stl-force-cpp03:
name: Clang C++23 Linux - STL - Force C++03
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
# Temporary fix. See https://github.com/actions/runner-images/issues/8659
- name: Install newer Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17
- name: Build
run: |
export CC=clang-17
export CXX=clang++-17
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=23 ./
clang-17 --version
make -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: ./test/etl_tests -v
build-clang-cpp2-linux-no-stl-force-cpp03:
name: Clang C++23 Linux - No STL - Force C++03
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
# Temporary fix. See https://github.com/actions/runner-images/issues/8659
- name: Install newer Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17
- name: Build
run: |
export CC=clang-17
export CXX=clang++-17
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
cmake -D BUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=23 ./
clang-17 --version
make -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: ./test/etl_tests -v
build-clang-cpp23-osx-stl:
name: Clang C++23 OSX - STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15]
steps:
- uses: actions/checkout@v4
- name: Build
run: |
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=23 ./
clang --version
make -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: ./test/etl_tests -v
build-clang-cpp23-osx-no-stl:
name: Clang C++23 OSX - No STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15]
steps:
- uses: actions/checkout@v4
- name: Build
run: |
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
cmake -D BUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=23 ./
clang --version
make -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: ./test/etl_tests -v
build-clang-cpp23-osx-stl-force-cpp03:
name: Clang C++23 OSX - STL - Force C++03
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15]
steps:
- uses: actions/checkout@v4
- name: Build
run: |
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=23 ./
clang --version
make -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: ./test/etl_tests -v
build-clang-cpp23-osx-no-stl-force-cpp03:
name: Clang C++23 OSX - No STL - Force C++03
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15]
steps:
- uses: actions/checkout@v4
- name: Build
run: |
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
cmake -D BUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=23 ./
clang --version
make -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: ./test/etl_tests -v