diff --git a/src/main.cpp b/src/main.cpp index d334e2c..25f0a29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,7 +37,7 @@ bool run_tests() TEST(dirLeft(LEFT) == DOWN); Canvas d; - TEST(d.readFromFile("examples/hello_world.rf")); + TEST(d.readFromFile("tests/hello_world.rf")); std::string line = "> v"; int y = 0; diff --git a/test.sh b/test.sh index 1509c68..04cb8d1 100755 --- a/test.sh +++ b/test.sh @@ -2,9 +2,9 @@ rm -rf /tmp/rufunge mkdir /tmp/rufunge -mkdir /tmp/rufunge/examples +mkdir /tmp/rufunge/tests -for name in examples/*.rf; do +for name in tests/*.rf; do ./bin/a $name > /tmp/rufunge/$name.txt echo Result for $name: @@ -13,7 +13,9 @@ for name in examples/*.rf; do if cmp --silent $name.txt /tmp/rufunge/$name.txt; then echo "Test passed: $name" else - echo "Test failed: $name" + /bin/echo -e "\e[1;31mTest failed: $name\e[0m" exit -1 fi done + +/bin/echo -e "\e[1;32mAll Tests Passed\e[0m" diff --git a/examples/arithmetic.rf b/tests/arithmetic.rf similarity index 100% rename from examples/arithmetic.rf rename to tests/arithmetic.rf diff --git a/examples/arithmetic.rf.txt b/tests/arithmetic.rf.txt similarity index 100% rename from examples/arithmetic.rf.txt rename to tests/arithmetic.rf.txt diff --git a/examples/hello_world.rf b/tests/hello_world.rf similarity index 100% rename from examples/hello_world.rf rename to tests/hello_world.rf diff --git a/examples/hello_world.rf.txt b/tests/hello_world.rf.txt similarity index 100% rename from examples/hello_world.rf.txt rename to tests/hello_world.rf.txt diff --git a/examples/hello_world2.rf b/tests/hello_world2.rf similarity index 100% rename from examples/hello_world2.rf rename to tests/hello_world2.rf diff --git a/examples/hello_world2.rf.txt b/tests/hello_world2.rf.txt similarity index 100% rename from examples/hello_world2.rf.txt rename to tests/hello_world2.rf.txt