test_memo.rs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. mod utils;
  2. use utils::{
  3. TestEnv, init_project, run_build, update_assembly_file, verify_project_structure,
  4. verify_so_files,
  5. };
  6. #[test]
  7. fn test_memo_project_e2e() {
  8. let env = TestEnv::new("memo");
  9. // Step 1: Initialize the memo project
  10. init_project(&env, "memo");
  11. // Step 2: Verify project structure
  12. verify_project_structure(&env, "memo");
  13. // Step 3: Run build
  14. run_build(&env);
  15. // Step 4: Verify .so files were created
  16. verify_so_files(&env);
  17. // Step 5: Run tests
  18. // run_tests(&env);
  19. // Step 6: Clean up
  20. env.cleanup();
  21. println!("🎉 All tests passed! Memo project E2E test completed successfully.");
  22. }
  23. #[test]
  24. fn test_memo_project_e2e_second() {
  25. let env = TestEnv::new("memo2");
  26. // Step 1: Initialize the memo2 project
  27. init_project(&env, "memo2");
  28. // Step 2: Verify project structure
  29. verify_project_structure(&env, "memo2");
  30. // Step 3: Update the memo2.s content to the specified content
  31. let new_memo_content = r#".equ NUM_ACCOUNTS, 0x00
  32. .equ DATA_LEN, 0x08
  33. .equ DATA, 0x10
  34. .globl entrypoint
  35. entrypoint:
  36. ldxdw r0, [r1+NUM_ACCOUNTS]
  37. ldxdw r2, [r1+DATA_LEN]
  38. add64 r1, DATA
  39. call sol_log_
  40. exit"#;
  41. update_assembly_file(&env, "memo2", new_memo_content);
  42. // Step 4: Run build
  43. run_build(&env);
  44. // Step 5: Verify .so files were created
  45. verify_so_files(&env);
  46. // Step 6: Run tests
  47. // run_tests(&env);
  48. // Step 7: Clean up
  49. env.cleanup();
  50. println!("🎉 Second test passed! Memo2 project E2E test completed successfully.");
  51. }