

The test suite probably looks something like this:
int tests_passed=0;
int tests_failed=0;
for(int i=0;i<100000;i++){
printf("test no. %d: ", i);
if(is_prime(i)==actually_is_prime(i)){
printf("passed\n");
tests_passed++;
}else{
printf("failed\n");
tests_failed++;
}
}
//...

If you want to load at runtime you can use https://docs.rs/ron/latest/ron/. The structs are a weird combination of the two ways to define a struct in rust, making the ron notation of structs invalid rust, but having proper enums makes it worth it.