Support relative includes in tests

Since we inline the test file, rather than include it, relative includes from this inlined code would not work.
This commit is contained in:
Allan Odgaard
2013-02-23 09:19:18 +01:00
parent a05b1dca2e
commit 2f3cd66a2b

View File

@@ -13,7 +13,7 @@ ARGV.each do |file|
p.each_line do |line|
if line =~ /^\s*#(include|import)\b/
includes << "#line #{lineno} \"#{p.realpath}\"\n"
includes << line
includes << line.sub(/"(.*?)"/) { '"' + File.expand_path($1, p.parent) + '"' }
else
body << "#line #{lineno} \"#{p.realpath}\"\n"
body << line