rtest02.sh 774 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #
  3. # 1. create graph A
  4. # 2. convert A to A.txt
  5. # 3. import A.txt to B
  6. # 4. convert B to B.txt
  7. # 5. compare A.txt and B.txt
  8. #
  9. rm -f A A.txt B B.txt
  10. echo "create a large graph and save it to 'A'"
  11. (./cr_large_graph -g A > /dev/null) || (echo "error"; return 1) || exit 1
  12. echo "done"
  13. echo "convert 'A' to 'A.txt'"
  14. (./view -g A > A.txt) || (echo "error"; return 1) || exit 1
  15. echo "done"
  16. echo "import 'A.txt' to 'B'"
  17. (./parse -i A.txt -o B) || (echo "error"; return 1) || exit 1
  18. echo "done"
  19. echo "convert 'B' to 'B.txt'"
  20. (./view -g B > B.txt) || (echo "error"; return 1) || exit 1
  21. echo "done"
  22. echo "compare 'A.txt' with 'B.txt'"
  23. (diff -q A.txt B.txt && \
  24. echo "'A.txt' and 'B.txt' are identical") ||
  25. (echo "'A.txt' and 'B.txt' differ"; exit 1) || exit 1
  26. exit 0