Skip to content

Commit aeb577b

Browse files
committed
copy paste CI stuff from common
1 parent f870d08 commit aeb577b

18 files changed

+46
-101
lines changed

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ Standard: Cpp11
5555
TabWidth: 4
5656
UseTab: Never
5757
...
58+

.clang-tidy

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,google-runtime-int,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*'
2+
Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,google-runtime-int,llvm-header-guard,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*'
33
WarningsAsErrors: '*'
4-
HeaderFilterRegex: '\./*'
4+
HeaderFilterRegex: '.*(?<!lookup3.c)$'
55
FormatStyle: 'file'
6-
# Use empty line filter to skip linting code we don't own
76
CheckOptions:
87
- key: readability-braces-around-statements.ShortStatementLines
98
value: '1'
@@ -12,4 +11,4 @@ CheckOptions:
1211
- key: fuchsia-restrict-system-includes.Includes
1312
value: '*,-stdint.h,-stdbool.h'
1413

15-
...
14+
...

.travis.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
sudo: true
1+
sudo: false
22
language: c
33

44
osx_image: xcode8
55

6-
#run builds for linux and osx. will add windows shortly
76
os:
8-
# - osx add osx back when travis fixes their mac os scaling problems.
9-
- linux
7+
- osx
108

11-
#run builds on both gcc and clang
129
compiler:
13-
- gcc
1410
- clang
1511

16-
install:
17-
- sudo apt-get install -qq cppcheck
18-
1912
#execute build
2013
script:
21-
- .travis/travis_build.sh
14+
- mkdir build
15+
- cd build
16+
- cmake -DENABLE_SANITIZERS=ON ..
17+
- make && make test
18+

codebuild/common-linux.sh

+3-27
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,13 @@
22

33
set -e
44

5-
CMAKE_ARGS="$@"
6-
7-
function install_library {
8-
git clone https://github.com/awslabs/$1.git
9-
cd $1
10-
mkdir build
11-
cd build
12-
13-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
14-
make install
15-
16-
cd ../..
17-
}
18-
19-
20-
cd ../
21-
22-
mkdir install
23-
24-
install_library s2n
25-
install_library aws-c-common
26-
27-
cd aws-c-http
285
mkdir build
296
cd build
30-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
317

8+
cmake -DPERFORM_HEADER_CHECK=ON -DENABLE_SANITIZERS=ON $@ ../
329
make
33-
34-
LSAN_OPTIONS=verbosity=1:log_threads=1 ctest --output-on-failure
10+
make test
3511

3612
cd ..
3713

38-
# ./cppcheck.sh ../install/include
14+
./cppcheck.sh

codebuild/common-macos.sh

+2-24
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,9 @@
44

55
set -e
66

7-
CMAKE_ARGS="$@"
8-
9-
function install_library {
10-
git clone https://github.com/awslabs/$1.git
11-
cd $1
12-
mkdir build
13-
cd build
14-
15-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
16-
make install
17-
18-
cd ../..
19-
}
20-
21-
cd ../
22-
23-
mkdir install
24-
25-
install_library aws-c-common
26-
27-
cd aws-c-http
287
mkdir build
298
cd build
30-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
319

10+
cmake -DPERFORM_HEADER_CHECK=ON -DENABLE_SANITIZERS=ON $@ ../
3211
make
33-
34-
LSAN_OPTIONS=verbosity=1:log_threads=1 ctest --output-on-failure
12+
make test

codebuild/common-windows.bat

+6-21
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
1-
cd ../
2-
set CMAKE_ARGS=%*
31

4-
mkdir install
5-
6-
CALL :install_library aws-c-common
7-
8-
cd aws-c-http
92
mkdir build
103
cd build
11-
cmake %CMAKE_ARGS% -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=../../install ../ || goto error
12-
cmake --build . --config Release || goto error
13-
ctest -V
4+
cmake %* -DPERFORM_HEADER_CHECK=ON -DCMAKE_BUILD_TYPE="Release" ../ || goto error
5+
msbuild.exe aws-c-common.vcxproj /p:Configuration=Release || goto error
6+
msbuild.exe tests/aws-c-common-assert-tests.vcxproj /p:Configuration=Release
7+
msbuild.exe tests/aws-c-common-tests.vcxproj /p:Configuration=Release
8+
ctest -V || goto error
149

1510
goto :EOF
1611

17-
:install_library
18-
git clone https://github.com/awslabs/%~1.git
19-
cd %~1
20-
mkdir build
21-
cd build
22-
cmake %CMAKE_ARGS% -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=../../install ../ || goto error
23-
cmake --build . --target install --config Release || goto error
24-
cd ../..
25-
exit /b %errorlevel%
26-
2712
:error
2813
echo Failed with error #%errorlevel%.
29-
exit /b %errorlevel%
14+
exit /b %errorlevel%

codebuild/linux-clang3-x64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ phases:
1414
commands:
1515
- echo Build started on `date`
1616
- ./codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
17-
# - clang-tidy-3.9 -p=build **/*.c
17+
- clang-tidy-3.9 -p=build **/*.c
1818
post_build:
1919
commands:
2020
- echo Build completed on `date`
21+

codebuild/linux-clang6-x64.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ phases:
1212
pre_build:
1313
commands:
1414
- export CC=clang-6.0
15+
- export CXX=clang++-6.0
1516
- export CLANG_FORMAT=clang-format-6.0
1617
build:
1718
commands:
1819
- echo Build started on `date`
19-
- ./codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
20+
- ./codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_FUZZ_TESTS=ON
2021
- clang-tidy-6.0 -p=build **/*.c
2122
- ./format-check.sh
2223
post_build:
2324
commands:
2425
- echo Build completed on `date`
26+

codebuild/linux-gcc-4x-x64.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ phases:
44
install:
55
commands:
66
- sudo apt-get update -y
7-
- sudo apt-get install gcc cmake3 cppcheck -y
7+
- sudo apt-get install gcc g++ cmake3 cppcheck -y
88
pre_build:
99
commands:
1010
- export CC=gcc
11+
- export CXX=g++
1112
build:
1213
commands:
1314
- echo Build started on `date`
1415
- ./codebuild/common-linux.sh
1516
post_build:
1617
commands:
1718
- echo Build completed on `date`
19+

codebuild/linux-gcc-4x-x86.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ phases:
44
install:
55
commands:
66
- sudo apt-get update -y
7-
- sudo apt-get install gcc gcc-multilib cmake3 cppcheck -y
7+
- sudo apt-get install gcc gcc-multilib g++ g++-multilib cmake3 cppcheck -y
88
pre_build:
99
commands:
1010
- export CC=gcc
11+
- export CXX=g++
1112
build:
1213
commands:
1314
- echo Build started on `date`
14-
- ./codebuild/common-linux.sh -DCMAKE_C_FLAGS="-m32" -DCMAKE_LINK_FLAGS="-m32"
15+
- ./codebuild/common-linux.sh -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_LINK_FLAGS="-m32"
1516
post_build:
1617
commands:
1718
- echo Build completed on `date`
19+

codebuild/linux-gcc-5x-x64.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ phases:
1616
post_build:
1717
commands:
1818
- echo Build completed on `date`
19+

codebuild/linux-gcc-6x-x64.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ phases:
1616
post_build:
1717
commands:
1818
- echo Build completed on `date`
19+

codebuild/linux-gcc-7x-x64.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ phases:
1616
post_build:
1717
commands:
1818
- echo Build completed on `date`
19+

codebuild/windows-msvc-2015-x86.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ phases:
44
build:
55
commands:
66
- .\codebuild\common-windows.bat -G "Visual Studio 14 2015"
7+

codebuild/windows-msvc-2015.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ phases:
44
build:
55
commands:
66
- .\codebuild\common-windows.bat -G "Visual Studio 14 2015 Win64"
7+

codebuild/windows-msvc-2017.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ phases:
44
build:
55
commands:
66
- .\codebuild\common-windows.bat -G "Visual Studio 15 2017 Win64"
7+

cppcheck.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,19 @@
22

33
set -e
44

5-
for path in "$@"
6-
do
7-
INCLUDE_PATHS="$INCLUDE_PATHS -I $path"
8-
done
9-
105
cppcheck \
116
\
127
--enable=all --std=c99 --language=c \
138
--template='[{file}:{line}]: ({severity},{id}){message}' \
149
--force --error-exitcode=-1 \
1510
\
1611
-I include \
17-
$INCLUDE_PATHS \
1812
-USELF_TEST -UCLOCK_MONOTONIC_RAW \
1913
\
20-
--suppress=missingIncludeSystem \
2114
--suppress=unusedFunction \
22-
--suppress=allocaCalled --suppress=obsoleteFunctionsalloca \
15+
--suppress=missingInclude \
16+
--suppress=memleak:tests/hash_table_test.c \
17+
--suppress=staticStringCompare:tests/assert_test.c \
18+
--suppress=*:build/tests/test_runner.c \
2319
\
2420
-q .

format-check.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if NOT type $CLANG_FORMAT 2> /dev/null ; then
1010
fi
1111

1212
FAIL=0
13-
SOURCE_FILES=`find source include tests -type f \( -name '*.h' -o -name '*.c' \)`
13+
SOURCE_FILES=`find source include tests -type f \( -name '*.h' -o -name '*.c' \) -not -name "lookup3.c" -not -name "common.h"`
1414
for i in $SOURCE_FILES
1515
do
1616
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
@@ -21,4 +21,4 @@ do
2121
fi
2222
done
2323

24-
exit $FAIL
24+
exit $FAIL

0 commit comments

Comments
 (0)