diff --git a/exe/vaporware b/exe/vaporware index e2d639b..821c288 100755 --- a/exe/vaporware +++ b/exe/vaporware @@ -5,11 +5,12 @@ require "optparse" opt = OptionParser.new options = {} opt.on("-c", "--compiler[=VAL]", "this option is selecting compiler precompiled file, default: \"self\"") { |v| options[:compiler] = v } +opt.on("-a", "--assembler[=VAL]", "this option is selecting assembler assembler file, default: \"as\"") { |v| options[:assembler] = v } opt.on("-D", "--debug") { |v| options[:debug] = v } opt.on("-o", "--objects[=VAL]") { |v| options[:dest] = v } opt.on("--compiler-options[=VAL]", "compiler options") { |v| options[:compiler_options] = v.split(",") } opt.on("-s", "--shared-library") { |v| options[:shared] = v } -opt.on("-l", "--linker[=VAL]", "selecting linker: gold, lld, and mold.") { |v| options[:linker] = v } +opt.on("-l", "--linker[=VAL]", "selecting linker: gold, lld, and mold, default: \"gold\".") { |v| options[:linker] = v } begin opt.parse!(ARGV) diff --git a/test/vaporware/test_compiler.rb b/test/vaporware/test_compiler.rb index 0a936dc..890b50d 100644 --- a/test/vaporware/test_compiler.rb +++ b/test/vaporware/test_compiler.rb @@ -5,11 +5,11 @@ class Vaporware::CompilerTest < Test::Unit::TestCase def setup = @generated = ["tmp.s", "tmp.o"] def teardown File.delete("tmp") if File.exist?("tmp") - @generated.map { File.delete(_1) } + @generated.map { File.delete(_1) if File.exist?(_1) } end def test_sample_plus @file = "sample/plus.rb" - @vaporware = Vaporware::Compiler.compile(@file) + @vaporware = Vaporware::Compiler.compile(@file, assembler: "self") IO.popen("./tmp").close exit_code, handle_code = check_process($?.to_i) assert_equal(9, exit_code)