Commit 6cff7bc3 authored by Simon Marlow's avatar Simon Marlow

add support for tests consisting of a C source file

parent 34de065b
......@@ -146,6 +146,9 @@ class TestOptions:
# Does this test use a literate (.lhs) file?
self.literate = 0
# Does this test use a .c file?
self.c_src = 0
# The default set of options
global default_testopts
default_testopts = TestOptions()
......
......@@ -187,6 +187,9 @@ def alone(opts):
def literate( opts ):
opts.literate = 1;
def c_src( opts ):
opts.c_src = 1;
# ----
# Function for composing two opt-fns together
......@@ -1017,7 +1020,9 @@ def add_suffix( name, suffix ):
return name + '.' + suffix
def add_hs_lhs_suffix(name):
if getTestOpts().literate:
if getTestOpts().c_src:
return add_suffix(name, 'c')
elif getTestOpts().literate:
return add_suffix(name, 'lhs')
else:
return add_suffix(name, 'hs')
......
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