Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
786b9f0
Add iwyu to travis.
etr Aug 25, 2020
e90e1b2
Fix else statement on travis
etr Aug 25, 2020
fc74d93
Fix typo
etr Aug 25, 2020
6191d1a
Letting iwyu find its system libraries
etr Aug 25, 2020
abf5c43
Print clang resource files
etr Aug 26, 2020
0d50ec8
Specify correct clang include path to IWYU.
etr Aug 26, 2020
ff84dfe
Use iwyu from sources
etr Aug 26, 2020
7bce61f
Added apt sources to travis to find packages
etr Aug 26, 2020
3a4527b
Fix iwyu commands
etr Aug 26, 2020
a637da6
Print more clang and iwyu paths
etr Aug 26, 2020
e7b36db
Reducing scope of build to only the interested one
etr Aug 26, 2020
ab742d4
Add compiler
etr Aug 26, 2020
bc1e4a6
Exclude combinatorial ENVs
etr Aug 26, 2020
184d67f
Remove the rest of params for make to work
etr Aug 26, 2020
34c1892
Attempt to compile iwyu
etr Aug 26, 2020
f064b0d
Fetch clang version from system
etr Aug 26, 2020
97200f4
Fix version sourcing
etr Aug 26, 2020
d60e351
Fix paths
etr Aug 26, 2020
2b99556
Fix versions using llvm
etr Aug 26, 2020
b4b0434
Added missing semicolon
etr Aug 26, 2020
3913a03
Fix version check
etr Aug 26, 2020
c96adce
Fix and print paths
etr Aug 26, 2020
698419a
use llvm config to deduce paths
etr Aug 26, 2020
43a99c3
Find location of stddef.h
etr Aug 26, 2020
36e9e9c
Print which clang
etr Aug 26, 2020
8a3a694
Fix version extraction
etr Aug 26, 2020
249b10d
Fix versioning further
etr Aug 26, 2020
d4356aa
Fix binary name
etr Aug 26, 2020
090e5ed
passing a system path to iwyu
etr Aug 26, 2020
a536fa3
Getting the config back to run all tests
etr Aug 26, 2020
840691e
Fix codebase to pass IWYU checks.
etr Aug 26, 2020
ae437b5
Fix import on http_utils.hpp
etr Aug 26, 2020
3a43cae
Fix includes in http_utils.cpp
etr Aug 26, 2020
a400a70
Fix imports in http_utils.hpp
etr Aug 26, 2020
33b47b9
Remove ignore travis for appveyor
etr Aug 26, 2020
267f452
Fix broken include when building on mingw
etr Aug 26, 2020
e158568
Fix spacing
etr Aug 26, 2020
b2f0b3f
Fix include for mingw in webserver.hpp
etr Aug 26, 2020
16fd75f
Avoid breaking when iwyu is fine
etr Aug 27, 2020
287812e
Redundant include for FreeBSD (already included)
etr Aug 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ env:
- LINKING="static"
before_install:
- eval "${MATRIX_EVAL}"
# Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise.
- if [ "$IWYU" = "iwyu" ]; then
CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ;
CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'`
CLANG_PREFIX_PATH="/usr/local/clang-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}" ;
CLANG_BIN_PATH="/usr/local/clang-${CLANG_VERSION}/bin" ;
git clone https://github.com/include-what-you-use/include-what-you-use.git ;
cd include-what-you-use ;
echo "$CLANG_PKG_VERSION" | grep '\.[0-9]$' ;
if [ $? -eq 0 ]; then
git checkout clang_${CLANG_PKG_VERSION} ;
else
git checkout clang_${CLANG_PKG_VERSION}.0 ;
fi;
cd .. ;
mkdir build_iwyu ;
cd build_iwyu ;
cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ;
make ;
sudo make install ;
cd .. ;
fi
- export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib"
- export PATH=$PATH:/usr/local/lib
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
Expand All @@ -37,21 +59,32 @@ install:
- ./bootstrap
- mkdir build
- cd build
- if [ "$LINKING" = "static" ]; then
- |
if [ "$LINKING" = "static" ]; then
../configure --enable-static --disable-fastopen;
elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then
../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen;
elif [ "$DEBUG" = "debug" ]; then
../configure --enable-debug --disable-shared --disable-fastopen;
elif [ "$VALGRIND" = "valgrind" ]; then
../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck;
elif [ "$IWYU" = "iwyu" ]; then
../configure --disable-examples;
else
../configure --disable-fastopen;
fi
- make
# Make or run iwyu. If running iwyu, check for the result code to be 2 (IWYU always returns an error code, if it is 2, no corrections are necessary).
- |
if [ "$IWYU" = "iwyu" ]; then
make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem ${CLANG_PREFIX_PATH}/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ;
if [ $? -ne 2 ]; then
return 1;
fi
else
make;
fi
script:
- make check
- cat test/test-suite.log
- if [ "$IWYU" != "iwyu" ]; then make check; cat test/test-suite.log; fi
- if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; fi;
- if [ "$VALGRIND" = "valgrind" ]; then cat test/test-suite-memcheck.log; fi;
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; fi
Expand Down Expand Up @@ -309,3 +342,17 @@ matrix:
- clang-9
env:
- MATRIX_EVAL="CC=clang-9 && CXX=clang++-9"
- os: linux
compiler: clang
addons:
apt:
sources:
- llvm-toolchain-xenial-7
- ubuntu-toolchain-r-test
packages:
- iwyu
- cmake
- llvm-dev
- libclang-dev
env:
- MATRIX_EVAL="IWYU=iwyu"
8 changes: 0 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
platform: x64

