Commit f1fb386d authored by Ian Lynagh's avatar Ian Lynagh

Fix the ffi002 test

parent e40bba06
......@@ -211,6 +211,9 @@ class TestOptions:
# Prefix to put on the command before running it
self.cmd_prefix = ''
# Prefix to put on the command before compiling it
self.compile_cmd_prefix = ''
# Extra output normalisation
self.extra_normaliser = lambda x: x
......
......@@ -377,6 +377,14 @@ def _cmd_prefix( opts, prefix ):
# ----
def compile_cmd_prefix( prefix ):
return lambda opts, p=prefix: _compile_cmd_prefix(opts, prefix)
def _compile_cmd_prefix( opts, prefix ):
opts.compile_cmd_prefix = prefix
# ----
def normalise_slashes( opts ):
opts.extra_normaliser = normalise_slashes_
......@@ -801,7 +809,12 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link ):
if opts.compiler_stats_num_fields != []:
extra_hc_opts += ' +RTS -V0 -t' + stats_file + ' --machine-readable -RTS'
cmd = 'cd ' + getTestOpts().testdir + " && '" \
if getTestOpts().compile_cmd_prefix == '':
cmd_prefix = ''
else:
cmd_prefix = getTestOpts().compile_cmd_prefix + ' '
cmd = 'cd ' + getTestOpts().testdir + " && " + cmd_prefix + "'" \
+ config.compiler + "' " \
+ join(config.compiler_always_flags,' ') + ' ' \
+ to_do + ' ' + srcname + ' ' \
......
......@@ -19,7 +19,7 @@ test('fed001', compose(only_compiler_types(['ghc']),
test('ffi001', omit_ways(['ghci']), compile_and_run, [''])
test('ffi002', [ omit_ways(['ghci']),
extra_clean(['ffi002_c.o']),
cmd_prefix('$MAKE ffi002_setup && ') ],
compile_cmd_prefix('$MAKE ffi002_setup && ') ],
# The ffi002_setup hack is to ensure that we generate
# ffi002_stub.h before compiling ffi002_c.c, which
# needs it.
......
{-# LANGUAGE ForeignFunctionInterface #-}
module Foo where
foreign export ccall foo :: Int -> IO Int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment