Running make check fails if gnupg was configured with the --with-agent-pgm option. It appears the test attempts to use gpg-agent from the install location. If I cd to agent and do a make install first, make check will run correctly.
make[2]: Entering directory `/usr/local/src/GnuPG/gnupg-2.2.2/tests/openpgp' LC_ALL=C EXEEXT= abs_top_srcdir=/usr/local/src/GnuPG/gnupg-2.2.2 objdir=/usr/local/src/GnuPG/gnupg-2.2.2 GPGSCM_PATH=/usr/local/src/GnuPG/gnupg-2.2.2/tests/gpgscm /usr/local/src/GnuPG/gnupg-2.2.2/tests/gpgscm/gpgscm \ /usr/local/src/GnuPG/gnupg-2.2.2/tests/openpgp/run-tests.scm ("/usr/local/src/GnuPG/gnupg-2.2.2/tools/gpg-connect-agent" --verbose "--agent-program=/opt/gnupg22/bin/gpg-agent|--debug-quick-random" /bye) failed: gpg-connect-agent: no running gpg-agent - starting '/opt/gnupg22/bin/gpg-agent|--debug-quick-random' gpg-connect-agent: failed to start agent '/opt/gnupg22/bin/gpg-agent|--debug-quick-random': No such file or directory gpg-connect-agent: can't connect to the agent: No such file or directory gpg-connect-agent: error sending standard options: No agent running FAIL: tests/openpgp/setup.scm Setup failed. make[2]: *** [xcheck] Error 1 make[2]: Leaving directory `/usr/local/src/GnuPG/gnupg-2.2.2/tests/openpgp'