1
0

runtest.sh 783 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash -e
  2. SOURCES="$@"
  3. cat > build/script.g <<EOF
  4. fun run_script 0 {
  5. \$files
  6. @files 4 vector_init = ;
  7. EOF
  8. M2_CMD="./M2-Planet-gcc"
  9. rm script-data/* || true
  10. for source in $SOURCES ; do
  11. cp "$source" script-data/
  12. echo " files \"/init/$(basename $source)\" strdup vector_push_back ;" >> build/script.g
  13. M2_CMD="$M2_CMD -f $source"
  14. done
  15. cat >> build/script.g <<EOF
  16. files "/ram/compiled.m1" m2_compile ;
  17. files free_vect_of_ptrs ;
  18. "/ram/compiled.m1" dump_debug ;
  19. }
  20. EOF
  21. M2_CMD="$M2_CMD -o m2_output.m1"
  22. echo $M2_CMD
  23. make
  24. qemu-system-i386 -hda build/boot_asmg.x86 -serial stdio -device isa-debug-exit | ./test/dedump.py
  25. $M2_CMD
  26. if colordiff -u dump/ram/compiled.m1 m2_output.m1 ; then
  27. echo "TEST SUCCESSFUL!"
  28. else
  29. echo "TEST FAILED..."
  30. fi
  31. exit 0