branches:
except:
- /.*travis.*/
skip_commits:
message: /travis/
files:
- .travis.yml

environment:
matrix:
- compiler: msys2
Expand Down
17 changes: 17 additions & 0 deletions custom_iwyu.imp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{ include: ["\"microhttpd.h\"", "private", "<microhttpd.h>", "public"] },
{ include: ["<ext/alloc_traits.h>", "private", "<memory>", "public"] },

{ symbol: ["std::exception", "private", "<exception>", "public"]},
{ symbol: ["std::shared_ptr", "private", "<memory>", "public"]},
{ symbol: ["std::uint16_t", "private", "<cstdint>", "public"]},
{ symbol: ["std::uint64_t", "private", "<cstdint>", "public"]},
{ symbol: ["std::istringstream", "private", "<sstream>", "public"]},
{ symbol: ["std::stringstream", "private", "<sstream>", "public"]},
{ symbol: ["std::ifstream", "private", "<fstream>", "public"]},

{ symbol: ["uint16_t", "private", "<stdint.h>", "public"]},
{ symbol: ["uint64_t", "private", "<stdint.h>", "public"]},

{ symbol: ["MHD_Connection", "private", "<microhttpd.h>", "public"]},
]
4 changes: 4 additions & 0 deletions src/basic_auth_fail_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
*/

#include "httpserver/basic_auth_fail_response.hpp"
#include <microhttpd.h>

struct MHD_Connection;
struct MHD_Response;

using namespace std;

Expand Down
3 changes: 3 additions & 0 deletions src/deferred_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
*/

#include "httpserver/deferred_response.hpp"
#include <microhttpd.h>

struct MHD_Response;

using namespace std;

Expand Down
10 changes: 8 additions & 2 deletions src/details/http_endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@
USA
*/

#include <ctype.h>
#include <map>
#include <memory>
#include <regex>
#include <sstream>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>

#include "httpserver/details/http_endpoint.hpp"

#include "httpserver/http_utils.hpp"
#include "httpserver/string_utilities.hpp"

using namespace std;

Expand Down
4 changes: 4 additions & 0 deletions src/digest_auth_fail_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
*/

#include "httpserver/digest_auth_fail_response.hpp"
#include <microhttpd.h>

struct MHD_Connection;
struct MHD_Response;

using namespace std;

Expand Down
6 changes: 5 additions & 1 deletion src/file_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
*/

#include "httpserver/file_response.hpp"

#include <fcntl.h>
#include <microhttpd.h>
#include <stddef.h>
#include <unistd.h>

struct MHD_Response;

using namespace std;

Expand Down
4 changes: 2 additions & 2 deletions src/http_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
*/

#include "httpserver/http_request.hpp"

#include <stdio.h>
#include <stdlib.h>
#include <iostream>

#include "httpserver/http_utils.hpp"
#include "httpserver/string_utilities.hpp"

