Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
Cabal
Commits
046168d0
Commit
046168d0
authored
20 years ago
by
Isaac Potoczny-Jones
Browse files
Options
Downloads
Patches
Plain Diff
added tests for reg scripts; some cleanup
parent
051034b5
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Distribution/Simple.hs
+5
-1
5 additions, 1 deletion
Distribution/Simple.hs
Distribution/Simple/Register.hs
+4
-2
4 additions, 2 deletions
Distribution/Simple/Register.hs
TODO
+2
-0
2 additions, 0 deletions
TODO
tests/ModuleTest.hs
+12
-3
12 additions, 3 deletions
tests/ModuleTest.hs
with
23 additions
and
6 deletions
Distribution/Simple.hs
+
5
−
1
View file @
046168d0
...
@@ -73,7 +73,9 @@ import Distribution.Setup
...
@@ -73,7 +73,9 @@ import Distribution.Setup
import
Distribution.Simple.Build
(
build
)
import
Distribution.Simple.Build
(
build
)
import
Distribution.Simple.SrcDist
(
sdist
)
import
Distribution.Simple.SrcDist
(
sdist
)
import
Distribution.Simple.Register
(
register
,
unregister
,
import
Distribution.Simple.Register
(
register
,
unregister
,
writeInstalledConfig
,
installedPkgConfigFile
)
writeInstalledConfig
,
installedPkgConfigFile
,
regScriptLocation
,
unregScriptLocation
)
import
Distribution.Simple.Configure
(
LocalBuildInfo
(
..
),
getPersistBuildConfig
,
findProgram
,
import
Distribution.Simple.Configure
(
LocalBuildInfo
(
..
),
getPersistBuildConfig
,
findProgram
,
configure
,
writePersistBuildConfig
,
localBuildInfoFile
)
configure
,
writePersistBuildConfig
,
localBuildInfoFile
)
...
@@ -278,6 +280,8 @@ defaultMainWorker pkg_descr_in action args hooks
...
@@ -278,6 +280,8 @@ defaultMainWorker pkg_descr_in action args hooks
try
$
removeDirectoryRecursive
buildPref
try
$
removeDirectoryRecursive
buildPref
try
$
removeFile
installedPkgConfigFile
try
$
removeFile
installedPkgConfigFile
try
$
removeFile
localBuildInfoFile
try
$
removeFile
localBuildInfoFile
try
$
removeFile
regScriptLocation
try
$
removeFile
unregScriptLocation
removePreprocessedPackage
pkg_descr
currentDir
(
ppSuffixes
pps
)
removePreprocessedPackage
pkg_descr
currentDir
(
ppSuffixes
pps
)
postHook
postClean
args
verbose
localbuildinfo
postHook
postClean
args
verbose
localbuildinfo
...
...
This diff is collapsed.
Click to expand it.
Distribution/Simple/Register.hs
+
4
−
2
View file @
046168d0
...
@@ -47,6 +47,8 @@ module Distribution.Simple.Register (
...
@@ -47,6 +47,8 @@ module Distribution.Simple.Register (
writeInstalledConfig
,
writeInstalledConfig
,
removeInstalledConfig
,
removeInstalledConfig
,
installedPkgConfigFile
,
installedPkgConfigFile
,
regScriptLocation
,
unregScriptLocation
,
#
ifdef
DEBUG
#
ifdef
DEBUG
hunitTests
hunitTests
#
endif
#
endif
...
@@ -255,7 +257,7 @@ unregister pkg_descr lbi (user_unreg, verbose) = do
...
@@ -255,7 +257,7 @@ unregister pkg_descr lbi (user_unreg, verbose) = do
die
(
"only unregistering with GHC and Hugs is implemented"
)
die
(
"only unregistering with GHC and Hugs is implemented"
)
-- |Like rawSystemExit, but optionally emits to a script instead of
-- |Like rawSystemExit, but optionally emits to a script instead of
-- exiting.
-- exiting.
FIX: chmod +x?
rawSystemEmit
::
FilePath
-- ^Script name
rawSystemEmit
::
FilePath
-- ^Script name
->
Bool
-- ^if true, emit, if false, run
->
Bool
-- ^if true, emit, if false, run
->
Int
-- ^Verbosity
->
Int
-- ^Verbosity
...
@@ -270,7 +272,7 @@ rawSystemEmit scriptName True verbosity path args
...
@@ -270,7 +272,7 @@ rawSystemEmit scriptName True verbosity path args
++
"
\n
"
)
++
"
\n
"
)
>>
putStrLn
(
path
++
concatMap
(
' '
:
)
args
)
>>
putStrLn
(
path
++
concatMap
(
' '
:
)
args
)
-- |Like rawSystemEmit, except it has string for pipeFrom
-- |Like rawSystemEmit, except it has string for pipeFrom
. FIX: chmod +x
rawSystemPipe
::
FilePath
-- ^Script location
rawSystemPipe
::
FilePath
-- ^Script location
->
Int
-- ^Verbosity
->
Int
-- ^Verbosity
->
String
-- ^where to pipe from
->
String
-- ^where to pipe from
...
...
This diff is collapsed.
Click to expand it.
TODO
+
2
−
0
View file @
046168d0
...
@@ -30,6 +30,8 @@
...
@@ -30,6 +30,8 @@
command?
command?
** Add a flag to configure to specify where to put them?
** Add a flag to configure to specify where to put them?
* do we have to run configure before clean?
* Preprocessors
* Preprocessors
** chain of preprocessors
** chain of preprocessors
** what other preprocessors can't unlit?
** what other preprocessors can't unlit?
...
...
This diff is collapsed.
Click to expand it.
tests/ModuleTest.hs
+
12
−
3
View file @
046168d0
...
@@ -173,6 +173,14 @@ tests currDir comp compConf = [
...
@@ -173,6 +173,14 @@ tests currDir comp compConf = [
assertBool
"sdist did not put the expected file in place"
assertBool
"sdist did not put the expected file in place"
doesFileExist
"dist/src"
>>=
doesFileExist
"dist/src"
>>=
assertEqual
"dist/src exists"
False
assertEqual
"dist/src exists"
False
assertCmd'
compCmd
"register --user"
"pkg A, register failed"
assertCmd'
compCmd
"unregister --user"
"pkg A, unregister failed"
assertCmd'
compCmd
(
"register --user "
++
dumpScriptFlag
)
"pkg A, register dump script failed"
assertCmd'
compCmd
(
"unregister --user "
++
dumpScriptFlag
)
"pkg A, register dump script failed"
assertCmd'
"source"
"register.sh"
"reg script failed"
-- FIX: chmod +x instead of source
assertCmd'
"source"
"unregister.sh"
"unreg script failed"
-- FIX: chmod +x instead of source
,
TestLabel
(
"package A copy-prefix: "
++
compIdent
)
$
TestCase
$
-- (uses above config)
,
TestLabel
(
"package A copy-prefix: "
++
compIdent
)
$
TestCase
$
-- (uses above config)
do
let
targetDir
=
",tmp2"
do
let
targetDir
=
",tmp2"
assertCmd'
compCmd
(
"copy --copy-prefix="
++
targetDir
)
"copy --copy-prefix failed"
assertCmd'
compCmd
(
"copy --copy-prefix="
++
targetDir
)
"copy --copy-prefix failed"
...
@@ -186,7 +194,7 @@ tests currDir comp compConf = [
...
@@ -186,7 +194,7 @@ tests currDir comp compConf = [
removeDirectoryRecursive
",tmp"
removeDirectoryRecursive
",tmp"
assertCmd'
compCmd
"install --user"
"install --user failed"
assertCmd'
compCmd
"install --user"
"install --user failed"
libForA
",tmp"
libForA
",tmp"
assertCmd
"./setup
unregister --user"
"unregister failed"
assertCmd
'
compCmd
"
unregister --user"
"unregister failed"
-- HUnit
-- HUnit
,
TestLabel
"testing the HUnit package"
$
TestCase
$
,
TestLabel
"testing the HUnit package"
$
TestCase
$
do
setCurrentDirectory
$
(
testdir
`
joinFileName
`
"HUnit-1.0"
)
do
setCurrentDirectory
$
(
testdir
`
joinFileName
`
"HUnit-1.0"
)
...
@@ -263,7 +271,7 @@ tests currDir comp compConf = [
...
@@ -263,7 +271,7 @@ tests currDir comp compConf = [
,
TestLabel
(
"testing the wash2hs package"
++
compIdent
)
$
TestCase
$
,
TestLabel
(
"testing the wash2hs package"
++
compIdent
)
$
TestCase
$
do
setCurrentDirectory
$
(
testdir
`
joinFileName
`
"wash2hs"
)
do
setCurrentDirectory
$
(
testdir
`
joinFileName
`
"wash2hs"
)
testPrelude
testPrelude
assertCmdFail
"./setup
configure --someUnknownFlag"
assertCmdFail
(
compCmd
++
"
configure --someUnknownFlag"
)
"wash2hs configure with unknown flag"
"wash2hs configure with unknown flag"
assertConfigure
",tmp"
assertConfigure
",tmp"
assertHaddock
assertHaddock
...
@@ -303,7 +311,7 @@ tests currDir comp compConf = [
...
@@ -303,7 +311,7 @@ tests currDir comp compConf = [
do
setCurrentDirectory
$
(
testdir
`
joinFileName
`
"HSQL"
)
do
setCurrentDirectory
$
(
testdir
`
joinFileName
`
"HSQL"
)
system
"make distclean"
system
"make distclean"
system
"rm -rf /tmp/lib/HSQL"
system
"rm -rf /tmp/lib/HSQL"
when
(
comp
==
GHC
)
when
(
comp
==
GHC
)
(
system
"ghc -cpp --make -i../.. Setup.lhs -o setup 2>out.build"
>>
return
()
)
(
system
"ghc -cpp --make -i../.. Setup.lhs -o setup 2>out.build"
>>
return
()
)
assertConfigure
"/tmp"
assertConfigure
"/tmp"
doesFileExist
"config.mk"
>>=
doesFileExist
"config.mk"
>>=
...
@@ -338,6 +346,7 @@ tests currDir comp compConf = [
...
@@ -338,6 +346,7 @@ tests currDir comp compConf = [
GHC
->
do
checkTargetDir
ghcTargetDir
[
".hi"
]
GHC
->
do
checkTargetDir
ghcTargetDir
[
".hi"
]
doesFileExist
(
ghcTargetDir
`
joinFileName
`
"libHStest-1.0.a"
)
doesFileExist
(
ghcTargetDir
`
joinFileName
`
"libHStest-1.0.a"
)
>>=
assertBool
"library doesn't exist"
>>=
assertBool
"library doesn't exist"
dumpScriptFlag
=
"-v11"
main
::
IO
()
main
::
IO
()
main
=
do
putStrLn
"compile successful"
main
=
do
putStrLn
"compile successful"
putStrLn
"-= Setup Tests =-"
putStrLn
"-= Setup Tests =-"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment