Skip to content

Commit

Permalink
Some improvements to CI (#121)
Browse files Browse the repository at this point in the history
* Removing option as not supported by CI

Will migrate CI forward and readd.

* Made failure for clang-format errors.

* Improved handling of errors during CI.

* Prevent failures escaping.

* Clang-format fix

* Remove stderr

* Update azure-pipelines.yml

Co-Authored-By: Paul Liétar <[email protected]>

Co-authored-by: Paul Liétar <[email protected]>
  • Loading branch information
mjp41 and plietar authored Feb 3, 2020
1 parent 7e22d30 commit afc77d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
Expand Down
8 changes: 7 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,15 @@ jobs:
cmakeArgs: '.. -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On'

- script: |
set -eo pipefail
make -j 4
workingDirectory: build
failOnStderr: true
displayName: 'Compile'
- script: |
set -eo pipefail
ctest -j 4 --output-on-failure -C $(BuildType)
workingDirectory: build
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/test/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void _cdecl error(int signal)
_exit(1);
}

# define CALL_LAST 0
LONG WINAPI VectoredHandler(struct _EXCEPTION_POINTERS* ExceptionInfo)
{
UNUSED(ExceptionInfo);
Expand All @@ -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() {}
Expand Down

0 comments on commit afc77d9

Please sign in to comment.