From a4df62f9ab668e75e0146b711f3482406b9041b9 Mon Sep 17 00:00:00 2001
From: Regis Blanc <regwblanc@gmail.com>
Date: Fri, 27 Feb 2015 14:55:03 +0100
Subject: [PATCH] Gives more memory to travis to run tests

---
 .travis.yml                                   | 11 +++++++---
 build.sbt                                     |  2 +-
 .../verification/purescala/valid/Heap.scala   | 20 +++++++++----------
 travis/jvmopts                                |  6 ++++++
 4 files changed, 25 insertions(+), 14 deletions(-)
 create mode 100644 travis/jvmopts

diff --git a/.travis.yml b/.travis.yml
index 3401abbcc..65fac10ea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,5 @@
 language: scala
 
-before_script:
-    - sbt script
-
 scala:
     - 2.11.2
 jdk:
@@ -16,4 +13,12 @@ notifications:
     email:
         - ekneuss@gmail.com
         - philippe.suter@gmail.com
+        - regwblanc@gmail.com
     irc: "chat.freenode.net#epfl-lara"
+
+before_script: 
+    - sbt compile
+    - sbt script
+
+script:
+    - sbt -jvm-opts travis/jvmopts test
diff --git a/build.sbt b/build.sbt
index da45aba9e..66bbea260 100644
--- a/build.sbt
+++ b/build.sbt
@@ -37,7 +37,7 @@ logBuffered in Test := false
 
 testOptions in Test += Tests.Argument("-oDF")
 
-javaOptions in (Test,run) ++= Seq("-Xss32M", "-Xmx3G")
+javaOptions in (Test,run) ++= Seq("-Xss32M", "-Xmx3G", "-XX:MaxPermSize=1024M")
 
 parallelExecution in test := false
 
diff --git a/src/test/resources/regression/verification/purescala/valid/Heap.scala b/src/test/resources/regression/verification/purescala/valid/Heap.scala
index f1464e8bc..260cc8583 100644
--- a/src/test/resources/regression/verification/purescala/valid/Heap.scala
+++ b/src/test/resources/regression/verification/purescala/valid/Heap.scala
@@ -7,25 +7,25 @@ object Heaps {
   /*~~~~~~~~~~~~~~~~~~~~~~~*/
   /* Data type definitions */
   /*~~~~~~~~~~~~~~~~~~~~~~~*/
-  private case class Node(rank : BigInt, elem : BigInt, nodes : Heap)
+  private case class Node(rank : BigInt, elem : Int, nodes : Heap)
   
   sealed abstract class Heap
   private case class  Nodes(head : Node, tail : Heap) extends Heap
   private case object Empty extends Heap
   
   sealed abstract class OptInt
-  case class Some(value : BigInt) extends OptInt
+  case class Some(value : Int) extends OptInt
   case object None extends OptInt
   
   /*~~~~~~~~~~~~~~~~~~~~~~~*/
   /* Abstraction functions */
   /*~~~~~~~~~~~~~~~~~~~~~~~*/
-  def heapContent(h : Heap) : Set[BigInt] = h match {
-    case Empty => Set.empty[BigInt]
+  def heapContent(h : Heap) : Set[Int] = h match {
+    case Empty => Set.empty[Int]
     case Nodes(n, ns) => nodeContent(n) ++ heapContent(ns)
   }
   
-  def nodeContent(n : Node) : Set[BigInt] = n match {
+  def nodeContent(n : Node) : Set[Int] = n match {
     case Node(_, e, h) => Set(e) ++ heapContent(h)
   }
   
@@ -78,13 +78,13 @@ object Heaps {
   /*~~~~~~~~~~~~~~~~*/
   def empty() : Heap = {
     Empty
-  } ensuring(res => heapContent(res) == Set.empty[BigInt])
+  } ensuring(res => heapContent(res) == Set.empty[Int])
   
   def isEmpty(h : Heap) : Boolean = {
     (h == Empty)
-  } ensuring(res => res == (heapContent(h) == Set.empty[BigInt]))
+  } ensuring(res => res == (heapContent(h) == Set.empty[Int]))
   
-  def insert(e : BigInt, h : Heap) : Heap = {
+  def insert(e : Int, h : Heap) : Heap = {
     insertNode(Node(0, e, Empty), h)
   } ensuring(res => heapContent(res) == heapContent(h) ++ Set(e))
   
@@ -139,9 +139,9 @@ object Heaps {
   }.holds
   
   def sanity3() : Boolean = {
-    val h0 = insert(42, insert(0, insert(3, insert(12, Empty))))
+    val h0 = insert(42, insert(0, insert(12, Empty)))
     val h1 = deleteMin(h0)
-    findMin(h1) == Some(3)
+    findMin(h1) == Some(12)
   }.holds
 }
 
diff --git a/travis/jvmopts b/travis/jvmopts
new file mode 100644
index 000000000..2e8e35bb8
--- /dev/null
+++ b/travis/jvmopts
@@ -0,0 +1,6 @@
+-Dfile.encoding=UTF8
+-Xms2G
+-Xmx3G
+-Xss6M
+-XX:MaxPermSize=700M
+-XX:ReservedCodeCacheSize=256M
-- 
GitLab