Skip to content

Commit

Permalink
Add a Travis CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
amotzkau committed Aug 22, 2019
1 parent bbbbf67 commit fe5b22a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
language: c

dist: bionic

compiler:
- clang

addons:
apt:
packages:
- bison
- autoconf
- autogen
- libgcrypt20-dev
- libgnutls28-dev
- libsqlite3-dev
- libpq-dev
- libmysqlclient-dev
- python3-dev
- libjson-c-dev
- libxml2-dev
- zlib1g-dev

before_script:
- cd src
- unset PYTHON_CFLAGS

script:
- ./autogen.sh
- ./configure --enable-use-ipv6 --enable-use-mccp --enable-use-json --enable-use-pcre
--enable-use-mysql --enable-use-pgsql --enable-use-sqlite
--enable-use-xml --enable-use-tls --enable-use-gcrypt --enable-use-python
--enable-malloc-trace --enable-malloc-lpc-trace --enable-dynamic-costs
--enable-eval-cost-trace --enable-trace-code
EXTRA_CFLAGS="-DINSIDE_TRAVIS -Werror"
- make
- cd ../test && ./run.sh
2 changes: 1 addition & 1 deletion src/autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ fi
# searchpath.

AC_CACHE_CHECK(for PostgresSQL,lp_cv_has_pgsql,
for TESTPATH in "" "$pgsql_path" "$pgsql_path/include" "/usr/local/pgsql/include" "/usr/local/include/pgsql" "/usr/include/pgsql" "/usr/lib/pgsql" "/usr/local/include"; do
for TESTPATH in "" "$pgsql_path" "$pgsql_path/include" "/usr/local/pgsql/include" "/usr/local/include/pgsql" "/usr/include/pgsql" "/usr/include/postgresql" "/usr/local/include/postgresql" "/usr/lib/pgsql" "/usr/local/include"; do
saveflags="$CFLAGS"
if test "x$TESTPATH" != "x"; then
CFLAGS="$saveflags -I$TESTPATH"
Expand Down
14 changes: 11 additions & 3 deletions src/comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -8147,16 +8147,24 @@ f_net_connect (svalue_t *sp)
memset(&hints, 0, sizeof(struct addrinfo));
#ifndef USE_IPV6
hints.ai_family = AF_INET; // Allow only IPv4
hints.ai_flags = AI_ADDRCONFIG; // only IPv4 if at least one interface with IPv4 and only IPv6 if at least one interface with IPv6
// only IPv4 if at least one interface with IPv4 and
// only IPv6 if at least one interface with IPv6
hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV;
#else
hints.ai_family = AF_INET6; // Allow only IPv6
// only IPv6 if at least one interface with IPv6.
// And list IPv4 addresses as IPv4-mapped IPv6 addresses if no IPv6 addresses could be found.
hints.ai_flags = AI_ADDRCONFIG|AI_V4MAPPED;
hints.ai_flags = AI_ADDRCONFIG|AI_V4MAPPED|AI_NUMERICSERV;
#endif
hints.ai_socktype = SOCK_STREAM; // TCP socket
hints.ai_protocol = 0; // Any protocol


#ifdef INSIDE_TRAVIS
// The Travis-CI environment only has loopback devices activated,
// the AI_ADDRCONFIG would therefore never find a name.
hints.ai_flags &= ~AI_ADDRCONFIG;
#endif

/* TODO: Uh-oh, blocking DNS in the execution thread.
* TODO:: Better would be to start an ERQ lookup and fill in the
* TODO:: data in the background.
Expand Down
2 changes: 1 addition & 1 deletion src/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# when in a git repository, determine these values from it automagically and
# override the defaults
if test -d ../.git && test -x "`which git 2>&1;true`"; then
if test -d ../.git && test -x "`which git 2>&1;true`" && git describe --match '3.*' 2>/dev/null; then
TAGNAME=`git describe --match '3.*' |cut -d '-' -f 1`
version_major=`echo $TAGNAME |cut -d '.' -f 1`
version_minor=`echo $TAGNAME |cut -d '.' -f 2`
Expand Down

0 comments on commit fe5b22a

Please sign in to comment.