Skip to content
  • Jed Brown's avatar
    Promote examples/{tests,tutorials}/ to {tests,tutorials}/ · c4762a1b
    Jed Brown authored
    This shortens paths and improves consistency between test target names
    and paths to the source and output files.  Most of the work was
    completed by this script, followed by mild cleanup of nonconforming
    cases.
    
    for makefile in `git ls-files 'src/*makefile'`; do
        if rg -q 'DIRS.*\bexamples\b' $makefile; then
            base=$(dirname $makefile)
            dirs=$(cd $base/examples && ls -d tests tutorials 2>/dev/null | xargs echo)
            perl -pi -e "s#^(DIRS.*)\bexamples\b#\1${dirs}#" $makefile
            git rm $base/examples/makefile
            for t in $dirs; do
                git mv $base/examples/$t $base/
                perl -pi -e "s#^(LOCDIR[[:space:]]*=).*#\1 $base/$t/#" $base/$t
            done
        fi
    done
    
    git grep -l -E -z 'examples/(tutorials|tests)' | xargs -0 perl -pi -e 's#examples/(tutorials|tests)#\1#g'
    git checkout @ \
        src/docs/website/documentation/changes/ \
        src/benchmarks/results/
    c4762a1b
Loading