Run test executable; build with unit tests
This commit is contained in:
parent
3c874ae4c1
commit
ca7d4862f9
@ -1,20 +1,25 @@
|
|||||||
require "fileutils"
|
require "fileutils"
|
||||||
|
|
||||||
def write_grammar(grammar)
|
|
||||||
File.write("spec/run/testparser.i", grammar)
|
|
||||||
end
|
|
||||||
|
|
||||||
def build_parser
|
|
||||||
result = system(*%w[./imbecile.sh spec/run/testparser.i spec/run/testparser.d])
|
|
||||||
expect(result).to be_truthy
|
|
||||||
end
|
|
||||||
|
|
||||||
def compile(test_file)
|
|
||||||
result = system(*%w[gdc -o spec/run/testparser spec/run/testparser.d], test_file)
|
|
||||||
expect(result).to be_truthy
|
|
||||||
end
|
|
||||||
|
|
||||||
describe Imbecile do
|
describe Imbecile do
|
||||||
|
def write_grammar(grammar)
|
||||||
|
File.write("spec/run/testparser.i", grammar)
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_parser
|
||||||
|
result = system(*%w[./imbecile.sh spec/run/testparser.i spec/run/testparser.d])
|
||||||
|
expect(result).to be_truthy
|
||||||
|
end
|
||||||
|
|
||||||
|
def compile(test_file)
|
||||||
|
result = system(*%w[gdc -funittest -o spec/run/testparser spec/run/testparser.d], test_file)
|
||||||
|
expect(result).to be_truthy
|
||||||
|
end
|
||||||
|
|
||||||
|
def run
|
||||||
|
result = system("spec/run/testparser")
|
||||||
|
expect(result).to be_truthy
|
||||||
|
end
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
FileUtils.rm_rf("spec/run")
|
FileUtils.rm_rf("spec/run")
|
||||||
FileUtils.mkdir_p("spec/run")
|
FileUtils.mkdir_p("spec/run")
|
||||||
@ -31,5 +36,6 @@ rule Start [] <<
|
|||||||
EOF
|
EOF
|
||||||
build_parser
|
build_parser
|
||||||
compile("spec/test_d_lexer.d")
|
compile("spec/test_d_lexer.d")
|
||||||
|
run
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,3 +2,8 @@ int main()
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unittest
|
||||||
|
{
|
||||||
|
assert(true);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user