Expand Down
11 changes: 3 additions & 8 deletions src/http_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@
*/

#include "httpserver/http_resource.hpp"

#include <stdlib.h>

#include "httpserver/http_request.hpp"
#include "httpserver/http_response.hpp"
#include "httpserver/http_utils.hpp"
#include <microhttpd.h>
#include "httpserver/string_response.hpp"
#include "httpserver/string_utilities.hpp"
#include "httpserver/webserver.hpp"

namespace httpserver { class http_response; }

using namespace std;

Expand Down
10 changes: 2 additions & 8 deletions src/http_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
*/

#include "httpserver/http_response.hpp"

#include <fcntl.h>
#include <unistd.h>
#include <cstdio>
#include <functional>
#include <microhttpd.h>
#include <iostream>
#include <sstream>

#include <utility>
#include "httpserver/http_utils.hpp"
#include "httpserver/webserver.hpp"

using namespace std;

Expand Down
9 changes: 3 additions & 6 deletions src/http_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#else // WIN32 check
#if defined(__FreeBSD__)
#include <netinet/in.h>
#endif // FreeBSD
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
Expand All @@ -36,10 +33,10 @@

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iomanip>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <utility>
Expand Down
5 changes: 5 additions & 0 deletions src/httpserver/basic_auth_fail_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
#ifndef _BASIC_AUTH_FAIL_RESPONSE_HPP_
#define _BASIC_AUTH_FAIL_RESPONSE_HPP_

#include <string>
#include "http_utils.hpp"
#include "httpserver/string_response.hpp"

struct MHD_Connection;
struct MHD_Response;

namespace httpserver
{

Expand Down
8 changes: 7 additions & 1 deletion src/httpserver/deferred_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@
#ifndef _DEFERRED_RESPONSE_HPP_
#define _DEFERRED_RESPONSE_HPP_

#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include <memory>

#include <string>
#include "http_utils.hpp"
#include "httpserver/string_response.hpp"

struct MHD_Response;

namespace httpserver
{

Expand Down
5 changes: 5 additions & 0 deletions src/httpserver/digest_auth_fail_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
#ifndef _DIGEST_AUTH_FAIL_RESPONSE_HPP_
#define _DIGEST_AUTH_FAIL_RESPONSE_HPP_

#include <string>
#include "http_utils.hpp"
#include "httpserver/string_response.hpp"

struct MHD_Connection;
struct MHD_Response;

namespace httpserver
{

Expand Down
4 changes: 4 additions & 0 deletions src/httpserver/file_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
#ifndef _FILE_RESPONSE_HPP_
#define _FILE_RESPONSE_HPP_

#include <string>
#include "http_utils.hpp"
#include "httpserver/http_response.hpp"

struct MHD_Response;

namespace httpserver
{

Expand Down
12 changes: 4 additions & 8 deletions src/httpserver/http_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#ifndef _HTTP_REQUEST_HPP_
#define _HTTP_REQUEST_HPP_

#include <microhttpd.h>

#include <stddef.h>
#include <algorithm>
#include <iosfwd>
#include <map>
#include <string>
Expand All @@ -38,14 +42,6 @@ struct MHD_Connection;
namespace httpserver
{

class webserver;

namespace http
{
class header_comparator;
class arg_comparator;
};

/**
* Class representing an abstraction for an Http Request. It is used from classes using these apis to receive information through http protocol.
**/
Expand Down
18 changes: 6 additions & 12 deletions src/httpserver/http_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@
#ifdef DEBUG
#include <iostream>
#endif

#include <map>
#include <memory>
#include <string>
#include <utility>

#include "httpserver/http_response.hpp"

namespace httpserver
{
namespace httpserver { class http_request; }
namespace httpserver { class http_response; }

class webserver;
class http_request;
namespace httpserver {

namespace details
{

std::shared_ptr<http_response> empty_render(const http_request& r);

};
namespace details { std::shared_ptr<http_response> empty_render(const http_request& r); };

/**
* Class representing a callable http resource.
Expand Down
4 changes: 0 additions & 4 deletions src/httpserver/http_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@

#include <iosfwd>
#include <map>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>

#include "httpserver/http_utils.hpp"

struct MHD_Connection;
Expand Down
Loading