shithub: rgbds

Download patch

ref: fe9e4f0583ef968e2a0fcb0c7f47a8275835849f
parent: 362aea22bdf6b8bb08ef032f96c030f3ddb6d597
parent: 9bc6083e49a165ae93fae7293fb72688224c6f70
author: Antonio Niño Díaz <[email protected]>
date: Mon Apr 10 18:59:10 EDT 2017

Merge pull request #169 from AntonioND/an/travis-test

Add Travis CI configuration file

Signed-off-by: Antonio Niño Díaz <[email protected]>

--- /dev/null
+++ b/.travis-deps.sh
@@ -1,0 +1,13 @@
+#!/bin/sh
+
+if [ $TRAVIS_OS_NAME = "osx" ]; then
+    brew update
+    brew install libpng pkg-config
+else # linux
+    sudo apt-get -qq update
+    sudo apt-get install -y -q bison flex libpng-dev pkg-config
+fi
+
+echo "Dependencies:"
+yacc --version
+flex --version
--- /dev/null
+++ b/.travis.yml
@@ -1,0 +1,16 @@
+language: c
+sudo: required
+install:
+  - ./.travis-deps.sh
+os:
+  - linux
+  - osx
+compiler:
+  - clang
+  - gcc
+script:
+  - make
+  - sudo make install
+after_success:
+  - pushd test/asm/ && ./test.sh && popd
+  - pushd test/link/ && ./test.sh && popd
--- a/test/asm/test.sh
+++ b/test/asm/test.sh
@@ -1,8 +1,10 @@
 fname=$(mktemp)
+rc=0
 
 for i in *.asm; do
 	../../rgbasm $i >$fname 2>&1
 	diff -u $fname ${i%.asm}.out
+	rc=$(($? || $rc))
 done
 
-exit 0
+exit $rc
--- a/test/link/test.sh
+++ b/test/link/test.sh
@@ -2,6 +2,7 @@
 gbtemp=$(mktemp)
 gbtemp2=$(mktemp)
 outtemp=$(mktemp)
+rc=0
 
 RGBASM=../../rgbasm
 RGBLINK=../../rgblink
@@ -9,32 +10,42 @@
 $RGBASM -o $otemp bank-numbers.asm
 $RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
 diff bank-numbers.out $outtemp
+rc=$(($? || $rc))
 head -c 20 $gbtemp > $otemp 2>&1
 diff bank-numbers.out.bin $otemp
+rc=$(($? || $rc))
 
 $RGBASM -o $otemp wramx-dmg-mode.asm
 $RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
 diff wramx-dmg-mode-no-d.out $outtemp
+rc=$(($? || $rc))
 $RGBLINK -d -o $gbtemp $otemp > $outtemp 2>&1
 diff wramx-dmg-mode-d.out $outtemp
+rc=$(($? || $rc))
 
 $RGBASM -o $otemp vram-fixed-dmg-mode.asm
 $RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
 diff vram-fixed-dmg-mode-no-d.out $outtemp
+rc=$(($? || $rc))
 $RGBLINK -d -o $gbtemp $otemp > $outtemp 2>&1
 diff vram-fixed-dmg-mode-d.out $outtemp
+rc=$(($? || $rc))
 
 $RGBASM -o $otemp vram-floating-dmg-mode.asm
 $RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
 diff vram-floating-dmg-mode-no-d.out $outtemp
+rc=$(($? || $rc))
 $RGBLINK -d -o $gbtemp $otemp > $outtemp 2>&1
 diff vram-floating-dmg-mode-d.out $outtemp
+rc=$(($? || $rc))
 
 $RGBASM -o $otemp romx-tiny.asm
 $RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
 diff romx-tiny-no-t.out $outtemp
+rc=$(($? || $rc))
 $RGBLINK -t -o $gbtemp $otemp > $outtemp 2>&1
 diff romx-tiny-t.out $outtemp
+rc=$(($? || $rc))
 
 $RGBASM -o $otemp high-low-a.asm
 $RGBLINK -o $gbtemp $otemp
@@ -41,5 +52,6 @@
 $RGBASM -o $otemp high-low-b.asm
 $RGBLINK -o $gbtemp2 $otemp
 diff $gbtemp $gbtemp2
+rc=$(($? || $rc))
 
-exit 0
+exit $rc