Skip to content

Commit

Permalink
fix e2e refs with test
Browse files Browse the repository at this point in the history
  • Loading branch information
rigidus committed Nov 4, 2024
1 parent 6f811a7 commit 135ffca
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions e2e/src/svm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ macro_rules! test_interpreter_and_jit_asm {
};
}


fn example_asm(source: &str) -> Vec<u8> {
#[test]
fn test_asm(source: &str) -> Vec<u8> {
let loader = Arc::new(BuiltinProgram::new_loader(
Config {
enable_symbol_and_section_labels: true,
Expand All @@ -317,8 +317,8 @@ fn example_asm(source: &str) -> Vec<u8> {
bytecode.to_vec()
}


fn example_disasm_from_bytes(program: &[u8]) {
#[test]
fn test_disasm_from_bytes(program: &[u8]) {
let loader = Arc::new(BuiltinProgram::new_mock());
let executable = Executable::<TestContextObject>::from_text_bytes(
program,
Expand All @@ -331,7 +331,8 @@ fn example_disasm_from_bytes(program: &[u8]) {
analysis.disassemble(&mut stdout.lock()).unwrap();
}

fn execute_generated_program(prog: &[u8], mem: &mut [u8]) -> Option<Vec<u8>> {
#[test]
fn test_execute_generated_program(prog: &[u8], mem: &mut [u8]) -> Option<Vec<u8>> {
let max_instruction_count = 1024;
let executable =
Executable::<TestContextObject>::from_text_bytes(
Expand Down Expand Up @@ -422,6 +423,7 @@ fn execute_generated_program(prog: &[u8], mem: &mut [u8]) -> Option<Vec<u8>> {
Some(mem.to_vec())
}

#[test]
fn test_example_mov() {
test_interpreter_and_jit_asm!(
"
Expand All @@ -435,6 +437,7 @@ fn test_example_mov() {
);
}

#[test]
fn test_example_add32() {
test_interpreter_and_jit_asm!(
"
Expand All @@ -450,6 +453,7 @@ fn test_example_add32() {
);
}

#[test]
fn test_struct_func_pointer() {
// This tests checks that a struct field adjacent to another field
// which is a relocatable function pointer is not overwritten when
Expand Down Expand Up @@ -578,6 +582,7 @@ fn test_struct_func_pointer() {
}
}

#[test]
fn test_example_syscal() {
test_interpreter_and_jit_asm!(
"
Expand All @@ -599,7 +604,7 @@ fn test_example_syscal() {
);
}


#[test]
pub fn test_memory() {
let bytecode = example_asm("
entrypoint:
Expand Down

0 comments on commit 135ffca

Please sign in to comment.