Skip to content

Commit

Permalink
add using assembler option and commented default linker
Browse files Browse the repository at this point in the history
  • Loading branch information
katsyoshi committed Sep 12, 2024
1 parent 50427a2 commit b397ffd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion exe/vaporware
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/vaporware/test_compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b397ffd

Please sign in to comment.