Our great sponsors
-
fswatch
A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
In attempt to speed up my edit/test/submit AoC development cycle, I just wrote a script which runs my program for the day on both example and actual input, then watches for any changes to the source code or input files and reruns the program. My plan is to generate my program template and then run watch in a dedicated terminal before the problem opens for the day. Whenever I make a change I can visually inspect my example output to see if it matches expectations, without switching back and forth from my editor. (Possible future enhancement: save the expected output and make the results visually distinct if it matches.)
This setup uses the fswatch utility. If you want to adapt it for your own use, this is the key bit: fswatch -0 -o $YOUR_FILES | while read -d "" event ; do runscript done where runscript is a shell function to run the program (compile it too if necessary) and $YOUR_FILES are shell globs that match the files you want to watch.
Another neat little tool I like to use for this is watchexec