Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. .PHONY: all clean edit editor test test2 back report report2 parser2 benchmarks benchmarks2 mem memgo race nreport build_all_targets
  2. all:
  3. build_all_targets:
  4. GOOS=darwin GOARCH=amd64 go test -c -o /dev/null
  5. GOOS=darwin GOARCH=arm64 go test -c -o /dev/null
  6. GOOS=freebsd GOARCH=386 go test -c -o /dev/null
  7. GOOS=freebsd GOARCH=amd64 go test -c -o /dev/null
  8. GOOS=freebsd GOARCH=arm go test -c -o /dev/null
  9. GOOS=freebsd GOARCH=arm64 go test -c -o /dev/null
  10. GOOS=illumos GOARCH=amd64 go test -c -o /dev/null
  11. GOOS=linux GOARCH=386 go test -c -o /dev/null
  12. GOOS=linux GOARCH=amd64 go test -c -o /dev/null
  13. GOOS=linux GOARCH=arm go test -c -o /dev/null
  14. GOOS=linux GOARCH=arm64 go test -c -o /dev/null
  15. GOOS=linux GOARCH=loong64 go test -c -o /dev/null
  16. GOOS=linux GOARCH=ppc64le go test -c -o /dev/null
  17. GOOS=linux GOARCH=riscv64 go test -c -o /dev/null
  18. GOOS=linux GOARCH=s390x go test -c -o /dev/null
  19. GOOS=netbsd GOARCH=386 go test -c -o /dev/null
  20. GOOS=netbsd GOARCH=amd64 go test -c -o /dev/null
  21. GOOS=netbsd GOARCH=arm go test -c -o /dev/null
  22. GOOS=openbsd GOARCH=386 go test -c -o /dev/null
  23. GOOS=openbsd GOARCH=amd64 go test -c -o /dev/null
  24. GOOS=openbsd GOARCH=arm64 go test -c -o /dev/null
  25. GOOS=windows GOARCH=386 go test -c -o /dev/null
  26. GOOS=windows GOARCH=amd64 go test -c -o /dev/null
  27. GOOS=windows GOARCH=arm64 go test -c -o /dev/null
  28. clean:
  29. rm -f cpu.test mem.test *.out
  30. go clean
  31. edit:
  32. @touch log
  33. @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile go.mod builder.json all_test.go gc.go & fi
  34. editor:
  35. gofmt -l -s -w *.go
  36. go test -c -o /dev/null 2>&1 | tee log-editor
  37. race:
  38. go test -v -failfast -heap -race 2>&1 | tee log-test
  39. @git diff testdata/ || true
  40. @git status
  41. @grep TOTAL log-test || true
  42. grep 'FAIL\|TODO' log-test || true
  43. test:
  44. go test -v -failfast -trctodo -exterr -heap 2>&1 | tee log-test
  45. @git diff testdata/ || true
  46. @git status
  47. @grep TOTAL log-test || true
  48. grep 'FAIL\|TODO' log-test || true
  49. test2:
  50. go test -v -failfast -trctodo -exterr -src $$HOME/src 2>&1 | tee log-test2
  51. @git diff testdata/ || true
  52. @git status
  53. @grep TOTAL log-test2 || true
  54. grep 'FAIL\|TODO' log-test2 || true
  55. parser2:
  56. go test -v -failfast -run TestParser -src $$HOME/src 2>&1 | tee log-parser2
  57. @git diff testdata/ || true
  58. @git status
  59. @grep TOTAL log-parser2 || true
  60. grep 'FAIL\|TODO' log-parser2 || true
  61. back:
  62. go test -v -failfast -noback 2>&1 | tee log-back
  63. @git diff testdata/ || true
  64. @git status
  65. @grep TOTAL log-back || true
  66. grep 'FAIL\|TODO' log-back || true
  67. nreport:
  68. touch log-nreport
  69. cp log-nreport log-nreport0
  70. go test -v -failfast -run TestParser -heap -nreport 2>&1 | tee log-nreport
  71. @git diff testdata/ || true
  72. @git status
  73. @grep TOTAL log-report || true
  74. grep 'FAIL\|TODO' log-report || true
  75. report:
  76. go test -v -failfast -run TestParser -report 2>&1 | tee log-report
  77. @git diff testdata/ || true
  78. @git status
  79. @grep TOTAL log-report || true
  80. grep 'FAIL\|TODO' log-report || true
  81. report2:
  82. go test -v -failfast -run TestParser -src $$HOME/src -report 2>&1 | tee log-report2
  83. @git diff testdata/ || true
  84. @git status
  85. @grep TOTAL log-report2 || true
  86. grep 'FAIL\|TODO' log-report2 || true
  87. benchmarks:
  88. go test -v -run @ -bench . 2>&1 | tee log-benchmarks
  89. benchmarks2:
  90. go test -v -run @ -bench . -bsrc $$HOME/src 2>&1 | tee log-benchmarks2
  91. mem:
  92. go test -run @ -bench BenchmarkParser -memprofile mem.out
  93. go tool pprof --lines --alloc_space *.test mem.out
  94. memgo:
  95. go test -run @ -bench BenchmarkGoParser -memprofile mem.out
  96. go tool pprof --lines --alloc_space *.test mem.out