Skip to content

Instantly share code, notes, and snippets.

@jakzal
Created June 18, 2012 23:02
Show Gist options
  • Select an option

  • Save jakzal/2951321 to your computer and use it in GitHub Desktop.

Select an option

Save jakzal/2951321 to your computer and use it in GitHub Desktop.

Revisions

  1. jakzal created this gist Jun 18, 2012.
    24 changes: 24 additions & 0 deletions behat-ci.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    #!/bin/sh

    # ./bin/behat-ci.sh

    project_dir=$(dirname $(readlink -f $0))"/.."
    logs_path=${1:-"./build/logs/behat"}
    reports_path=${2:-"./build/behat"}

    cd $project_dir

    logs_path=${logs_path##$(pwd)/}
    reports_path=${reports_path##$(pwd)/}

    for feature_path in `find src/ -path '*/Features'`; do
    bundle=$(echo $feature_path | sed -e 's/^[^\/]\+\/\([^\/]\+\)\/Bundle\/\([^\/]\+\)\/.*/\1\2/');
    reports_dir=$reports_path"/$bundle.html"

    echo "Running suite for $bundle";

    ./bin/behat --format=progress,junit,html --out=,$logs_path,$reports_dir "@$bundle";
    echo "<a href=\"$bundle.html\">$bundle</a><br />" >> $reports_path"/index.html"
    done

    cd -