Skip to content

Commit

Permalink
Merge branch 'master' into tilk/extend-transactron-introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk authored Oct 27, 2023
2 parents 2c3f465 + fc8c9b9 commit b52e4e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_asm_source(self):
self.base_dir = "test/asm/"
self.bin_src = []

with tempfile.NamedTemporaryFile() as asm_tmp:
with tempfile.NamedTemporaryFile() as asm_tmp, tempfile.NamedTemporaryFile() as bin_tmp:
subprocess.check_call(
[
"riscv64-unknown-elf-as",
Expand All @@ -276,9 +276,10 @@ def test_asm_source(self):
self.base_dir + self.source_file,
]
)
code = subprocess.check_output(
["riscv64-unknown-elf-objcopy", "-O", "binary", "-j", ".text", asm_tmp.name, "/dev/stdout"]
subprocess.check_call(
["riscv64-unknown-elf-objcopy", "-O", "binary", "-j", ".text", asm_tmp.name, bin_tmp.name]
)
code = bin_tmp.read()
for word_idx in range(0, len(code), 4):
word = code[word_idx : word_idx + 4]
bin_instr = int.from_bytes(word, "little")
Expand Down

0 comments on commit b52e4e0

Please sign in to comment.