#!/usr/bin/env sh echo echo Unit Test: echo bats --tap test_mw.bats #modify if [[ -z $MAILDIR ]] || [[ -z $mwaddr ]]; then echo "First do:" [[ -z $MAILDIR ]] && echo "export MAILDIR=..." [[ -z $mwaddr ]] && echo "export mwaddr=your.email@gmail.com" exit fi echo echo "Integration tests need working email $mwaddr" echo "CTRL-C to skip" cd .. && sudo make install && OK="OK" if [[ "$OK" == "OK" ]]; then echo "Warning: Out with CTRL-C if your mail (config) files are important here." export mwmaildir=$MAILDIR export mwname='r n' export mwlogin=$mwaddr export mwpass="${mwpass:-mutt-wizard-$mwaddr}" mwaccmutt="${mwaddr//[.@]/_}" mwaccmaildir="$mwmaildir/$mwaccmutt" # folder name as shown by mutt and opens with gf in vim rm -rf $mwaccmaildir [ -f "${PASSWORD_STORE_DIR:-~/.password-store}/$mwpass.gpg" ] || pass insert $mwpass echo "= Test 1 =" mwtype=online mw add echo "=> In another window, start mutt and verify that mails are shown" echo "=> Then anwer with N" mw purge rm -rf $mwaccmaildir echo "= Test 2 =" mwtype=offline mw add mailsync echo "=> In another window, start mutt and verify that mails are shown" echo "=> Press i1, wait, press i2. Verify that mutt is fast again after i2." echo "=> Press gm and gM, to start mailsync." echo "=> Anwer with Y and check that mbsyncrc, msmtp/config and mutt/accounts are gone." mw purge fi cd $CD