improved requires
This commit is contained in:
parent
69c1f8fccc
commit
7d1be1f908
@ -1,4 +1,3 @@
|
|||||||
require 'asm/arm_assembler'
|
|
||||||
require 'asm/instruction'
|
require 'asm/instruction'
|
||||||
require 'asm/nodes'
|
require 'asm/nodes'
|
||||||
require 'stream_reader'
|
require 'stream_reader'
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
require "asm/arm_assembler"
|
||||||
|
require "elf/object_writer"
|
@ -3,7 +3,7 @@ require 'elf/symbol_table_section'
|
|||||||
require 'elf/text_section'
|
require 'elf/text_section'
|
||||||
require 'elf/string_table_section'
|
require 'elf/string_table_section'
|
||||||
|
|
||||||
module Asm
|
module Elf
|
||||||
|
|
||||||
class ObjectWriter
|
class ObjectWriter
|
||||||
def initialize(target)
|
def initialize(target)
|
@ -29,5 +29,3 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|||||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'test'))
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'test'))
|
||||||
|
|
||||||
require 'crystal'
|
require 'crystal'
|
||||||
require 'asm/object_writer'
|
|
||||||
require "asm/arm_assembler"
|
|
||||||
|
@ -40,7 +40,7 @@ class TestSmallProg < MiniTest::Test
|
|||||||
|
|
||||||
#helper to write the file
|
#helper to write the file
|
||||||
def write len ,name
|
def write len ,name
|
||||||
writer = Asm::ObjectWriter.new(Elf::Constants::TARGET_ARM)
|
writer = Elf::ObjectWriter.new(Elf::Constants::TARGET_ARM)
|
||||||
assembly = @generator.assemble_to_string
|
assembly = @generator.assemble_to_string
|
||||||
assert_equal len * 4 , assembly.length
|
assert_equal len * 4 , assembly.length
|
||||||
writer.set_text assembly
|
writer.set_text assembly
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
require_relative 'helper'
|
require_relative 'helper'
|
||||||
require "asm/arm_assembler"
|
|
||||||
|
|
||||||
# try to test that the generation of basic instructions works
|
# try to test that the generation of basic instructions works
|
||||||
# one instruction at a time, reverse testing from objdump --demangle -Sfghxp
|
# one instruction at a time, reverse testing from objdump --demangle -Sfghxp
|
||||||
|
Loading…
Reference in New Issue
Block a user