From ac791649bc13085b2f75fc97db3e32d0b4301a0c Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Wed, 27 Jan 2016 12:05:11 +0100 Subject: minimize profiling build --- lambdacube-compiler.cabal | 24 +++++++++++++++++++++++- run-test-suite.sh | 9 +++------ travis/profile.sh | 2 +- 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: lc/Internals.lc lc/Prelude.lc +Flag onlytestsuite + Description: Only compiles the library and testsuit + Default: False + Flag profiling Description: Enable profiling Default: False @@ -80,6 +84,11 @@ library hs-source-dirs: src default-language: Haskell2010 + if flag(profiling) + GHC-Options: -O2 -fprof-auto -rtsopts + else + GHC-Options: -O2 + executable lambdacube-compiler-unit-tests hs-source-dirs: test @@ -96,6 +105,10 @@ executable lambdacube-compiler-unit-tests tasty >= 0.11 && <0.12, tasty-quickcheck >=0.8 && <0.9 + if flag(onlytestsuite) + Buildable: False + else + Buildable: True executable lambdacube-compiler-test-suite hs-source-dirs: test @@ -124,6 +137,11 @@ executable lambdacube-compiler-test-suite lambdacube-ir == 0.1.*, vector >= 0.11 && <0.12 + if flag(profiling) + GHC-Options: -O2 -fprof-auto -rtsopts + else + GHC-Options: -O2 + executable lc hs-source-dirs: tool @@ -139,6 +157,11 @@ executable lc bytestring == 0.10.*, filepath == 1.4.* + if flag(onlytestsuite) + Buildable: False + else + Buildable: True + executable lambdacube-compiler-coverage-test-suite hs-source-dirs: src, test @@ -176,4 +199,3 @@ executable lambdacube-compiler-coverage-test-suite time >= 1.5 && <1.6, vector >= 0.11 && <0.12 - 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 git clone https://github.com/lambdacube3d/lambdacube-ir /tmp/ir cabal sandbox add-source /tmp/ir/lambdacube-ir.haskell cabal install --only-dependencies --enable-library-profiling --enable-executable-profiling --constraint="indentation -trifecta" - cabal configure --flags "profiling coverage" --enable-library-profiling --enable-executable-profiling + cabal configure --flags "profiling onlytestsuite" --enable-library-profiling --enable-executable-profiling cabal build set +e - cabal run lambdacube-compiler-unit-tests - RESULT_UNITTESTS=`echo $?` - cabal run lambdacube-compiler-coverage-test-suite -- -r $@ +RTS -p + RESULT_UNITTESTS=0 + cabal run lambdacube-compiler-test-suite -- -r $@ +RTS -p RESULT_TESTS=`echo $?` - ./create-test-report.sh - rm lambdacube-compiler-coverage-test-suite.tix cabal sandbox delete cabal clean 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 @@ cd /root/source/lambdacube-compiler ./run-test-suite.sh --profile -cat lambdacube-compiler-coverage-test-suite.prof +head -n 50 lambdacube-compiler-test-suite.prof -- cgit v1.2.3