Normally, we will use cargo test to run test code in host machine. But i need to run the test bin in target machine which does't have any execute permission(Belike SELinux).
But i can request the JIT permission in debug mode. So can we run the test bin with JIT memory?
Rust testing does not involve any library loading (except any done by the tests themselves) or JIT compilation. What is the target machine architecture and OS? What is “JIT memory” in this case?
If your goal is to have cargo test run a binary on another machine or emulator, then you should use the target.<arch>.runner Cargo configuration option. This will run a command of your choice, passing it the path of the test executable, which can perform whatever kind of remote execution you want.
Thanks for your reply! I think cargo test will generate a executable bin file and run it, right?
And i want run this bin in harmony os device which don't have executable permission. We can request some memory spaces in debug mode which have executable permission via mmap.
So i mean can i use this memory to execute the test bin file? I'm not sure whether i explain it clearly..
Essentially you would be implementing your own executable loader. All of the details of doing so are specific to the OS it is supposed to work on. You would need to look for information specific to HarmonyOS. (And there is probably a better way to do it.)