skip to content

Search

1 min read

Simplified version of my PHP test runner

A PHP continuous test runner rewritten to depend only on inotifywait, replacing the earlier Ruby and Watchr version.

In my course of getting continuous testing in practice I have improved my test runner by using less dependencies.

#!/bin/bash
if ! which inotifywait > /dev/null; then
    echo "You must install the inotify-tools package to use this script";
 
    exit 1;
fi
 
while true; do
    inotifywait -r -e modify src/ tests/ --excludei "(tpl|js|css|jpg|png|yml|yaml)$" &&
    clear &&
    ant phpunit;
done

Check it out on GitHub

Previously I have implemented this by using Ruby and its Watchr gem, but now this script only relies on inotifywait binary available in major distributions.

As usual this script helps you to track your code for changes and if changed it will automatically run a bunch of actions.

All posts