diff --git a/.clang-format b/.clang-format index 449a149..ca08a86 100644 --- a/.clang-format +++ b/.clang-format @@ -21,7 +21,6 @@ AlwaysBreakTemplateDeclarations: true BinPackArguments: false BinPackParameters: false BraceWrapping: - AfterCaseLabel: true AfterClass: true AfterControlStatement: true AfterEnum: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c43bb32..2290c28 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -207,6 +207,7 @@ jobs: cmakeArgs: '.. -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On' - script: | + set -eo pipefail make -j 4 workingDirectory: build @@ -214,6 +215,7 @@ jobs: displayName: 'Compile' - script: | + set -eo pipefail ctest -j 4 --output-on-failure -C $(BuildType) workingDirectory: build @@ -226,6 +228,7 @@ jobs: vmImage: 'ubuntu-16.04' steps: - script: | + set -eo pipefail wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" sudo apt-get update @@ -240,14 +243,17 @@ jobs: cmakeArgs: '..' - script: | + set -eo pipefail make clangformat git diff - if [ "$(git diff $(Build.SourceVersion))" != "" ]; then exit 1; fi + git diff --exit-code $(Build.SourceVersion) workingDirectory: build + failOnStderr: true displayName: 'Clang-Format' - script: | + set -eo pipefail clang-tidy-8 src/override/malloc.cc -header-filter="`pwd`/*" -export-fixes=tidy.fail -- -std=c++17 -mcx16 if [ -f tidy.fail ] ; then exit 1 ; fi diff --git a/src/test/setup.h b/src/test/setup.h index 2591f43..20936cc 100644 --- a/src/test/setup.h +++ b/src/test/setup.h @@ -70,7 +70,6 @@ void _cdecl error(int signal) _exit(1); } -# define CALL_LAST 0 LONG WINAPI VectoredHandler(struct _EXCEPTION_POINTERS* ExceptionInfo) { UNUSED(ExceptionInfo); @@ -89,7 +88,11 @@ void setup() _set_abort_behavior(0, _WRITE_ABORT_MSG); signal(SIGABRT, error); - AddVectoredExceptionHandler(CALL_LAST, VectoredHandler); + // If we have an unhandled exception print a stack trace. + SetUnhandledExceptionFilter(VectoredHandler); + + // Disable OS level dialog boxes during CI. + SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); } #else void setup() {}