Clean up script commands in .travis.yml.

Besides general whitespace and quoting cleanup, commands that test
variables were changed from:
  [ $B = a ] && command || true
to
  if [ $B = a ] ; then command ; fi
This form correctly returns the exit code of "command".
This commit is contained in:
Jim Paris 2014-07-05 15:08:54 -04:00
parent 784b20c04d
commit 4242182588

View File

@ -2,41 +2,65 @@ notifications:
email: false email: false
language: c #NOTE: this will set CC=gcc which might cause trouble language: c #NOTE: this will set CC=gcc which might cause trouble
before_script: before_script:
- "sudo apt-get -qq update" - sudo apt-get -qq update
## Install these mainline toolchains for all build types
- "sudo apt-get -qq install lib32z1 || true" ## Install msp430 toolchain
- "curl -s \ - sudo apt-get -qq install lib32z1
http://adamdunkels.github.io/contiki-fork/mspgcc-4.7.0-compiled.tar.bz2 \ - curl -s
| tar xjf - -C /tmp/ && sudo cp -f -r /tmp/msp430/* /usr/local/ && rm -rf /tmp/msp430 && msp430-gcc --version || true" http://adamdunkels.github.io/contiki-fork/mspgcc-4.7.0-compiled.tar.bz2
- "sudo apt-get -qq install gcc-avr avr-libc || true" | tar xjf - -C /tmp/ &&
- "sudo apt-get -qq install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 || true" sudo cp -f -r /tmp/msp430/* /usr/local/ &&
rm -rf /tmp/msp430 &&
msp430-gcc --version
## Install avr toolchain
- sudo apt-get -qq install gcc-avr avr-libc
## Install 32-bit compatibility libraries
- sudo apt-get -qq install libc6:i386 libgcc1:i386 gcc-4.6-base:i386
libstdc++5:i386 libstdc++6:i386
## Install toolchain for mc1233x, cc2538 and mbxxx in care-free way ## Install toolchain for mc1233x, cc2538 and mbxxx in care-free way
- "[ ${BUILD_ARCH:-0} = arm ] && curl -s \ - if [ ${BUILD_ARCH:-0} = arm ] ; then
https://raw.githubusercontent.com/wiki/malvira/libmc1322x/files/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \ curl -s
| tar xjf - -C /tmp/ && sudo cp -f -r /tmp/arm-2008q3/* /usr/ && rm -rf /tmp/arm-2008q3 && arm-none-eabi-gcc --version || true" https://raw.githubusercontent.com/wiki/malvira/libmc1322x/files/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
| tar xjf - -C /tmp/ &&
sudo cp -f -r /tmp/arm-2008q3/* /usr/ &&
rm -rf /tmp/arm-2008q3 &&
arm-none-eabi-gcc --version ;
fi
## Install RL78 GCC chain (following the instructions in platform/eval-adf7xxxmb4z/README.md) ## Install RL78 GCC toolchain
- "sudo apt-get install libncurses5:i386 zlib1g:i386 || true" - sudo apt-get install libncurses5:i386 zlib1g:i386
- "wget http://adamdunkels.github.io/contiki-fork/gnurl78-v13.02-elf_1-2_i386.deb && sudo dpkg -i gnurl78*.deb || true" - wget http://adamdunkels.github.io/contiki-fork/gnurl78-v13.02-elf_1-2_i386.deb &&
sudo dpkg -i gnurl78*.deb
## Install SDCC from a purpose-built bundle ## Install SDCC from a purpose-built bundle
- "[ ${BUILD_ARCH:-0} = 8051 ] && curl -s \ - if [ ${BUILD_ARCH:-0} = 8051 ] ; then
https://raw.githubusercontent.com/wiki/g-oikonomou/contiki-sensinode/files/sdcc.tar.gz \ curl -s
| tar xzf - -C /tmp/ && sudo cp -f -r /tmp/sdcc/* /usr/local/ && rm -rf /tmp/sdcc && sdcc --version || true" https://raw.githubusercontent.com/wiki/g-oikonomou/contiki-sensinode/files/sdcc.tar.gz
- "[ ${BUILD_ARCH:-0} = 8051 ] && sudo apt-get -qq install srecord || true" | tar xzf - -C /tmp/ &&
sudo cp -f -r /tmp/sdcc/* /usr/local/ &&
rm -rf /tmp/sdcc &&
sdcc --version &&
sudo apt-get -qq install srecord ;
fi
## Clone and build cc65 when testing 6502 ports ## Clone and build cc65 when testing 6502 ports
- "[ ${BUILD_ARCH:-0} = 6502 ] && git clone \ - if [ ${BUILD_ARCH:-0} = 6502 ] ; then
https://github.com/cc65/cc65 /tmp/cc65 && \ git clone https://github.com/cc65/cc65 /tmp/cc65 &&
make -C /tmp/cc65 bin apple2enh atarixl c64 c128 && sudo make -C /tmp/cc65 avail && \ make -C /tmp/cc65 bin apple2enh atarixl c64 c128 &&
export CC65_HOME=/tmp/cc65/ && cc65 --version || true" sudo make -C /tmp/cc65 avail &&
export CC65_HOME=/tmp/cc65/ &&
cc65 --version ;
fi
## Compile cooja.jar only when it's going to be needed ## Compile cooja.jar only when it's going to be needed
- "[ ${BUILD_CATEGORY:-sim} = sim ] && java -version && ant -q -f tools/cooja/build.xml jar && sudo java -Xshare:dump -version || true" - if [ ${BUILD_CATEGORY:-sim} = sim ] ; then
java -version &&
## IMPORTANT: The commands here have to end with `|| true`, ant -q -f tools/cooja/build.xml jar &&
## because it would make the test fail if BUILD_TYPE test fails sudo java -Xshare:dump -version ;
fi
script: script:
## regression-tests/Makefile handles most of generic logic ## regression-tests/Makefile handles most of generic logic