--- /dev/null
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.{C,c{,c,pp,xx},h{,h,pp,xx}}]
+indent_style = space
+indent_size = 2
+
+[*.yml]
+indent_style = space
+indent_size = 2
+
+[*.{rst,m{,{,ark}d{,own}}}}]
+trim_trailing_whitespace = false
+indent_style = space
+indent_size = 4
+
+[{CMake{Lists,Config}.txt,*.cmake}]
+indent_style = space
+indent_size = 4
+
+[{Makefile,*.mk}]
+indent_style = tab
+
+
--- /dev/null
+#!/usr/bin/env php
+<?php
+
+echo "# Generated file; do not edit!\n";
+
+const PRE = " ";
+const DEF = [
+ "os" => "Linux",
+ "Linux" => "ubuntu-20.04",
+ "macOS" => "macos-10.15",
+ "ubuntu-20.04" => "gnu",
+ "macos-10.15" => "clang",
+ "gnu" => [
+ "ver" => "cur",
+ "CC" => "gcc",
+ "CXX" => "g++",
+ ],
+ "clang" => [
+ "ver" => "apple",
+ "CC" => "clang",
+ "CXX" => "clang++",
+ ],
+];
+const APT = [
+ "ubuntu-20.04" => [
+ "gnu" => [
+ "new" => [
+ "CC" => "gcc-10",
+ "CXX" => "g++-10",
+ ]
+ ]
+ ],
+ "ubuntu-18.04" => [
+ "clang" => [
+ "old" => [
+ "CC" => "clang-7",
+ "CXX" => "clang-7"
+ ]
+ ]
+ ]
+];
+const MAP = [
+ 'env.OS_VER' => [
+ "ubuntu-20.04" => [
+ 'env.CC_VND' => [
+ "gnu" => [
+ 'env.CC_VER' => [
+ "new" => "-10",
+ "cur" => "-9",
+ "old" => "-8"
+ ]
+ ],
+ "clang" => [
+ 'env.CC_VER' => [
+ "new" => "-10",
+ "cur" => "-9",
+ "old" => "-8"
+ ]
+ ]
+ ]
+ ],
+ "ubuntu-18.04" => [
+ 'env.CC_VND' => [
+ "gnu" => [
+ 'env.CC_VER' => [
+ "new" => "-9",
+ "cur" => "-8",
+ "old" => "-7"
+ ]
+ ],
+ "clang" => [
+ 'env.CC_VER' => [
+ "new" => "-9",
+ "cur" => "-8",
+ "old" => "-7"
+ ]
+ ]
+ ]
+ ]
+ ]
+];
+
+/**
+ * @var bool $splat_map false = no splat map, null = default splat map, true = full splat map
+ */
+function steps_setenv($splat_map = null) {
+ if ($splat_map !== false) {
+ foreach (MAP as $os_is => $os_vers) {
+ foreach ($os_vers as $os_ver => $cc_vnds_) {
+ if (!$splat_map && DEF[DEF["os"]] != $os_ver) continue;
+ foreach ($cc_vnds_ as $cc_vnd_is => $cc_vnds) {
+ foreach ($cc_vnds as $cc_vnd => $cc_vers_) {
+ if (!$splat_map && DEF[DEF[DEF["os"]]] != $cc_vnd) continue;
+ foreach ($cc_vers_ as $cc_ver_is => $cc_vers) {
+ foreach ($cc_vers as $cc_ver => $ver) {
+ if (!$splat_map && DEF[DEF[DEF[DEF["os"]]]]["ver"] != $cc_ver) continue;
+?>
+<?=PRE?> - name: Prepare environment (<?= "for $cc_ver $cc_vnd on $os_ver" ?>)
+<?=PRE?> if: (<?="$os_is=='$os_ver') && ($cc_vnd_is=='$cc_vnd') && ($cc_ver_is=='$cc_ver'"?>)
+<?=PRE?> run: |
+<?=PRE?> echo CC=<?=DEF[$cc_vnd]["CC"] . $ver?> >> ${GITHUB_ENV}
+<?=PRE?> echo CXX=<?=DEF[$cc_vnd]["CXX"] . $ver?> >> ${GITHUB_ENV}
+<?php
+ if (isset(APT[$os_ver][$cc_vnd][$cc_ver])) {
+ $dep = APT[$os_ver][$cc_vnd][$cc_ver];
+?>
+<?=PRE?> echo INSTALL_CC='<?=$dep["CC"]?>' >> ${GITHUB_ENV}
+<?=PRE?> echo INSTALL_CXX='<?=$dep["CXX"]?>' >> ${GITHUB_ENV}
+<?php
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+function steps_getdeps() {
+?>
+<?=PRE?> - name: Install dependencies (Linux)
+<?=PRE?> if: runner.os == 'Linux'
+<?=PRE?> run: |
+<?=PRE?> sudo apt-get install \
+<?=PRE?> libevent-dev \
+<?=PRE?> libsasl2-dev \
+<?=PRE?> ${INSTALL_MEMCACHED} \
+<?=PRE?> ${INSTALL_CC} ${INSTALL_CXX}
+<?=PRE?> sudo systemctl stop memcached || true
+<?=PRE?> - name: Install dependencies (Mac)
+<?=PRE?> if: runner.os == 'macOS'
+<?=PRE?> run: |
+<?=PRE?> brew install bison flex ${INSTALL_MEMCACHED}
+<?=PRE?> brew services stop memcached || true
+<?php
+}
+
+function steps_build() {
+?>
+<?=PRE?> - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
+<?=PRE?> run: cmake -S . -B build
+<?=PRE?> - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+<?=PRE?> run: make -C build -j2 all
+<?=PRE?> - name: Test
+<?=PRE?> run: make -C build -j2 test
+<?=PRE?> - name: Install
+<?=PRE?> run: make -C build -j2 install DESTDIR=.
+<?=PRE?> - name: Failed tests log
+<?=PRE?> if: ${{ failure() }}
+<?=PRE?> run: cat build/Testing/Temporary/LastTest.log || true
+<?php
+}
+
+function steps($splat_map = null) {
+ steps_setenv($splat_map);
+ steps_getdeps();
+ steps_build();
+}
+
+function defaults() {
+ $os_ver = DEF[DEF["os"]];
+ $cc_vnd = DEF[$os_ver];
+ $cc_ver = DEF[$cc_vnd]["ver"];
+ return "$os_ver, $cc_vnd, $cc_ver";
+}
+?>
+name: cmake-build-ci
+on:
+ push:
+ paths-ignore:
+ - "docs/**"
+ branches-ignore:
+ - gh-pages
+ - v1.x
+ pull_request:
+ branches:
+ - master
+ - v1.x
+env:
+ # defaults
+ INSTALL_MEMCACHED: memcached
+ CMAKE_BUILD_TYPE: Debug
+ BUILD_TESTING: "ON"
+ ENABLE_SASL: "OFF"
+ ENABLE_HASH_HSIEH: "ON"
+ ENABLE_DTRACE: "OFF"
+ VERBOSE: "ON"
+ OS_VND: <?=DEF["os"]?> #
+ OS_VER: <?=DEF[DEF["os"]]?> #
+ CC_VND: <?=DEF[DEF[DEF["os"]]]?> #
+ CC_VER: <?=DEF[DEF[DEF[DEF["os"]]]]["ver"]?> #
+
+jobs:
+
+ # new memcached
+ ci-new:
+ name: ci-dbg (<?=defaults()?>, memcached-1.6)
+ runs-on: <?=DEF[DEF["os"]]?> #
+ env:
+ INSTALL_MEMCACHED:
+ MEMCACHED_PREFIX: /tmp
+ MEMCACHED_BINARY: /tmp/bin/memcached
+ ENABLE_SASL: "ON"
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/checkout@v2
+ with:
+ repository: memcached/memcached
+ path: memcached
+ ref: 1.6.7
+<?php steps_setenv(); ?>
+<?php steps_getdeps(); ?>
+ - name: Build memcached
+ run: |
+ cd memcached
+ ./autogen.sh
+ ./configure CFLAGS="-O2 -pipe" \
+ --prefix=${MEMCACHED_PREFIX} \
+ --enable-sasl \
+ --enable-sasl-pwdb \
+ --disable-docs \
+ --disable-coverage \
+ --disable-dependency-tracking
+ make -j2
+ make install
+ cd ..
+<?php steps_build(); ?>
+
+ # sanitizer build
+ ci-san:
+ name: ci-dbg (<?=defaults()?>, sanitizers)
+ runs-on: <?=DEF[DEF["os"]]?> #
+ env:
+ ENABLE_SANITIZERS: "address;undefined"
+ steps:
+ - uses: actions/checkout@v2
+<?php steps(); ?>
+
+ # coverage build
+ ci-cov:
+ name: ci-dbg (<?=defaults()?>, coverage)
+ runs-on: <?=DEF[DEF["os"]]?> #
+ env:
+ CFLAGS: -O0 --coverage
+ CXXFLAGS: -O0 --coverage
+ steps:
+ - uses: actions/checkout@v2
+<?php steps(); ?>
+ - uses: codecov/codecov-action@v1.0.13
+
+ # mac build
+ ci-mac:
+ name: ci-dbg (<?=DEF["macOS"]?>, <?=DEF[DEF["macOS"]]?>, <?=DEF[DEF[DEF["macOS"]]]["ver"]?>)
+ runs-on: <?=DEF["macOS"]?> #
+ continue-on-error: true
+ env:
+ MEMCACHED_BINARY: /usr/local/bin/memcached
+ steps:
+ - uses actions/checkout@v2
+<?php steps(false); ?>
+
+ # release builds
+ ci-rel:
+ strategy:
+ fail-fast: false
+ matrix:
+ os_ver: [ubuntu-20.04, ubuntu-18.04]
+ cc_vnd: [gnu, clang]
+ cc_ver: [new, cur, old]
+ runs-on: ${{ matrix.os_ver }}
+ continue-on-error: ${{ matrix.cc_vnd == 'clang' }}
+ env:
+ CMAKE_BUILD_TYPE: Release
+ OS_VND: Linux
+ OS_VER: ${{ matrix.os_ver }}
+ CC_VND: ${{ matrix.cc_vnd }}
+ CC_VER: ${{ matrix.cc_ver }}
+ steps:
+ - uses: actions/checkout@v2
+<?php steps(true); ?>
--- /dev/null
+# Generated file; do not edit!
+name: cmake-build-ci
+on:
+ push:
+ paths-ignore:
+ - "docs/**"
+ branches-ignore:
+ - gh-pages
+ - v1.x
+ pull_request:
+ branches:
+ - master
+ - v1.x
+env:
+ # defaults
+ INSTALL_MEMCACHED: memcached
+ CMAKE_BUILD_TYPE: Debug
+ BUILD_TESTING: "ON"
+ ENABLE_SASL: "OFF"
+ ENABLE_HASH_HSIEH: "ON"
+ ENABLE_DTRACE: "OFF"
+ VERBOSE: "ON"
+ OS_VND: Linux #
+ OS_VER: ubuntu-20.04 #
+ CC_VND: gnu #
+ CC_VER: cur #
+
+jobs:
+
+ # new memcached
+ ci-new:
+ name: ci-dbg (ubuntu-20.04, gnu, cur, memcached-1.6)
+ runs-on: ubuntu-20.04 #
+ env:
+ INSTALL_MEMCACHED:
+ MEMCACHED_PREFIX: /tmp
+ MEMCACHED_BINARY: /tmp/bin/memcached
+ ENABLE_SASL: "ON"
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/checkout@v2
+ with:
+ repository: memcached/memcached
+ path: memcached
+ ref: 1.6.7
+ - name: Prepare environment (for cur gnu on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+ run: |
+ echo CC=gcc-9 >> ${GITHUB_ENV}
+ echo CXX=g++-9 >> ${GITHUB_ENV}
+ - name: Install dependencies (Linux)
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get install \
+ libevent-dev \
+ libsasl2-dev \
+ ${INSTALL_MEMCACHED} \
+ ${INSTALL_CC} ${INSTALL_CXX}
+ sudo systemctl stop memcached || true
+ - name: Install dependencies (Mac)
+ if: runner.os == 'macOS'
+ run: |
+ brew install bison flex ${INSTALL_MEMCACHED}
+ brew services stop memcached || true
+ - name: Build memcached
+ run: |
+ cd memcached
+ ./autogen.sh
+ ./configure CFLAGS="-O2 -pipe" \
+ --prefix=${MEMCACHED_PREFIX} \
+ --enable-sasl \
+ --enable-sasl-pwdb \
+ --disable-docs \
+ --disable-coverage \
+ --disable-dependency-tracking
+ make -j2
+ make install
+ cd ..
+ - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
+ run: cmake -S . -B build
+ - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+ run: make -C build -j2 all
+ - name: Test
+ run: make -C build -j2 test
+ - name: Install
+ run: make -C build -j2 install DESTDIR=.
+ - name: Failed tests log
+ if: ${{ failure() }}
+ run: cat build/Testing/Temporary/LastTest.log || true
+
+ # sanitizer build
+ ci-san:
+ name: ci-dbg (ubuntu-20.04, gnu, cur, sanitizers)
+ runs-on: ubuntu-20.04 #
+ env:
+ ENABLE_SANITIZERS: "address;undefined"
+ steps:
+ - uses: actions/checkout@v2
+ - name: Prepare environment (for cur gnu on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+ run: |
+ echo CC=gcc-9 >> ${GITHUB_ENV}
+ echo CXX=g++-9 >> ${GITHUB_ENV}
+ - name: Install dependencies (Linux)
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get install \
+ libevent-dev \
+ libsasl2-dev \
+ ${INSTALL_MEMCACHED} \
+ ${INSTALL_CC} ${INSTALL_CXX}
+ sudo systemctl stop memcached || true
+ - name: Install dependencies (Mac)
+ if: runner.os == 'macOS'
+ run: |
+ brew install bison flex ${INSTALL_MEMCACHED}
+ brew services stop memcached || true
+ - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
+ run: cmake -S . -B build
+ - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+ run: make -C build -j2 all
+ - name: Test
+ run: make -C build -j2 test
+ - name: Install
+ run: make -C build -j2 install DESTDIR=.
+ - name: Failed tests log
+ if: ${{ failure() }}
+ run: cat build/Testing/Temporary/LastTest.log || true
+
+ # coverage build
+ ci-cov:
+ name: ci-dbg (ubuntu-20.04, gnu, cur, coverage)
+ runs-on: ubuntu-20.04 #
+ env:
+ CFLAGS: -O0 --coverage
+ CXXFLAGS: -O0 --coverage
+ steps:
+ - uses: actions/checkout@v2
+ - name: Prepare environment (for cur gnu on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+ run: |
+ echo CC=gcc-9 >> ${GITHUB_ENV}
+ echo CXX=g++-9 >> ${GITHUB_ENV}
+ - name: Install dependencies (Linux)
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get install \
+ libevent-dev \
+ libsasl2-dev \
+ ${INSTALL_MEMCACHED} \
+ ${INSTALL_CC} ${INSTALL_CXX}
+ sudo systemctl stop memcached || true
+ - name: Install dependencies (Mac)
+ if: runner.os == 'macOS'
+ run: |
+ brew install bison flex ${INSTALL_MEMCACHED}
+ brew services stop memcached || true
+ - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
+ run: cmake -S . -B build
+ - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+ run: make -C build -j2 all
+ - name: Test
+ run: make -C build -j2 test
+ - name: Install
+ run: make -C build -j2 install DESTDIR=.
+ - name: Failed tests log
+ if: ${{ failure() }}
+ run: cat build/Testing/Temporary/LastTest.log || true
+ - uses: codecov/codecov-action@v1.0.13
+
+ # mac build
+ ci-mac:
+ name: ci-dbg (macos-10.15, clang, apple)
+ runs-on: macos-10.15 #
+ continue-on-error: true
+ env:
+ MEMCACHED_BINARY: /usr/local/bin/memcached
+ steps:
+ - uses actions/checkout@v2
+ - name: Install dependencies (Linux)
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get install \
+ libevent-dev \
+ libsasl2-dev \
+ ${INSTALL_MEMCACHED} \
+ ${INSTALL_CC} ${INSTALL_CXX}
+ sudo systemctl stop memcached || true
+ - name: Install dependencies (Mac)
+ if: runner.os == 'macOS'
+ run: |
+ brew install bison flex ${INSTALL_MEMCACHED}
+ brew services stop memcached || true
+ - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
+ run: cmake -S . -B build
+ - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+ run: make -C build -j2 all
+ - name: Test
+ run: make -C build -j2 test
+ - name: Install
+ run: make -C build -j2 install DESTDIR=.
+ - name: Failed tests log
+ if: ${{ failure() }}
+ run: cat build/Testing/Temporary/LastTest.log || true
+
+ # release builds
+ ci-rel:
+ strategy:
+ fail-fast: false
+ matrix:
+ os_ver: [ubuntu-20.04, ubuntu-18.04]
+ cc_vnd: [gnu, clang]
+ cc_ver: [new, cur, old]
+ runs-on: ${{ matrix.os_ver }}
+ continue-on-error: ${{ matrix.cc_vnd == 'clang' }}
+ env:
+ CMAKE_BUILD_TYPE: Release
+ OS_VND: Linux
+ OS_VER: ${{ matrix.os_ver }}
+ CC_VND: ${{ matrix.cc_vnd }}
+ CC_VER: ${{ matrix.cc_ver }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: Prepare environment (for new gnu on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
+ run: |
+ echo CC=gcc-10 >> ${GITHUB_ENV}
+ echo CXX=g++-10 >> ${GITHUB_ENV}
+ echo INSTALL_CC='gcc-10' >> ${GITHUB_ENV}
+ echo INSTALL_CXX='g++-10' >> ${GITHUB_ENV}
+ - name: Prepare environment (for cur gnu on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+ run: |
+ echo CC=gcc-9 >> ${GITHUB_ENV}
+ echo CXX=g++-9 >> ${GITHUB_ENV}
+ - name: Prepare environment (for old gnu on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='old')
+ run: |
+ echo CC=gcc-8 >> ${GITHUB_ENV}
+ echo CXX=g++-8 >> ${GITHUB_ENV}
+ - name: Prepare environment (for new clang on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='new')
+ run: |
+ echo CC=clang-10 >> ${GITHUB_ENV}
+ echo CXX=clang++-10 >> ${GITHUB_ENV}
+ - name: Prepare environment (for cur clang on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur')
+ run: |
+ echo CC=clang-9 >> ${GITHUB_ENV}
+ echo CXX=clang++-9 >> ${GITHUB_ENV}
+ - name: Prepare environment (for old clang on ubuntu-20.04)
+ if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='old')
+ run: |
+ echo CC=clang-8 >> ${GITHUB_ENV}
+ echo CXX=clang++-8 >> ${GITHUB_ENV}
+ - name: Prepare environment (for new gnu on ubuntu-18.04)
+ if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
+ run: |
+ echo CC=gcc-9 >> ${GITHUB_ENV}
+ echo CXX=g++-9 >> ${GITHUB_ENV}
+ - name: Prepare environment (for cur gnu on ubuntu-18.04)
+ if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+ run: |
+ echo CC=gcc-8 >> ${GITHUB_ENV}
+ echo CXX=g++-8 >> ${GITHUB_ENV}
+ - name: Prepare environment (for old gnu on ubuntu-18.04)
+ if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='old')
+ run: |
+ echo CC=gcc-7 >> ${GITHUB_ENV}
+ echo CXX=g++-7 >> ${GITHUB_ENV}
+ - name: Prepare environment (for new clang on ubuntu-18.04)
+ if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='new')
+ run: |
+ echo CC=clang-9 >> ${GITHUB_ENV}
+ echo CXX=clang++-9 >> ${GITHUB_ENV}
+ - name: Prepare environment (for cur clang on ubuntu-18.04)
+ if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur')
+ run: |
+ echo CC=clang-8 >> ${GITHUB_ENV}
+ echo CXX=clang++-8 >> ${GITHUB_ENV}
+ - name: Prepare environment (for old clang on ubuntu-18.04)
+ if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='old')
+ run: |
+ echo CC=clang-7 >> ${GITHUB_ENV}
+ echo CXX=clang++-7 >> ${GITHUB_ENV}
+ echo INSTALL_CC='clang-7' >> ${GITHUB_ENV}
+ echo INSTALL_CXX='clang-7' >> ${GITHUB_ENV}
+ - name: Install dependencies (Linux)
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get install \
+ libevent-dev \
+ libsasl2-dev \
+ ${INSTALL_MEMCACHED} \
+ ${INSTALL_CC} ${INSTALL_CXX}
+ sudo systemctl stop memcached || true
+ - name: Install dependencies (Mac)
+ if: runner.os == 'macOS'
+ run: |
+ brew install bison flex ${INSTALL_MEMCACHED}
+ brew services stop memcached || true
+ - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
+ run: cmake -S . -B build
+ - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+ run: make -C build -j2 all
+ - name: Test
+ run: make -C build -j2 test
+ - name: Install
+ run: make -C build -j2 install DESTDIR=.
+ - name: Failed tests log
+ if: ${{ failure() }}
+ run: cat build/Testing/Temporary/LastTest.log || true
+++ /dev/null
-services:
- - memcached
-
-addons:
- apt:
- packages:
- - python-sphinx
- - valgrind
- - libevent-dev
- - libsasl2-dev
-
-dist: bionic
-language: cpp
-compiler:
-# - gcc
- - clang
-
-env:
-# - BUILD=Release SASL=false
-# - BUILD=Debug SASL=true PREFIX=/opt PORT=11212 MC_VERSION=1.5.22
-# - BUILD=Debug SASL=false PREFIX=/opt PORT=11212 MC_VERSION=1.6.6
- - BUILD=Debug SASL=true PREFIX=/opt PORT=11212 SANITIZERS="address;undefined"
-
-#before_install:
-install:
- - |
- if ${SASL} || test -n "$MC_VERSION";
- then
- git clone -b ${MC_VERSION:-1.5.22} https://github.com/memcached/memcached &&
- cd memcached && ./autogen.sh &&
- CFLAGS="-O2 -pipe" ./configure --prefix=${PREFIX} --disable-dependency-tracking --enable-sasl --enable-sasl-pwdb --disable-coverage --disable-docs &&
- make -j2 && make install && cd ..;
- ${PREFIX}/bin/memcached -l 127.0.0.1 -p ${PORT} -U ${PORT} -m 128 &
- fi;
-
-
-before_script:
- - echo stats settings | nc -q 0 localhost ${PORT:-11211} | column -t
- - sudo systemctl stop memcached
- - killall memcached || true
- - mkdir build
-
-script:
- - cd build
- - cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${BUILD} -DENABLE_SASL=${SASL} -DENABLE_SANITIZERS=${SANITIZERS} -DMEMCACHED_BINARY=${PREFIX:-/usr}/bin/memcached ..
- - make -j2 VERBOSE=1
- - make test VERBOSE=1
- - make install DESTDIR=.
-
-#before_cache:
-#after_success:
-
-after_failure:
- - cat Testing/Temporary/LastTest.log
-
-#after_script:
if(HAVE_ASAN)
add_compile_definitions(HAVE_ASAN)
add_compile_options(-fsanitize=address)
- if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -v -fsanitize=address")
- endif()
- link_libraries(asan)
+ link_libraries(-fsanitize=address)
check_flag(-fsanitize-recover=address IGNORE)
endif()
endif()
if(HAVE_UBSAN)
add_compile_definitions(HAVE_UBSAN)
add_compile_options(-fsanitize=undefined)
- if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -v -fsanitize=undefined")
- endif()
- link_libraries(ubsan)
+ link_libraries(-fsanitize=undefined)
check_flag(-fsanitize-recover=undefined IGNORE)
endif()
endif()
endif()
if(NOT ${NAME}_FOUND)
check_dependency_basic(${NAME} ${LIB} ${HEADER})
- else()
+ else()
set(${NAME} ${${NAME}_FOUND} PARENT_SCOPE)
set(${NAME}_LIBRARIES ${${NAME}_LDFLAGS} PARENT_SCOPE)
set(${NAME}_INCLUDEDIR ${${NAME}_INCLUDEDIR} PARENT_SCOPE)
-set(CMAKE_BUILD_TYPE Release
- CACHE STRING "build type (Release, Debug, ...)")
+
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ if(NOT DEFINED ENV{CMAKE_BUILD_TYPE})
+ set(ENV{CMAKE_BUILD_TYPE} Release)
+ endif()
+ set(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE}
+ CACHE STRING "build type (Release, Debug, ...)" FORCE)
+endif()
set(CMAKE_INSTALL_PREFIX /usr/local
CACHE PATH "install prefix")
endif()
option(BUILD_TESTING "whether to enable build of the test suite"
- OFF)
+ $ENV{BUILD_TESTING})
option(BUILD_DOCSONLY "build *only* documentation"
- OFF)
+ $ENV{BUILD_DOCSONLY})
option(BUILD_DOCS "build documentation"
${BUILD_DOCSONLY})
option(BUILD_DOCS_HTML "build HTML docs"
${BUILD_DOCS_MAN})
option(ENABLE_DTRACE "enable dtrace support"
- OFF)
+ $ENV{ENABLE_DTRACE})
option(ENABLE_HASH_FNV64 "enable fnv64 hash support"
ON)
option(ENABLE_HASH_MURMUR "enable murmur hash support"
ON)
option(ENABLE_HASH_HSIEH "enable hsieh hash support"
- OFF)
+ $ENV{ENABLE_HASH_HSIEH})
option(ENABLE_MEMASLAP "enable memaslap client"
ON)
option(ENABLE_SASL "enable SASL support"
- OFF)
+ $ENV{ENABLE_SASL})
-set(ENABLE_SANITIZERS ""
+set(ENABLE_SANITIZERS $ENV{ENABLE_SANITIZERS}
CACHE STRING "sanitizers to enable (e.g. address undefined ...)")
if(BUILD_TESTING)
# libmemcached
-[![Build Status](https://travis-ci.org/m6w6/libmemcached.svg?branch=v1.0)](https://travis-ci.org/m6w6/libmemcached) [![Join the chat at https://gitter.im/m6w6/libmemcached](https://badges.gitter.im/m6w6/libmemcached.svg)](https://gitter.im/m6w6/libmemcached?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![Build Status](https://github.com/m6w6/libmemcached/workflows/cmake-build-ci/badge.svg)](https://github.com/m6w6/libmemcached/actions?query=workflow%3Acmake-build-ci)
+[![Gitter Chat](https://badges.gitter.im/m6w6/libmemcached.svg)](https://gitter.im/m6w6/libmemcached?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
libmemcached is an open source C/C++ client library and tools for the
memcached server (http://memcached.org/). It has been designed to be
--- /dev/null
+
+ignore:
+ - "/usr"
+
+coverage:
+ status:
+ project:
+ default:
+ target: auto
+ threshold: 1%
+ range: 60..90
+ round: nearest
+ precision: 0
+ notify:
+ gitter:
+ default:
+ url: "https://webhooks.gitter.im/e/a6210fd7fb7b5105b2b0"
+ threshold: 1%
+
+
return NULL;
}
- memcached_return_t rc;
+ memcached_return_t rc = MEMCACHED_SUCCESS;
size_t args_length= 0;
if (args)
{
pipe = exchange(s.pipe, -1);
status = exchange(s.status, 0);
signalled = exchange(s.signalled, {});
- socket_or_port = exchange(s.socket_or_port, {});
+ socket_or_port = exchange(s.socket_or_port, 11211);
output = exchange(s.output, {});
return *this;
};
INFO("binary: " << binary);
for (auto i = 0; i < 20480; ++i) {
- auto rkey = random_ascii_string(12);
+ auto rkey = random_ascii_string(12) + to_string(i);
memcached_return_t rc = memcached_add_by_key(memc, S("key"), rkey.c_str(), rkey.length(), blob.c_str(), blob.length(), 0, 0);
if (rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE) {
SECTION("execute") {
for (auto i = 0; i < 64; ++i) {
- auto key = random_ascii_string(32);
+ auto key = random_ascii_string(12) + to_string(i);
REQUIRE_SUCCESS(memcached_set(memc, key.c_str(), key.length(), nullptr, 0, 0, 0));
}