Skip to content
Snippets Groups Projects
Commit d6e68b28 authored by Zubin's avatar Zubin
Browse files

testsuite: Teach testsuite driver about c++ sources

parent d471d445
No related branches found
No related tags found
No related merge requests found
......@@ -399,8 +399,9 @@ class TestOptions:
# Does this test use a literate (.lhs) file?
self.literate = False
# Does this test use a .c, .m or .mm file?
# Does this test use a .c, .cpp, .m or .mm file?
self.c_src = False
self.cpp_src = False
self.objc_src = False
self.objcpp_src = False
......
......@@ -299,6 +299,13 @@ def req_c( name, opts ):
# JS backend doesn't support C (yet)
js_skip(name, opts)
def req_cpp( name, opts ):
"""
Mark a test as requiring C source file support
"""
# JS backend doesn't support C (yet)
js_skip(name, opts)
def req_cmm( name, opts ):
"""
Mark a test as requiring Cmm support
......@@ -953,6 +960,10 @@ def c_src( name, opts ):
opts.c_src = True
req_c (name, opts)
def cpp_src( name, opts ):
opts.cpp_src = True
req_c (name, opts)
def objc_src( name, opts ):
opts.objc_src = True
......@@ -1948,6 +1959,7 @@ async def simple_build(name: Union[TestName, str],
# Required by GHC 7.3+, harmless for earlier versions:
if (getTestOpts().c_src or
getTestOpts().cpp_src or
getTestOpts().objc_src or
getTestOpts().objcpp_src):
extra_hc_opts += ' -no-hs-main '
......@@ -2922,6 +2934,8 @@ def add_hs_lhs_suffix(name: str) -> Path:
return add_suffix(name, 'c')
elif getTestOpts().cmm_src:
return add_suffix(name, 'cmm')
elif getTestOpts().cpp_src:
return add_suffix(name, 'cpp')
elif getTestOpts().objc_src:
return add_suffix(name, 'm')
elif getTestOpts().objcpp_src:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment