set -x cd "$(mktemp -d)" cat > "a.cs" < "b.cs" < "c.cs" < "test1.cs" < "test2.cs" < /dev/null "$out/bin/monogame-patcher" replace-call -i subdir/test1.exe \ "System.String a::replaceMe(System.String)" \ "System.String b::replacement(System.String)" \ test1 test "$(mono subdir/test1.exe)" = "bar called: xxx" "$out/bin/monogame-patcher" replace-call -i subdir/test1.exe -a subdir/c.dll \ "System.String b::replacement(System.String)" \ "System.String c::anotherReplacement(System.String)" \ test1::Main test "$(mono subdir/test1.exe)" = "foobar called: xxx" echo foo > write_test.txt test "$(mono subdir/test2.exe)" = "can write" "$out/bin/monogame-patcher" fix-filestreams -i subdir/b.dll b test "$(mono subdir/test2.exe)" = "can not write" set +e "$out/bin/monogame-patcher" --help &> /dev/null ret=$? set -e if [ $ret -eq 0 ]; then echo "Running with --help should give exit status != 0 but was $ret" >&2 exit 1 fi "$out/bin/monogame-patcher" --help 2>&1 | grep -q fix-filestreams