1
0

run.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. set -eo pipefail
  3. # Determine platform
  4. PLATFORM="unknown"
  5. unamestr=$(uname)
  6. if [[ "$unamestr" == "Linux" ]]; then
  7. PLATFORM="linux"
  8. elif [[ "$unamestr" == "MINGW"* || "$unamestr" == "CYGWIN"* || "$unamestr" == "MSYS"* ]]; then
  9. PLATFORM="windows"
  10. fi
  11. echo "$PLATFORM"
  12. EXE_EXT=""
  13. if [[ "$PLATFORM" == "windows" ]]; then
  14. EXE_EXT=".exe"
  15. fi
  16. echo "clang case"
  17. clang++ --version
  18. rm -f ab-clang$EXE_EXT
  19. clang++ -static -O2 -o ab-clang$EXE_EXT ab.cpp
  20. cp -f input.txt i
  21. ./invoke.sh ./ab-clang
  22. rm -f ab-clang$EXE_EXT
  23. echo "gcc case"
  24. g++ --version
  25. rm -f ab-gcc$EXE_EXT
  26. #eval g++ --std=c++11 -Wpedantic -Werror -static -O2 -o ab-gcc$EXE_EXT ab.cpp
  27. eval g++ -static -O2 -o ab-gcc$EXE_EXT ab.cpp
  28. cp -f input.txt i
  29. ./invoke.sh ./ab-gcc
  30. rm -f ab-gcc$EXE_EXT
  31. echo "case-nval clang case"
  32. clang++ --version
  33. rm -f case-nval-clang$EXE_EXT
  34. clang++ -static -O2 -o case-nval-clang$EXE_EXT case-nval.cpp
  35. cp -f input.01 i
  36. ./invoke.sh ./case-nval-clang --testMarkupFileName a
  37. cat a
  38. echo -
  39. rm -f case-nval-clang$EXE_EXT
  40. echo "case-nval gcc case"
  41. g++ --version
  42. rm -f case-nval-gcc$EXE_EXT
  43. #eval g++ --std=c++11 -Wpedantic -Werror -static -O2 -o case-nval-gcc$EXE_EXT case-nval.cpp
  44. eval g++ --std=c++11 -static -O2 -o case-nval-gcc$EXE_EXT case-nval.cpp
  45. cp -f input.01 i
  46. ./invoke.sh ./case-nval-gcc --testMarkupFileName a
  47. cat a
  48. echo -
  49. rm -f case-nval-gcc$EXE_EXT
  50. echo "end"