Skip to content

Commit

Permalink
Applying clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Mar 23, 2023
1 parent 7cb644a commit a6eea2d
Show file tree
Hide file tree
Showing 53 changed files with 1,470 additions and 1,025 deletions.
42 changes: 21 additions & 21 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ build: false
os: Visual Studio 2015

platform:
- x64
- x64

environment:
matrix:
- MINICONDA: C:\xtensor-conda
- MINICONDA: C:\xtensor-conda

init:
- "ECHO %MINICONDA%"
- C:\"Program Files (x86)"\"Microsoft Visual Studio 14.0"\VC\vcvarsall.bat %PLATFORM%
- ps: if($env:Platform -eq "x64"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe' C:\Miniconda.exe; echo "Done"}
- ps: if($env:Platform -eq "x86"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exe' C:\Miniconda.exe; echo "Done"}
- cmd: C:\Miniconda.exe /S /D=C:\xtensor-conda
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%MINICONDA%\\Library\\bin;%PATH%"
- ECHO %MINICONDA%
- C:\"Program Files (x86)"\"Microsoft Visual Studio 14.0"\VC\vcvarsall.bat %PLATFORM%
- ps: if($env:Platform -eq "x64"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe' C:\Miniconda.exe; echo "Done"}
- ps: if($env:Platform -eq "x86"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exe' C:\Miniconda.exe; echo "Done"}
- cmd: C:\Miniconda.exe /S /D=C:\xtensor-conda
- set PATH=%MINICONDA%;%MINICONDA%\Scripts;%MINICONDA%\Library\bin;%PATH%

install:
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda install mamba -c conda-forge
- mamba install cmake pytest numpy pybind11 xtensor==0.24.0 -c conda-forge
- "set PYTHONHOME=%MINICONDA%"
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D BUILD_TESTS=ON -D PYTHON_EXECUTABLE=%MINICONDA%\\python.exe -DDOWNLOAD_GTEST=ON .
- nmake test_xtensor_python
- nmake install
- rmdir /s/q "test/googletest-src"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda install mamba -c conda-forge
- mamba install cmake pytest numpy pybind11 xtensor==0.24.0 -c conda-forge
- set PYTHONHOME=%MINICONDA%
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D BUILD_TESTS=ON -D PYTHON_EXECUTABLE=%MINICONDA%\\python.exe -DDOWNLOAD_GTEST=ON .
- nmake test_xtensor_python
- nmake install
- rmdir /s/q "test/googletest-src"

build_script:
- py.test -s
- cd test
- .\test_xtensor_python
- py.test -s
- cd test
- .\test_xtensor_python
68 changes: 34 additions & 34 deletions .azure-pipelines/azure-pipelines-linux-clang.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
jobs:
- job: 'Linux_0'
strategy:
matrix:
clang_6:
llvm_version: '6.0'
clang_7:
llvm_version: '7'
clang_8:
llvm_version: '8'
clang_9:
llvm_version: '9'
pool:
vmImage: ubuntu-18.04
variables:
CC: clang-$(llvm_version)
CXX: clang++-$(llvm_version)
timeoutInMinutes: 360
steps:
- job: Linux_0
strategy:
matrix:
clang_6:
llvm_version: '6.0'
clang_7:
llvm_version: '7'
clang_8:
llvm_version: '8'
clang_9:
llvm_version: '9'
pool:
vmImage: ubuntu-18.04
variables:
CC: clang-$(llvm_version)
CXX: clang++-$(llvm_version)
timeoutInMinutes: 360
steps:

- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
if [[ $(llvm_version) == '4.0' || $(llvm_version) == '5.0' ]]; then
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install gcc-4.9 clang-$(llvm_version)
else
LLVM_VERSION=$(llvm_version)
get -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$LLVM_VERSION main"
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install clang-$(llvm_version)
fi
displayName: Install build toolchain
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
if [[ $(llvm_version) == '4.0' || $(llvm_version) == '5.0' ]]; then
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install gcc-4.9 clang-$(llvm_version)
else
LLVM_VERSION=$(llvm_version)
get -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$LLVM_VERSION main"
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install clang-$(llvm_version)
fi
displayName: Install build toolchain
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- template: unix-build.yml
- template: unix-build.yml
57 changes: 28 additions & 29 deletions .azure-pipelines/azure-pipelines-linux-gcc.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
jobs:
- job: 'Linux_1'
strategy:
matrix:
gcc_6:
gcc_version: '6'
gcc_7:
gcc_version: '7'
gcc_8:
gcc_version: '8'
gcc_9:
gcc_version: '9'
pool:
vmImage: ubuntu-18.04
variables:
CC: gcc-$(gcc_version)
CXX: g++-$(gcc_version)
timeoutInMinutes: 360
steps:
- job: Linux_1
strategy:
matrix:
gcc_6:
gcc_version: '6'
gcc_7:
gcc_version: '7'
gcc_8:
gcc_version: '8'
gcc_9:
gcc_version: '9'
pool:
vmImage: ubuntu-18.04
variables:
CC: gcc-$(gcc_version)
CXX: g++-$(gcc_version)
timeoutInMinutes: 360
steps:

- script: |
if [[ $(gcc_version) == '4.9' || $(gcc_version) == '6' || $(gcc_version) == '7' || $(gcc_version) == '8' ]]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install g++-$(gcc_version)
fi
displayName: Install build toolchain
- script: |
if [[ $(gcc_version) == '4.9' || $(gcc_version) == '6' || $(gcc_version) == '7' || $(gcc_version) == '8' ]]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install g++-$(gcc_version)
fi
displayName: Install build toolchain
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- template: unix-build.yml
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- template: unix-build.yml
50 changes: 25 additions & 25 deletions .azure-pipelines/azure-pipelines-osx.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
jobs:
- job: 'OSX'
strategy:
matrix:
macOS_10_15:
image_name: 'macOS-10.15'
macOS_11:
image_name: 'macOS-11'
pool:
vmImage: $(image_name)
variables:
CC: clang
CXX: clang++
timeoutInMinutes: 360
steps:
- script: |
echo "Removing homebrew for Azure to avoid conflicts with conda"
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew
chmod +x ~/uninstall_homebrew
~/uninstall_homebrew -f -q
displayName: Remove homebrew
- job: OSX
strategy:
matrix:
macOS_10_15:
image_name: macOS-10.15
macOS_11:
image_name: macOS-11
pool:
vmImage: $(image_name)
variables:
CC: clang
CXX: clang++
timeoutInMinutes: 360
steps:
- script: |
echo "Removing homebrew for Azure to avoid conflicts with conda"
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew
chmod +x ~/uninstall_homebrew
~/uninstall_homebrew -f -q
displayName: Remove homebrew
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: Add conda to PATH
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: Add conda to PATH
- template: unix-build.yml
- template: unix-build.yml
120 changes: 60 additions & 60 deletions .azure-pipelines/unix-build.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
steps:
- script: |
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda env create --file environment-dev.yml
source activate xtensor-python
displayName: Install dependencies
- script: |
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda env create --file environment-dev.yml
source activate xtensor-python
displayName: Install dependencies

- script: |
source activate xtensor-python
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DPYTHON_EXECUTABLE=`which python` -DDOWNLOAD_GTEST=ON $(Build.SourcesDirectory)
make install
displayName: Configure xtensor-python
workingDirectory: $(Build.BinariesDirectory)
- script: |
source activate xtensor-python
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DPYTHON_EXECUTABLE=`which python` -DDOWNLOAD_GTEST=ON $(Build.SourcesDirectory)
make install
displayName: Configure xtensor-python
workingDirectory: $(Build.BinariesDirectory)

- script: |
source activate xtensor-python
make -j2 test_xtensor_python
displayName: Build xtensor-python
workingDirectory: $(Build.BinariesDirectory)/build
- script: |
source activate xtensor-python
make -j2 test_xtensor_python
displayName: Build xtensor-python
workingDirectory: $(Build.BinariesDirectory)/build

- script: |
source activate xtensor-python
cd test
./test_xtensor_python
displayName: Test xtensor-python (C++)
workingDirectory: $(Build.BinariesDirectory)/build/test
- script: |
source activate xtensor-python
cd test
./test_xtensor_python
displayName: Test xtensor-python (C++)
workingDirectory: $(Build.BinariesDirectory)/build/test

- script: |
source activate xtensor-python
py.test -s
displayName: Test xtensor-python (Python)
workingDirectory: $(Build.SourcesDirectory)
- script: |
source activate xtensor-python
py.test -s
displayName: Test xtensor-python (Python)
workingDirectory: $(Build.SourcesDirectory)

- script: |
source activate xtensor-python
cmake -Bbuild -DPython_EXECUTABLE=`which python`
cd build
cmake --build .
cp ../example.py .
python example.py
cd ..
displayName: Example - readme 1
workingDirectory: $(Build.SourcesDirectory)/docs/source/examples/readme_example_1
- script: |
source activate xtensor-python
cmake -Bbuild -DPython_EXECUTABLE=`which python`
cd build
cmake --build .
cp ../example.py .
python example.py
cd ..
displayName: Example - readme 1
workingDirectory: $(Build.SourcesDirectory)/docs/source/examples/readme_example_1

- script: |
source activate xtensor-python
cmake -Bbuild -DPython_EXECUTABLE=`which python`
cd build
cmake --build .
cp ../example.py .
python example.py
cd ..
displayName: Example - Copy 'cast'
workingDirectory: $(Build.SourcesDirectory)/docs/source/examples/copy_cast
- script: |
source activate xtensor-python
cmake -Bbuild -DPython_EXECUTABLE=`which python`
cd build
cmake --build .
cp ../example.py .
python example.py
cd ..
displayName: Example - Copy 'cast'
workingDirectory: $(Build.SourcesDirectory)/docs/source/examples/copy_cast

- script: |
source activate xtensor-python
cmake -Bbuild -DPython_EXECUTABLE=`which python`
cd build
cmake --build .
cp ../example.py .
python example.py
cd ..
displayName: Example - SFINAE
workingDirectory: $(Build.SourcesDirectory)/docs/source/examples/sfinae
- script: |
source activate xtensor-python
cmake -Bbuild -DPython_EXECUTABLE=`which python`
cd build
cmake --build .
cp ../example.py .
python example.py
cd ..
displayName: Example - SFINAE
workingDirectory: $(Build.SourcesDirectory)/docs/source/examples/sfinae
Loading

0 comments on commit a6eea2d

Please sign in to comment.