summaryrefslogtreecommitdiff
path: root/Build/Configure.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Build/Configure.hs')
-rw-r--r--Build/Configure.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs
index 262ac2080..8884d57db 100644
--- a/Build/Configure.hs
+++ b/Build/Configure.hs
@@ -7,7 +7,7 @@ import Data.List
import System.Process
import Control.Applicative
import System.FilePath
-import System.Environment
+import System.Environment (getArgs)
import Data.Maybe
import Control.Monad.IfElse
import Data.Char
@@ -17,11 +17,13 @@ import Build.Version
import Utility.SafeCommand
import Utility.Monad
import Utility.ExternalSHA
+import Utility.Env
import qualified Git.Version
tests :: [TestCase]
tests =
[ TestCase "version" getVersion
+ , TestCase "UPGRADE_LOCATION" getUpgradeLocation
, TestCase "git" $ requireCmd "git" "git --version >/dev/null"
, TestCase "git version" getGitVersion
, testCp "cp_a" "-a"
@@ -90,6 +92,11 @@ testCp k option = TestCase cmd $ testCmd k cmdline
cmd = "cp " ++ option
cmdline = cmd ++ " " ++ testFile ++ " " ++ testFile ++ ".new"
+getUpgradeLocation :: Test
+getUpgradeLocation = do
+ e <- getEnv "UPGRADE_LOCATION"
+ return $ Config "upgradelocation" $ MaybeStringConfig e
+
getGitVersion :: Test
getGitVersion = Config "gitversion" . StringConfig . show
<$> Git.Version.installed