Switch unit tests from gdc to ldc2
This commit is contained in:
parent
11348ca351
commit
9895733a05
@ -56,7 +56,7 @@ class <%= @classname %>
|
||||
|
||||
alias CodePoint = uint;
|
||||
|
||||
static immutable string token_names[] = [
|
||||
static immutable string[] token_names = [
|
||||
<% @grammar.tokens.each_with_index do |token, index| %>
|
||||
"<%= token.name %>",
|
||||
<% end %>
|
||||
@ -237,13 +237,13 @@ class <%= @classname %>
|
||||
}
|
||||
|
||||
<% transition_table, state_table, mode_table = @lexer.build_tables %>
|
||||
private static immutable Transition transitions[] = [
|
||||
private static immutable Transition[] transitions = [
|
||||
<% transition_table.each do |transition_table_entry| %>
|
||||
Transition(<%= transition_table_entry[:first] %>u, <%= transition_table_entry[:last] %>u, <%= transition_table_entry[:destination] %>u),
|
||||
<% end %>
|
||||
];
|
||||
|
||||
private static immutable State states[] = [
|
||||
private static immutable State[] states = [
|
||||
<% state_table.each do |state_table_entry| %>
|
||||
State(<%= state_table_entry[:transition_table_index] %>u,
|
||||
<%= state_table_entry[:n_transitions] %>u,
|
||||
@ -261,7 +261,7 @@ class <%= @classname %>
|
||||
<% end %>
|
||||
];
|
||||
|
||||
private static immutable Mode modes[] = [
|
||||
private static immutable Mode[] modes = [
|
||||
<% mode_table.each do |mode_table_entry| %>
|
||||
Mode(<%= mode_table_entry[:state_table_offset] %>),
|
||||
<% end %>
|
||||
@ -642,19 +642,19 @@ class <%= @classname %>
|
||||
}
|
||||
|
||||
<% state_table, shift_table, reduce_table = @parser.build_tables %>
|
||||
private static immutable Shift shifts[] = [
|
||||
private static immutable Shift[] shifts = [
|
||||
<% shift_table.each do |shift| %>
|
||||
Shift(<%= shift[:token_id] %>u, <%= shift[:state_id] %>u),
|
||||
<% end %>
|
||||
];
|
||||
|
||||
private static immutable Reduce reduces[] = [
|
||||
private static immutable Reduce[] reduces = [
|
||||
<% reduce_table.each do |reduce| %>
|
||||
Reduce(<%= reduce[:token_id] %>u, <%= reduce[:rule_id] %>u, <%= reduce[:rule_set_id] %>u, <%= reduce[:n_states] %>u),
|
||||
<% end %>
|
||||
];
|
||||
|
||||
private static immutable State states[] = [
|
||||
private static immutable State[] states = [
|
||||
<% state_table.each do |state| %>
|
||||
State(<%= state[:shift_index] %>u, <%= state[:n_shifts] %>u, <%= state[:reduce_index] %>u, <%= state[:n_reduces] %>u),
|
||||
<% end %>
|
||||
|
@ -20,7 +20,7 @@ describe Propane do
|
||||
end
|
||||
|
||||
def compile(*test_files)
|
||||
result = system(*%w[gdc -funittest -o spec/run/testparser spec/run/testparser.d -Ispec], *test_files)
|
||||
result = system(*%w[ldc2 --unittest -of spec/run/testparser spec/run/testparser.d -Ispec], *test_files)
|
||||
expect(result).to be_truthy
|
||||
end
|
||||
|
||||
@ -28,6 +28,7 @@ describe Propane do
|
||||
stdout, stderr, status = Open3.capture3("spec/run/testparser")
|
||||
File.binwrite("spec/run/.stderr", stderr)
|
||||
File.binwrite("spec/run/.stdout", stdout)
|
||||
stderr.sub!(/^.*modules passed unittests\n/, "")
|
||||
Results.new(stdout, stderr, status)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user