6

What is the best way to test an install script on macOS?

I have written an installation script so that others can easily install the program qme-ng which I forked and am working on.

However testing the script is very hard. I can manually uninstall all the dependencies, Boost and gmp, each time and see whether my script can properly reinstall them but it is very costly. Furthermore I'm worried about the possibility of dependency removal that isn't complete which can complicate the issue.

Graham Miln
  • 43,776
Ying Zhou
  • 185

1 Answers1

9

Your best bet is to create a macOS VM for testing. Install VirtualBox (it's free), create a macOS virtual machine, and then create a snapshot before testing your script. Once you've finished testing your script you can restore the VM to its previous, unmodified state using the snapshot feature. Hope this helps!

  • I can confirm that this method works beautifully with VirtualBox. I am creating an installation script to automate the creation of a desktop environment for FreeBSD 11 and the snapshot feature works great for resetting back to an initial state. – Allan Jun 25 '18 at 12:34