Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
6a28cc16
Commit
6a28cc16
authored
Jul 21, 2007
by
Ian Lynagh
Browse files
Share the pwd program between tests
parent
5882c76b
Changes
6
Hide whitespace changes
Inline
Side-by-side
testsuite/Makefile
View file @
6a28cc16
TOP
=
.
include
$(TOP)/mk/boilerplate.mk
SUBDIRS
=
timeout
SUBDIRS
=
timeout
utils
CLEAN_FILES
+=
mk/wordsize.mk
...
...
testsuite/mk/test.mk
View file @
6a28cc16
...
...
@@ -141,7 +141,13 @@ $(TOP)/timeout/timeout$(exeext) :
@
echo
"Looks like you don't have timeout, building it first..."
cd
$(TOP)
/timeout
&&
$(MAKE)
$(MFLAGS)
all
test
:
timeout
pwd
:
$(TOP)/utils/pwd$(exeext)
$(TOP)/utils/pwd$(exeext)
:
@
echo
"Looks like you don't have pwd, building utils first..."
cd
$(TOP)
/utils
&&
$(MAKE)
$(MFLAGS)
all
test
:
timeout pwd
$(PYTHON)
$(RUNTESTS)
$(RUNTEST_OPTS)
\
$(
patsubst
%,
--only
=
%,
$(TEST)
)
\
$(
patsubst
%,
--only
=
%,
$(TESTS)
)
\
...
...
testsuite/tests/ghc-regress/rename/prog006/Makefile
View file @
6a28cc16
...
...
@@ -16,9 +16,8 @@ include $(TOP)/mk/test.mk
# using the supplied Cabal configuration.
rn.prog006
:
$(TEST_HC)
-v0
pwd.hs
-o
pwd
$(TEST_HC)
--make
-package-name
test-1.0 B.C
-no-recomp
-v0
sed
"s@__IMPORT__@
`
./pwd
`
@"
<pkg.conf.in
>
pkg.conf
sed
"s@__IMPORT__@
`
$(TOP)
/utils/pwd quadruple-backslash
`
@"
<pkg.conf.in
>
pkg.conf
$(TEST_HC)
-c
-package-conf
pkg.conf
-package
test
-no-recomp
A.hs
-i
# The -i clears the search path, so A.hs will find B.C from package test
#
...
...
testsuite/tests/ghc-regress/rename/prog006/pwd.hs
deleted
100644 → 0
View file @
5882c76b
module
Main
where
import
System.Directory
main
::
IO
()
main
=
do
d
<-
getCurrentDirectory
putStr
$
concatMap
escape
d
-- We have to escape \ twice, once to get through sed and again to get
-- through parsing pkg.conf
escape
::
Char
->
String
escape
'
\\
'
=
"
\\\\\\\\
"
escape
c
=
[
c
]
testsuite/utils/Makefile
0 → 100644
View file @
6a28cc16
TOP
=
..
include
$(TOP)/mk/boilerplate.mk
HC
=
$(GHC_INPLACE)
all
::
$(HC)
--make
pwd
clean
::
rm
-f
*
.o
rm
-f
*
.hi
rm
-f
pwd
include
$(TOP)/mk/target.mk
testsuite/utils/pwd.hs
0 → 100644
View file @
6a28cc16
module
Main
where
import
System.Directory
import
System.Environment
main
::
IO
()
main
=
do
args
<-
getArgs
let
escape
=
case
args
of
[
"quadruple-backslash"
]
->
escape_quadruple_backslash
[
"forwardslash"
]
->
escape_forwardslash
_
->
error
(
"pwd: Bad args: "
++
show
args
)
d
<-
getCurrentDirectory
putStr
$
concatMap
escape
d
-- In prog006 we have to escape \ twice, once to get through sed and
-- again to get through parsing pkg.conf
escape_quadruple_backslash
::
Char
->
String
escape_quadruple_backslash
'
\\
'
=
"
\\\\\\\\
"
escape_quadruple_backslash
c
=
[
c
]
-- Normally we can get away with just replacing backslashes with forwardslashes
escape_forwardslash
::
Char
->
String
escape_forwardslash
'
\\
'
=
"/"
escape_forwardslash
c
=
[
c
]
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment