Skip to content

Commit

Permalink
Add additional test coverage to Travis-CI. (#50)
Browse files Browse the repository at this point in the history
* NPOTB: clang clang clang goes the trolly, gcc7 goes the bell.

* Update AMBuildScript

* Initialize engine_path when abspath fails.

* Fix lptr being uninitialized when getcwd fails.

* Remove GCC6; deeper issues than this PR will cover
  • Loading branch information
KyleSanderson committed Jul 28, 2018
1 parent ad00df3 commit e573602
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 20 deletions.
109 changes: 92 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,107 @@
git:
depth: 3

sudo: false
language: cpp
os: linux
dist: trusty
addons:
apt:
packages:
- clang-3.7
- lib32stdc++6
- lib32z1-dev
- libc6-dev-i386
- linux-libc-dev
- g++-multilib
- g++-4.8
sources:
- llvm-toolchain-precise-3.7
- ubuntu-toolchain-r-test
language: cpp
sudo: false
compiler:
- clang
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-3.9
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
packages:
- lib32stdc++6
- lib32z1-dev
- libc6-dev-i386
- linux-libc-dev
- g++-multilib
# - clang-3.6
# - clang-3.8
# - clang-4.0
# - clang-5.0
# - g++-6
# - g++-6-multilib
- clang-3.9
- g++-4.8-multilib
- g++-4.8
- g++-4.9-multilib
- g++-4.9
- g++-5-multilib
- g++-5
- g++-7-multilib
- g++-7
cache:
directories:
- ../mysql-5.0
env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"

matrix:
fast_finish: true
include:
- os: linux
sudo: false
language: cpp
addons:
apt:
packages: ['clang-3.6', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev', 'g++-multilib']
env: ['MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"']

- os: linux
sudo: false
language: cpp
addons:
apt:
packages: ['clang-3.8', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev', 'g++-multilib']
env: ['MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"']

- os: linux
sudo: false
language: cpp
addons:
apt:
sources: ['llvm-toolchain-trusty-4.0']
packages: ['clang-4.0', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev', 'g++-multilib']
env: ['MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"']

- os: linux
sudo: false
language: cpp
addons:
apt:
sources: ['llvm-toolchain-trusty-5.0']
packages: ['clang-5.0', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev', 'g++-multilib']
env: ['MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"']

allow_failures:
- env: MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
- env: MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
- env: MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
- env: MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- env: MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- env: MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"


before_script:
- CHECKOUT_DIR=$PWD && cd .. && $CHECKOUT_DIR/support/checkout-deps.sh && cd $CHECKOUT_DIR
script:
- mkdir build && cd build
- PATH="~/.local/bin:$PATH"
- CC=clang-3.7 CXX=clang-3.7 python ../configure.py --enable-optimize --sdks=episode1,tf2,l4d2,csgo,dota
- eval "${MATRIX_EVAL}"
- python ../configure.py --enable-optimize --sdks=episode1,tf2,l4d2,csgo,dota
- ambuild
- cd .. && mkdir build-sh-opt && cd build-sh-opt
- CC=clang-3.7 CXX=clang-3.7 python ../configure.py --enable-optimize --enable-tests --sdks=
- python ../configure.py --enable-optimize --enable-tests --sdks=
- ambuild
- ./core/sourcehook/test/test_sourcehook/test_sourcehook -v
- cd .. && mkdir build-sh-debug && cd build-sh-debug
- CC=clang-3.7 CXX=clang-3.7 python ../configure.py --enable-debug --enable-tests --sdks=
- python ../configure.py --enable-debug --enable-tests --sdks=
- ambuild
- ./core/sourcehook/test/test_sourcehook/test_sourcehook -v
2 changes: 2 additions & 0 deletions AMBuildScript
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ class MMSConfig(object):
cxx.cflags += ['-mfpmath=sse']
if cxx.family == 'clang':
cxx.cxxflags += ['-Wno-implicit-exception-spec-mismatch']
if cxx.version >= 'clang-3.9':
cxx.cxxflags += ['-Wno-expansion-to-defined']
if cxx.version >= 'clang-3.6' or cxx.version >= 'apple-clang-7.0':
cxx.cxxflags += ['-Wno-inconsistent-missing-override']
if cxx.version >= 'apple-clang-5.1' or cxx.version >= 'clang-3.4':
Expand Down
8 changes: 7 additions & 1 deletion core/metamod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@ void InitializeVSP()
break;
}
}
abspath(engine_path, engine_file);

/* If this fails the file either does not exist or
* on Windows the buffer may be too small. */
if (abspath(engine_path, engine_file) == NULL)
{
engine_path[0] = '\0';
}

const char *usepath = metamod_path.c_str();
if (UTIL_Relatize(rel_path, sizeof(rel_path), engine_path, metamod_path.c_str()))
Expand Down
6 changes: 4 additions & 2 deletions loader/gamedll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ mm_DetectGameInformation()

char temp_path[PLATFORM_MAX_PATH];
char cur_path[PLATFORM_MAX_PATH];
getcwd(cur_path, sizeof(cur_path));

char *ptr;
const char *lptr;
Expand Down Expand Up @@ -162,7 +161,10 @@ mm_DetectGameInformation()
else
{
ptr = val;
lptr = cur_path;
if (getcwd(cur_path, sizeof(cur_path)))
lptr = cur_path;
else
lptr = "";
}

const char *pRelPath = is_source2 ? "../../" : "";
Expand Down

0 comments on commit e573602

Please sign in to comment.