parallel-tests-cmdline-override.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #! /bin/sh
  2. # Copyright (C) 2011-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 that we can use indirections when overriding TESTS and
  17. # TEST_LOGS from the command line.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_OUTPUT
  21. END
  22. cat > Makefile.am << 'END'
  23. TEST_EXTENSIONS = .test .t
  24. TEST_LOG_COMPILER = cat
  25. T_LOG_COMPILER = cat
  26. TESTS = bad.test
  27. var1 = b.test $(var2)
  28. var2 = c.test
  29. var3 = d.d
  30. var4 = e
  31. END
  32. $ACLOCAL
  33. $AUTOCONF
  34. $AUTOMAKE -a
  35. ./configure
  36. rm -f config.log # Do not create false positives below.
  37. cat > exp-log <<'END'
  38. a.log
  39. b.log
  40. c.log
  41. d.log
  42. e.log
  43. test-suite.log
  44. END
  45. cat > exp-out <<'END'
  46. PASS: a.t
  47. PASS: b.test
  48. PASS: c.test
  49. PASS: d.t
  50. PASS: e.test
  51. END
  52. do_check ()
  53. {
  54. run_make -O -- "$@" check
  55. grep '^PASS:' stdout | LC_ALL=C sort > got-out
  56. cat got-out
  57. ls . | grep '\.log$' | LC_ALL=C sort > got-log
  58. cat got-log
  59. st=0
  60. diff exp-out got-out || st=1
  61. diff exp-log got-log || st=1
  62. return $st
  63. }
  64. tests='a.t $(var1) $(var3:.d=.t) $(var4:=.test)'
  65. test_logs='a.log $(var1:.test=.log) $(var3:.d=.log) $(var4:=.log)'
  66. touch a.t b.test c.test d.t e.test
  67. do_check TESTS="$tests"
  68. do_check TEST_LOGS="$test_logs"
  69. :