simpletest.sh 856 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0+
  3. #
  4. # Give zero status if this is a simple test and non-zero otherwise.
  5. # Simple tests do not contain locking, RCU, or SRCU.
  6. #
  7. # Usage:
  8. # simpletest.sh file.litmus
  9. #
  10. # Copyright IBM Corporation, 2019
  11. #
  12. # Author: Paul E. McKenney <paulmck@linux.ibm.com>
  13. litmus=$1
  14. if test -f "$litmus" -a -r "$litmus"
  15. then
  16. :
  17. else
  18. echo ' --- ' error: \"$litmus\" is not a readable file
  19. exit 255
  20. fi
  21. exclude="^[[:space:]]*\("
  22. exclude="${exclude}spin_lock(\|spin_unlock(\|spin_trylock(\|spin_is_locked("
  23. exclude="${exclude}\|rcu_read_lock(\|rcu_read_unlock("
  24. exclude="${exclude}\|synchronize_rcu(\|synchronize_rcu_expedited("
  25. exclude="${exclude}\|srcu_read_lock(\|srcu_read_unlock("
  26. exclude="${exclude}\|synchronize_srcu(\|synchronize_srcu_expedited("
  27. exclude="${exclude}\)"
  28. if grep -q $exclude $litmus
  29. then
  30. exit 255
  31. fi
  32. exit 0