nlohmann / mutate_cpp

C++ Mutation Test Environment
MIT License
171 stars 22 forks source link

How to save mutation code? #26

Open zhangshoufeng97 opened 2 years ago

zhangshoufeng97 commented 2 years ago

I need every mutation code,how to get it (source code).

nlohmann commented 2 years ago

This is currently not possible, but PRs welcome!

AlexisWilke commented 1 year ago

@zhangshoufeng97 Note that you could do that by copying your source at the time you are asked to build. So say your normal build command is make, you can write a script, something like this:

#!/bin/bash

cp -r . ../mutation-123/.
make

Then use that script instead of just make.

As for the number (123 above), it's up to you to come up with an algorithm to generate it. You could simply use a file:

COUNT=`cat count.txt`
COUNT=`expr $COUNT + 1`
echo $COUNT >count.txt

cp -r . ../mutation-${COUNT}/.

Anything that works for you.