Brainfuck compiler for linux x86_64 written in nasm x86_64
nasm
x86-64
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

runtests.sh 628B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. bfc="./bfc"
  3. beef="beef"
  4. make || exit 1
  5. for bftest in tests/*.bf
  6. do
  7. for input in tests/*.in
  8. do
  9. beefres=$(tempfile)
  10. bfcelf=$(tempfile)
  11. bfcelfres=$(tempfile)
  12. $beef -i $input $bftest > $beefres
  13. $bfc -o $bfcelf $bftest 2>/dev/null
  14. chmod +x $bfcelf
  15. $bfcelf < $input > $bfcelfres
  16. diff=$(diff $bfcelfres $beefres)
  17. if [ -n "$diff" ]
  18. then
  19. echo "========"
  20. echo "Error : $bftest on $input differs between bfc and beef"
  21. diff $bfcelfres $beefres
  22. hexdump -C $bfcres
  23. hexdump -C $beefres
  24. echo "========"
  25. fi
  26. echo "$bftest $input [OK]"
  27. rm $beefres $bfcres $bfcelf $bfcelfres
  28. done
  29. done