summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-01-27 12:05:11 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-01-27 12:05:28 +0100
commitac791649bc13085b2f75fc97db3e32d0b4301a0c (patch)
treecb53bee85c9288c97f68b98345abdbf525ee898e
parent2092ca9e3d9482d939d61ebaf10d71578169e0ec (diff)
minimize profiling build
-rw-r--r--lambdacube-compiler.cabal24
-rwxr-xr-xrun-test-suite.sh9
-rwxr-xr-xtravis/profile.sh2
3 files changed, 27 insertions, 8 deletions
diff --git a/lambdacube-compiler.cabal b/lambdacube-compiler.cabal
index 0c3763e4..af2fa967 100644
--- a/lambdacube-compiler.cabal
+++ b/lambdacube-compiler.cabal
@@ -20,6 +20,10 @@ Data-Files:
20 lc/Internals.lc 20 lc/Internals.lc
21 lc/Prelude.lc 21 lc/Prelude.lc
22 22
23Flag onlytestsuite
24 Description: Only compiles the library and testsuit
25 Default: False
26
23Flag profiling 27Flag profiling
24 Description: Enable profiling 28 Description: Enable profiling
25 Default: False 29 Default: False
@@ -80,6 +84,11 @@ library
80 hs-source-dirs: src 84 hs-source-dirs: src
81 default-language: Haskell2010 85 default-language: Haskell2010
82 86
87 if flag(profiling)
88 GHC-Options: -O2 -fprof-auto -rtsopts
89 else
90 GHC-Options: -O2
91
83 92
84executable lambdacube-compiler-unit-tests 93executable lambdacube-compiler-unit-tests
85 hs-source-dirs: test 94 hs-source-dirs: test
@@ -96,6 +105,10 @@ executable lambdacube-compiler-unit-tests
96 tasty >= 0.11 && <0.12, 105 tasty >= 0.11 && <0.12,
97 tasty-quickcheck >=0.8 && <0.9 106 tasty-quickcheck >=0.8 && <0.9
98 107
108 if flag(onlytestsuite)
109 Buildable: False
110 else
111 Buildable: True
99 112
100executable lambdacube-compiler-test-suite 113executable lambdacube-compiler-test-suite
101 hs-source-dirs: test 114 hs-source-dirs: test
@@ -124,6 +137,11 @@ executable lambdacube-compiler-test-suite
124 lambdacube-ir == 0.1.*, 137 lambdacube-ir == 0.1.*,
125 vector >= 0.11 && <0.12 138 vector >= 0.11 && <0.12
126 139
140 if flag(profiling)
141 GHC-Options: -O2 -fprof-auto -rtsopts
142 else
143 GHC-Options: -O2
144
127 145
128executable lc 146executable lc
129 hs-source-dirs: tool 147 hs-source-dirs: tool
@@ -139,6 +157,11 @@ executable lc
139 bytestring == 0.10.*, 157 bytestring == 0.10.*,
140 filepath == 1.4.* 158 filepath == 1.4.*
141 159
160 if flag(onlytestsuite)
161 Buildable: False
162 else
163 Buildable: True
164
142 165
143executable lambdacube-compiler-coverage-test-suite 166executable lambdacube-compiler-coverage-test-suite
144 hs-source-dirs: src, test 167 hs-source-dirs: src, test
@@ -176,4 +199,3 @@ executable lambdacube-compiler-coverage-test-suite
176 time >= 1.5 && <1.6, 199 time >= 1.5 && <1.6,
177 vector >= 0.11 && <0.12 200 vector >= 0.11 && <0.12
178 201
179
diff --git a/run-test-suite.sh b/run-test-suite.sh
index 9764d750..df1eab0f 100755
--- a/run-test-suite.sh
+++ b/run-test-suite.sh
@@ -8,15 +8,12 @@ if [ "$1" == "--profile" ] ; then
8 git clone https://github.com/lambdacube3d/lambdacube-ir /tmp/ir 8 git clone https://github.com/lambdacube3d/lambdacube-ir /tmp/ir
9 cabal sandbox add-source /tmp/ir/lambdacube-ir.haskell 9 cabal sandbox add-source /tmp/ir/lambdacube-ir.haskell
10 cabal install --only-dependencies --enable-library-profiling --enable-executable-profiling --constraint="indentation -trifecta" 10 cabal install --only-dependencies --enable-library-profiling --enable-executable-profiling --constraint="indentation -trifecta"
11 cabal configure --flags "profiling coverage" --enable-library-profiling --enable-executable-profiling 11 cabal configure --flags "profiling onlytestsuite" --enable-library-profiling --enable-executable-profiling
12 cabal build 12 cabal build
13 set +e 13 set +e
14 cabal run lambdacube-compiler-unit-tests 14 RESULT_UNITTESTS=0
15 RESULT_UNITTESTS=`echo $?` 15 cabal run lambdacube-compiler-test-suite -- -r $@ +RTS -p
16 cabal run lambdacube-compiler-coverage-test-suite -- -r $@ +RTS -p
17 RESULT_TESTS=`echo $?` 16 RESULT_TESTS=`echo $?`
18 ./create-test-report.sh
19 rm lambdacube-compiler-coverage-test-suite.tix
20 cabal sandbox delete 17 cabal sandbox delete
21 cabal clean 18 cabal clean
22 rm -rf /tmp/ir 19 rm -rf /tmp/ir
diff --git a/travis/profile.sh b/travis/profile.sh
index b571ee6d..b1b5ca25 100755
--- a/travis/profile.sh
+++ b/travis/profile.sh
@@ -2,4 +2,4 @@
2 2
3cd /root/source/lambdacube-compiler 3cd /root/source/lambdacube-compiler
4./run-test-suite.sh --profile 4./run-test-suite.sh --profile
5cat lambdacube-compiler-coverage-test-suite.prof 5head -n 50 lambdacube-compiler-test-suite.prof