summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-08-17 06:35:00 -0400
committerJesse Luehrs <doy@tozt.net>2014-08-17 06:35:00 -0400
commitdb3ca13185dac5802e56c18f6d181f886ff28abc (patch)
tree1634b933e52c404779e5f6e5da050986e2690e21
parenta44b648ec516a0bbdcf9939186233ef8e811b1d3 (diff)
downloadcrawl-ref-travis.tar.gz
crawl-ref-travis.zip
travis configurationtravis
-rw-r--r--.travis.yml19
-rw-r--r--.travis/build.pl31
-rw-r--r--.travis/deps.pl14
-rw-r--r--crawl-ref/source/Makefile2
-rw-r--r--crawl-ref/source/util/fake_pty.c9
5 files changed, 74 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..04142b3583
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,19 @@
+language: cpp
+compiler:
+ - clang
+ - gcc
+env:
+ - NOTHING=1
+ - FULLDEBUG=1
+ - USE_DGAMELAUNCH=1
+ - USE_DGAMELAUNCH=1 FULLDEBUG=1
+ - TILES=1
+ - TILES=1 FULLDEBUG=1
+ - WEBTILES=1
+ - WEBTILES=1 FULLDEBUG=1
+ - USE_DGAMELAUNCH WEBTILES=1
+ - USE_DGAMELAUNCH WEBTILES=1 FULLDEBUG=1
+git:
+ submodules: false
+install: perl .travis/deps.pl
+script: perl .travis/build.pl
diff --git a/.travis/build.pl b/.travis/build.pl
new file mode 100644
index 0000000000..35ebcab377
--- /dev/null
+++ b/.travis/build.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+chdir "crawl-ref/source"
+ or die "couldn't chdir: $!";
+
+open my $fh, '>', "util/release_ver"
+ or die "couldn't open util/release_ver: $!";
+$fh->print("v0.0-a0");
+$fh->close;
+
+$ENV{TRAVIS} = 1;
+
+# can't set these in .travis.yml because env vars are set before compiler
+# selection
+$ENV{FORCE_CC} = $ENV{CC};
+$ENV{FORCE_CXX} = $ENV{CXX};
+
+try("make -j2");
+
+if ($ENV{FULLDEBUG} && !$ENV{TILES}) {
+ try("make test");
+}
+
+sub try {
+ my ($cmd) = @_;
+ print "$cmd\n";
+ my $exit = system $cmd;
+ exit $exit if $exit;
+}
diff --git a/.travis/deps.pl b/.travis/deps.pl
new file mode 100644
index 0000000000..ffa759524e
--- /dev/null
+++ b/.travis/deps.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+my @deps = qw(
+ liblua5.1-0-dev
+);
+
+push @deps, qw(
+ libsdl1.2-dev
+ libsdl-image1.2-dev
+) if $ENV{TILES} || $ENV{WEBTILES};
+
+exec "sudo apt-get install @deps";
diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile
index db39bd95cc..57201aaa47 100644
--- a/crawl-ref/source/Makefile
+++ b/crawl-ref/source/Makefile
@@ -1712,7 +1712,7 @@ test-%: $(GAME) util/fake_pty builddb
@echo "Finished: $*"
util/fake_pty: util/fake_pty.c
- $(QUIET_HOSTCC)$(if $(HOSTCC),$(HOSTCC),$(CC)) -Wall $< -o $@ -lutil
+ $(QUIET_HOSTCC)$(if $(HOSTCC),$(HOSTCC),$(CC)) $(if $(TRAVIS),-DTRAVIS,) -Wall $< -o $@ -lutil
# Should be not needed, but the race condition in bug #6509 is hard to fix.
builddb: $(GAME)
diff --git a/crawl-ref/source/util/fake_pty.c b/crawl-ref/source/util/fake_pty.c
index 5db9d78cd7..69ed62b450 100644
--- a/crawl-ref/source/util/fake_pty.c
+++ b/crawl-ref/source/util/fake_pty.c
@@ -30,7 +30,16 @@ static void slurp_output()
while (poll(&pfd, 1, 60000) > 0) // 60 seconds with no output -> die die die!
{
if (read(tty, buf, sizeof(buf)) <= 0)
+#ifdef TRAVIS
+ {
+ puts(".");
+#endif
break;
+#ifdef TRAVIS
+ }
+ else
+ puts("x");
+#endif
}
kill(crawl, SIGTERM); // shooting a zombie is ok, let's make sure it's dead