You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

62 lines
1.4 KiB

  1. #!/usr/bin/env sh
  2. echo
  3. echo Unit Test:
  4. echo
  5. bats --tap test_mw.bats
  6. echo
  7. echo "Integration tests need working email $mwaddr"
  8. if [ -z "$MAILDIR" ] || [ -z "$mwaddr" ]; then
  9. echo "First do:"
  10. [ -z "$MAILDIR" ] && echo "export MAILDIR=..."
  11. [ -z "$mwaddr" ] && echo "export mwaddr=your.email@gmail.com"
  12. exit
  13. fi
  14. export PREFIX=$PWD/mwtesttmp
  15. export PATH=$PATH:$PREFIX/bin
  16. cd .. && make install && OK="OK"
  17. if [ "$OK" = "OK" ]; then
  18. echo "Warning: Out with CTRL-C if your mail (config) files are important here."
  19. read
  20. export mwmaildir=$MAILDIR
  21. export mwname='r n'
  22. export mwlogin=$mwaddr
  23. export mwpass="${mwpass:-mutt-wizard-$mwaddr}"
  24. mwaccmaildir="$mwmaildir/$mwaddr"
  25. rm -rf $mwaccmaildir
  26. [ -f "${PASSWORD_STORE_DIR:-~/.password-store}/$mwpass.gpg" ] || pass insert $mwpass
  27. echo "= Test 1 ="
  28. echo $PATH
  29. mwtype=online mw add
  30. echo "=> In another prompt, start mutt and verify that mails are shown"
  31. echo "=> Then answer with N"
  32. mw purge
  33. rm -rf $mwaccmaildir
  34. echo "= Test 2 ="
  35. mwtype=offline mw add
  36. mw
  37. echo "=> In another prompt, start mutt and verify that mails are shown"
  38. echo "=> Press i1, wait, press i2. Verify that mutt is fast again after i2."
  39. echo "=> Press gm and gM, to start mw sync."
  40. echo "=> Answer with Y and check that mbsyncrc, msmtp/config and mutt/accounts are gone."
  41. mw purge
  42. fi
  43. cd $CD
  44. rm -rf $PREFIX