Automate git bisect for MSBuild/NUnit/.NET/Windows batch commands in msysgit?

断了今生、忘了曾经 提交于 2019-11-30 15:55:47

To solve the path problem, I simply used an absolute path in the script. To solve the Windows-style forward-slash commandline-option problem, I escaped the forward-slash with another forward slash (I got that tip from another Stack Overflow answer, I'll link to it when I find it again).

So now the working script looks like this:

#!/bin/sh
# http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_02.html
# http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html

# Build solution.
echo "Building..."

c:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe \
    //consoleloggerparameters:ErrorsOnly \
    //maxcpucount \
    //nologo \
    //property:Configuration=Debug \
    //verbosity:quiet \
    Epic-Project-of-Supreme-Awesome.sln

# Check exit status.
# (status != 0) ?
status=$?
if [ $status -ne 0 ]
    then
        echo "Build failure, status $status."
        exit $status
fi

echo "Build success."

# Run unit tests
nunit-console.exe \
    //noresult \
    //stoponerror \
    bin/Debug/ArtificialIntelligence.Tests.dll \
    bin/Debug/TravelingSalesManSolver.Tests.dll

status=$?
if [ $status -ne 0 ]
    then
        echo "Test failure, status $status."
        exit $status
fi

echo "Tests passed."

and once again, you run it like this:

$ git bisect start <bad commit> <good commit>
$ git bisect run auto-build-run-tests.sh
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!