Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
6215d4c8
Commit
6215d4c8
authored
Mar 14, 2013
by
ian@well-typed.com
Browse files
Fix tests for dynamic ghc
parent
f3da8ce8
Changes
26
Hide whitespace changes
Inline
Side-by-side
testsuite/config/ghc
View file @
6215d4c8
...
...
@@ -70,6 +70,8 @@ else:
if (ghc_with_dynamic_rts == 1):
config.run_ways.append('dyn')
config.ghc_dynamic = ghc_dynamic
if (ghc_with_profiling == 1 and ghc_with_threaded_rts == 1):
config.run_ways.append('profthreaded')
...
...
@@ -200,3 +202,15 @@ def get_compiler_info():
except:
config.package_conf_cache_file = ''
if compilerInfoDict["GHC Dynamic"] == "YES":
config.ghc_th_way_flags = "-dynamic"
config.ghci_way_flags = "-dynamic"
config.ghc_th_way = "dyn"
config.ghc_plugin_way = "dyn"
elif compilerInfoDict["GHC Dynamic"] == "NO":
config.ghc_th_way_flags = "-static"
config.ghci_way_flags = "-static"
config.ghc_plugin_way = "normal"
else:
raise 'Bad value for "GHC Dynamic"'
testsuite/driver/testlib.py
View file @
6215d4c8
...
...
@@ -308,7 +308,7 @@ def doing_ghci():
return
'ghci'
in
config
.
run_ways
def
ghci_dynamic
(
):
return
config
.
ghc_dynamic
_by_default
return
config
.
ghc_dynamic
def
fast
():
return
config
.
fast
...
...
testsuite/mk/boilerplate.mk
View file @
6215d4c8
...
...
@@ -164,6 +164,16 @@ ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
include
$(ghc-config-mk)
endif
ifeq
"$(GhcDynamic)" "YES"
ghcThWayFlags
=
-dynamic
ghciWayFlags
=
-dynamic
ghcPluginWayFlags
=
-dynamic
else
ghcThWayFlags
=
-static
ghciWayFlags
=
-static
ghcPluginWayFlags
=
-static
endif
# -----------------------------------------------------------------------------
ifeq
"$(HostOS)" "mingw32"
...
...
testsuite/mk/ghc-config.hs
View file @
6215d4c8
...
...
@@ -24,6 +24,7 @@ main = do
getGhcFieldOrFail
fields
"GhcWithSMP"
"Support SMP"
getGhcFieldOrFail
fields
"GhcRTSWays"
"RTS ways"
getGhcFieldOrDefault
fields
"GhcDynamicByDefault"
"Dynamic by default"
"NO"
getGhcFieldOrDefault
fields
"GhcDynamic"
"GHC Dynamic"
"NO"
getGhcFieldProgWithDefault
fields
"AR"
"ar command"
"ar"
let
pkgdb_flag
=
case
lookup
"Project version"
fields
of
...
...
testsuite/mk/test.mk
View file @
6215d4c8
...
...
@@ -104,6 +104,14 @@ RUNTEST_OPTS += -e ghc_dynamic_by_default=False
CABAL_MINIMAL_BUILD
=
--enable-library-vanilla
--disable-shared
endif
ifeq
"$(GhcDynamic)" "YES"
RUNTEST_OPTS
+=
-e
ghc_dynamic
=
True
CABAL_PLUGIN_BUILD
=
--enable-shared
--disable-library-vanilla
else
RUNTEST_OPTS
+=
-e
ghc_dynamic
=
False
CABAL_PLUGIN_BUILD
=
--enable-library-vanilla
--disable-shared
endif
ifeq
"$(GhcWithSMP)" "YES"
RUNTEST_OPTS
+=
-e
ghc_with_smp
=
1
else
...
...
testsuite/tests/driver/Makefile
View file @
6215d4c8
...
...
@@ -486,9 +486,9 @@ T3364:
.PHONY
:
T706
T706
:
cp
T706a.hs T706.hs
"
$(TEST_HC)
"
$(TEST_HC_OPTS_NO_RECOMP)
-c
T706.hs
"
$(TEST_HC)
"
$(TEST_HC_OPTS_NO_RECOMP)
$(ghciWayFlags)
-c
T706.hs
cp
T706b.hs T706.hs
"
$(TEST_HC)
"
$(TEST_HC_OPTS_NO_RECOMP)
-c
T706.hs
"
$(TEST_HC)
"
$(TEST_HC_OPTS_NO_RECOMP)
$(ghciWayFlags)
-c
T706.hs
echo
"test"
|
"
$(TEST_HC)
"
$(TEST_HC_OPTS_NO_RECOMP)
--interactive
-ignore-dot-ghci
-v0
T706
.PHONY
:
T5584
...
...
testsuite/tests/driver/recomp009/Makefile
View file @
6215d4c8
...
...
@@ -18,9 +18,9 @@ clean:
recomp009
:
clean
cp
Sub1.hs Sub.hs
'
$(TEST_HC)
'
$(TEST_HC_OPTS_NO_RECOMP)
-v0
--make
Main.hs
'
$(TEST_HC)
'
$(TEST_HC_OPTS_NO_RECOMP)
$(ghcThWayFlags)
-v0
--make
Main.hs
./Main
sleep
1
cp
Sub2.hs Sub.hs
-
'
$(TEST_HC)
'
$(TEST_HC_OPTS_NO_RECOMP)
-v0
--make
Main.hs
-
'
$(TEST_HC)
'
$(TEST_HC_OPTS_NO_RECOMP)
$(ghcThWayFlags)
-v0
--make
Main.hs
./Main
testsuite/tests/ffi/should_run/Makefile
View file @
6215d4c8
...
...
@@ -6,10 +6,10 @@ ffi018_ghci_setup :
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
ffi018_ghci_c.c
T1288_ghci_setup
:
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T1288_ghci_c.c
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
$(ghciWayFlags)
-c
T1288_ghci_c.c
T2276_ghci_setup
:
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T2276_ghci_c.c
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
$(ghciWayFlags)
-c
T2276_ghci_c.c
ffi002_setup
:
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
ffi002.hs
...
...
testsuite/tests/ghc-api/dynCompileExpr/all.T
View file @
6215d4c8
...
...
@@ -2,4 +2,4 @@ test('dynCompileExpr',
[
extra_run_opts
('
"
'
+
config
.
libdir
+
'
"
'),
when
(
opsys
('
mingw32
'),
expect_broken_for
(
5987
,
['
dyn
'])),
omit_ways
(
prof_ways
)
],
# cannot run interpreted code with -prof
compile_and_run
,
['
-package ghc
'
])
compile_and_run
,
['
-package ghc
'
+
config
.
ghci_way_flags
])
testsuite/tests/ghci/prog001/prog001.T
View file @
6215d4c8
test
('
prog001
',
extra_clean
(['
C.hs
',
'
D.hs
',
'
D.hi
',
'
D.o
']),
[
extra_clean
(['
C.hs
',
'
D.hs
',
'
D.hi
',
'
D.o
']),
cmd_prefix
('
ghciWayFlags=
'
+
config
.
ghci_way_flags
)],
ghci_script
,
['
prog001.script
'])
testsuite/tests/ghci/prog001/prog001.script
View file @
6215d4c8
...
...
@@ -26,13 +26,13 @@ main
main
-- compile D & reload
:shell "$HC" $HC_OPTS -fforce-recomp -c D.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-fforce-recomp -c D.hs
:reload
main
-- change D, recompile & reload
:shell cp D2.hs D.hs
:shell "$HC" $HC_OPTS -fforce-recomp -c D.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-fforce-recomp -c D.hs
:reload
:load A.hs
...
...
testsuite/tests/ghci/prog002/prog002.T
View file @
6215d4c8
test
('
prog002
',
extra_clean
(['
A.hs
',
'
A.hi
',
'
A.o
']),
test
('
prog002
',
[
extra_clean
(['
A.hs
',
'
A.hi
',
'
A.o
']),
cmd_prefix
('
ghciWayFlags=
'
+
config
.
ghci_way_flags
)],
ghci_script
,
['
prog002.script
'])
testsuite/tests/ghci/prog002/prog002.script
View file @
6215d4c8
...
...
@@ -11,7 +11,7 @@
:load D.hs
-- compile A & reload
:shell "$HC" $HC_OPTS -fforce-recomp -c A.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-fforce-recomp -c A.hs
:reload
B.g 42
...
...
@@ -21,7 +21,7 @@ B.g 42
-- swap A2 for A, compile & reload
:shell sleep 1
:shell cp A2.hs A.hs
:shell "$HC" $HC_OPTS -fforce-recomp -c A.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-fforce-recomp -c A.hs
:reload
-- the system should ignore the compiled version and compile its own.
...
...
testsuite/tests/ghci/prog003/prog003.T
View file @
6215d4c8
test
('
prog003
',
extra_clean
(['
D.hs
',
'
D.hi
',
'
C.hi
',
'
C.o
',
'
B.hi
',
'
B.o
',
'
A
',
'
A.hi
',
'
A.o
',
'
a.out
']),
[
extra_clean
(['
D.hs
',
'
D.hi
',
'
C.hi
',
'
C.o
',
'
B.hi
',
'
B.o
',
'
A
',
'
A.hi
',
'
A.o
',
'
a.out
']),
cmd_prefix
('
ghciWayFlags=
'
+
config
.
ghci_way_flags
)],
ghci_script
,
['
prog003.script
'])
testsuite/tests/ghci/prog003/prog003.script
View file @
6215d4c8
...
...
@@ -28,7 +28,7 @@ a 42
putStrLn "Run 3"
-- compile D, check that :reload doesn't pick it up
:shell "$HC" $HC_OPTS -c D.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-c D.hs
:reload
:type (A.a,B.b,C.c,D.d)
a 42
...
...
@@ -41,21 +41,21 @@ a 42
putStrLn "Run 5"
-- D,C compiled
:shell "$HC" $HC_OPTS -c C.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-c C.hs
:load A
:type (A.a,B.b,C.c,D.d)
a 42
putStrLn "Run 6"
-- D,C,B compiled
:shell "$HC" $HC_OPTS -c B.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-c B.hs
:load A
:type (A.a,B.b,C.c,D.d)
a 42
putStrLn "Run 7"
-- D,C,B,A compiled
:shell "$HC" $HC_OPTS -c A.hs
:shell "$HC" $HC_OPTS
$ghciWayFlags
-c A.hs
:load A
:type (A.a,B.b,C.c,D.d)
a 42
...
...
@@ -83,7 +83,7 @@ a 42
putStrLn "Run 11"
-- A,B,C compiled (better not use A.o, B.o, C.o)
:shell "$HC" $HC_OPTS --make -v0 A
:shell "$HC" $HC_OPTS
$ghciWayFlags
--make -v0 A
:shell rm D.o
:load A
:type (A.a,B.b,C.c,D.d)
...
...
testsuite/tests/plugins/Makefile
View file @
6215d4c8
...
...
@@ -5,6 +5,6 @@ include $(TOP)/mk/test.mk
.PHONY
:
plugins01
plugins01
:
"
$(TEST_HC)
"
$(TEST_HC_OPTS)
--make
-v0
plugins01.hs
-package-db
simple-plugin/pkg.plugins01/local.package.conf
-fplugin
Simple.Plugin
-fplugin-opt
Simple.Plugin:Irrelevant_Option
-package
simple-plugin
"
$(TEST_HC)
"
$(TEST_HC_OPTS)
$(ghcPluginWayFlags)
--make
-v0
plugins01.hs
-package-db
simple-plugin/pkg.plugins01/local.package.conf
-fplugin
Simple.Plugin
-fplugin-opt
Simple.Plugin:Irrelevant_Option
-package
simple-plugin
./plugins01
testsuite/tests/plugins/all.T
View file @
6215d4c8
...
...
@@ -29,11 +29,11 @@ test('plugins04',
test
('
plugins05
',
[
extra_clean
(['
HomePackagePlugin.hi
',
'
HomePackagePlugin.o
']),
expect_fail_for
(['
dyn
']
+
prof
_way
s
)
],
only_ways
([
config
.
ghc_plugin
_way
]
)
],
multimod_compile_and_run
,
['
plugins05
',
'
-package ghc
'])
test
('
plugins06
',
[
extra_clean
(['
LinkerTicklingPlugin.hi
',
'
LinkerTicklingPlugin.o
']),
expect_fail_for
(['
dyn
']
+
prof
_way
s
)
],
only_ways
([
config
.
ghc_plugin
_way
]
)
],
multimod_compile_and_run
,
['
plugins06
',
'
-package ghc
'])
testsuite/tests/plugins/simple-plugin/Makefile
View file @
6215d4c8
...
...
@@ -15,6 +15,6 @@ package.%:
echo
"[]"
>
pkg.
$*
/local.package.conf
pkg.
$*
/setup configure
--distdir
pkg.
$*
/dist
-v0
$(CABAL_
MINIMAL
_BUILD)
--prefix
=
"
$(HERE)
/pkg.
$*
/install"
--with-compiler
=
"
$(TEST_HC)
"
--with-hc-pkg
=
"
$(GHC_PKG)
"
--package-db
=
pkg.
$*
/local.package.conf
pkg.
$*
/setup configure
--distdir
pkg.
$*
/dist
-v0
$(CABAL_
PLUGIN
_BUILD)
--prefix
=
"
$(HERE)
/pkg.
$*
/install"
--with-compiler
=
"
$(TEST_HC)
"
--with-hc-pkg
=
"
$(GHC_PKG)
"
--package-db
=
pkg.
$*
/local.package.conf
pkg.
$*
/setup build
--distdir
pkg.
$*
/dist
-v0
pkg.
$*
/setup
install
--distdir
pkg.
$*
/dist
-v0
testsuite/tests/polykinds/Makefile
View file @
6215d4c8
...
...
@@ -24,9 +24,9 @@ T6054:
T7022
:
$(RM)
-f
T7022.hi T7022.o T7022a.hi T7022a.o T7022b.hi T7022b.o
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T7022a.hs
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T7022b.hs
-v0
-
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
-v0
T7022.hs
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
$(ghcThWayFlags)
-c
T7022a.hs
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
$(ghcThWayFlags)
-c
T7022b.hs
-v0
-
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
$(ghcThWayFlags)
-c
-v0
T7022.hs
T7438
:
$(RM)
-f
T7438.hi T7438.o T7438a.hi T7438a.o
...
...
testsuite/tests/quasiquotation/T4491/test.T
View file @
6215d4c8
...
...
@@ -2,9 +2,9 @@ test('T4491',
[
req_interp
,
# We'd need to jump through some hoops to run this test the
#
in the prof or dyn
ways, due to the TH use, so for now we
jus
t
#
omit the other
way
s
o
mit
_ways
([
'
profasm
','
profthreaded
','
dyn
'
]),
#
other
ways, due to the TH use, so for now we
only run i
t
#
the TH
way
o
nly
_ways
([
config
.
ghc_th_way
]),
only_compiler_types
(['
ghc
']),
extra_clean
(['
A.hi
',
'
A.o
'])
],
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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