Skip to content

Commit bb6a2f8

Browse files
committed
test(idl): test:idl task takes config from enviornment
This lets us test idl for any config from the command line: ./do test:idl qc_iu
1 parent f716423 commit bb6a2f8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Rakefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,15 @@ namespace :test do
238238
puts "All files validate against their schema"
239239
end
240240

241-
task idl: ["#{$root}/.stamps/resolve-rv32.stamp", "#{$root}/.stamps/resolve-rv64.stamp"] do
242-
print "Parsing IDL code for RV32..."
243-
cfg_arch32 = cfg_arch_for("rv32")
244-
puts "done"
245-
246-
cfg_arch32.type_check
241+
task :idl do
242+
cfg = ENV["CFG"]
243+
raise "Missing CFG enviornment variable" if cfg.nil?
247244

248-
print "Parsing IDL code for RV64..."
249-
cfg_arch64 = cfg_arch_for("rv64")
245+
print "Parsing IDL code for #{cfg}..."
246+
cfg_arch = cfg_arch_for(cfg)
250247
puts "done"
251248

252-
cfg_arch64.type_check
249+
cfg_arch.type_check
253250

254251
puts "All IDL passed type checking"
255252
end
@@ -410,6 +407,11 @@ namespace :test do
410407
Rake::Task["test:idl_compiler"].invoke
411408
Rake::Task["test:lib"].invoke
412409
Rake::Task["test:schema"].invoke
410+
ENV["CFG"] = "rv32"
411+
Rake::Task["test:idl"].invoke
412+
ENV["CFG"] = "rv64"
413+
Rake::Task["test:idl"].invoke
414+
ENV["CFG"] = "qc_iu"
413415
Rake::Task["test:idl"].invoke
414416
Rake::Task["test:inst_encodings"].invoke
415417
end

0 commit comments

Comments
 (0)