testsuite-summary.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #! /bin/sh
  2. # Copyright (C) 2012-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check performanceof recipe generating test-suite.log file and testsuite
  17. # summary. That has suffered of huge inefficiencies in the past.
  18. # FIXME: this test is not currently able to detect whether the measured
  19. # FIXME: performance is too low, and FAIL accordingly; it just offers
  20. # FIXME: an easy way verify how effective a performance optimization is.
  21. . test-init.sh
  22. count=10000
  23. echo AC_OUTPUT >> configure.ac
  24. cat > Makefile.am <<'END'
  25. TEST_EXTENSIONS = .t
  26. ## Will be updated later.
  27. TESTS =
  28. ## None of these should ever be run.
  29. T_LOG_COMPILER = false
  30. T_LOG_DRIVER = false
  31. END
  32. # Temporarily disable shell traces, to avoid bloating the log file.
  33. set +x
  34. for i in $(seq_ 1 $count); do
  35. echo false > $i.t
  36. echo dummy $i > $i.log
  37. echo :global-test-result: PASS > $i.trs
  38. echo :test-result: PASS >> $i.trs
  39. echo :copy-in-global-log: yes >> $i.trs
  40. echo TESTS += $i.t
  41. done >> Makefile.am
  42. # Re-enable shell traces.
  43. set -x
  44. head -n 100 Makefile.am || : # For debugging.
  45. tail -n 100 Makefile.am || : # Likewise.
  46. cat $count.trs # Likewise, just the last specimen though.
  47. # So that we don't need to create a ton of dummy tests.
  48. #echo '$(TESTS):' >> Makefile.am
  49. $ACLOCAL
  50. $AUTOCONF
  51. $AUTOMAKE -a
  52. ./configure
  53. $MAKE test-suite.log >stdout || { cat stdout; exit 1; }
  54. cat stdout
  55. # Sanity checks.
  56. grep "^# TOTAL: $count$" stdout
  57. grep "^dummy $count$" test-suite.log
  58. specimen=347 # Could be any number <= $count.
  59. grep "^dummy $specimen$" test-suite.log
  60. :