- Build V8
- Setup D8 binary for use
V8_REPO_LOCATION=~/v8 # example location alias d8="$V8_REPO_LOCATION/v8/out/x64.release/d8" export D8_PATH="$V8_REPO_LOCATION/v8/out/x64.release"
d8 src/run.js -- <program.b>
Included programs:
d8 src/run.js -- tests/hello-world.b
d8 src/run.js -- tests/mandelbrot.b
Single test:
PROGRAM=tests/hello-world
d8 src/run.js -- "${PROGRAM}.b" > output.txt && diff output.txt "${PROGRAM}.txt" && echo "\033[0;32mPass\033[0m" || echo "\033[0;31mFail\033[0m"
All tests:
find tests/*.b | grep -oP "(?<=/)[\-\w]+(?=.b)" | xargs -n 1 sh -c '<d8-executable-location> src/run.js -- tests/$0.b > output.txt && diff output.txt tests/$0.txt && echo Passed $0 test! || echo Failed $0 test!'