diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-05-18 10:55:20 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-06-02 15:55:45 -0700 |
commit | 919fea438a5ac5366684cfa26d2bb3d17519cb60 (patch) | |
tree | 6a2d282c3c7910263241e03f41be23c6a6cda710 /travis.sh | |
parent | 6650b3c6527c17965adf7239850857a10d56ba62 (diff) |
Ported upb to C89, for greater portability.
A large part of this change contains surface-level
porting, like moving variable declarations to the
top of the block.
However there are a few more substantial things too:
- moved internal-only struct definitions to a separate
file (structdefs.int.h), for greater encapsulation
and ABI compatibility.
- removed the UPB_UPCAST macro, since it requires access
to the internal-only struct definitions. Replaced uses
with calls to inline, type-safe casting functions.
- removed the UPB_DEFINE_CLASS/UPB_DEFINE_STRUCT macros.
Class and struct definitions are now more explicit -- you
get to see the actual class/struct keywords in the source.
The casting convenience functions have been moved into
UPB_DECLARE_DERIVED_TYPE() and UPB_DECLARE_DERIVED_TYPE2().
- the new way that we duplicate base methods in derived types
is also more convenient and requires less duplication.
It is also less greppable, but hopefully that is not
too big a problem.
Compiler flags (-std=c89 -pedantic) should help to rigorously
enforce that the code is free of C99-isms.
A few functions are not available in C89 (strtoll). There
are temporary, hacky solutions in place.
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 42 |
1 files changed, 38 insertions, 4 deletions
@@ -46,7 +46,7 @@ core32_install() { sudo apt-get install libc6-dev-i386 g++-multilib } core32_script() { - make -j12 tests USER_CPPFLAGS=-m32 + make -j12 tests USER_CPPFLAGS="$USER_CPPFLAGS -m32" make test } @@ -56,7 +56,7 @@ lua_install() { sudo apt-get install lua5.2 liblua5.2-dev } lua_script() { - make -j12 testlua USER_CPPFLAGS=`pkg-config lua5.2 --cflags` + make -j12 testlua USER_CPPFLAGS="$USER_CPPFLAGS `pkg-config lua5.2 --cflags`" } # Test that generated files don't need to be regenerated. @@ -69,7 +69,7 @@ genfiles_install() { sudo apt-get install lua5.2 liblua5.2-dev protobuf-compiler } genfiles_script() { - make -j12 genfiles USER_CPPFLAGS=`pkg-config lua5.2 --cflags` + make -j12 genfiles USER_CPPFLAGS="$USER_CPPFLAGS `pkg-config lua5.2 --cflags`" # Will fail if any differences were observed. git diff --exit-code } @@ -104,10 +104,35 @@ coverage_after_success() { set -e set -x +if [ "$1" == "local" ]; then + run_config() { + make clean + echo + echo "travis.sh: TESTING CONFIGURATION $1 ===============================" + echo + UPB_TRAVIS_BUILD=$1 ./travis.sh script + } + # Run all configurations serially locally to test before pushing a pull + # request. + export CC=gcc + export CXX=g++ + run_config "bare" + run_config "barejit" + run_config "core32" + run_config "withprotobuf" + run_config "lua" + run_config "ndebug" + run_config "genfiles" + exit +fi + $CC --version $CXX --version -if [ "$1" == "after_failure" ]; then +# Uncomment to enable uploading failure logs to S3. +# UPLOAD_TO_S3=true + +if [ "$1" == "after_failure" ] && [ "$UPLOAD_TO_S3" == "true" ]; then # Upload failing tree to S3. curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash PATH="$PATH:$HOME/bin" @@ -131,6 +156,15 @@ fi # Enable asserts and ref debugging (though some configurations override this). export USER_CPPFLAGS="-UNDEBUG -DUPB_DEBUG_REFS -DUPB_THREAD_UNSAFE -g" +if [ "$CC" == "gcc" ]; then + # For the GCC build test loading JIT code via SO. For the Clang build test + # loading it in the normal way. + export USER_CPPFLAGS="$USER_CPPFLAGS -DUPB_JIT_LOAD_SO" +fi + +# TODO(haberman): Test UPB_DUMP_BYTECODE? We don't right now because it is so +# noisy. + # Enable verbose build. export Q= |