File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 exit 77
99fi
1010
11- if [ ! -x ./scripts/fwd.test.expect ]
11+ # Automake sets $srcdir for tests. When building out-of-tree (e.g.
12+ # make distcheck), the expect script only lives in the source tree,
13+ # not the build tree. Fall back to the current directory otherwise.
14+ expect_script=" ${srcdir:- .} /scripts/fwd.test.expect"
15+
16+ if [ ! -x " $expect_script " ]
1217then
1318 echo " fail: missing expect script"
1419 exit 1
4651
4752# Run the expect script
4853
49- ./scripts/fwd.test.expect
54+ " $expect_script "
Original file line number Diff line number Diff line change 4040#include <wolfssh/port.h>
4141#include <wolfssh/ssh.h>
4242#include <wolfssh/internal.h>
43+ #include <wolfssh/test.h>
4344#ifdef WOLFSSH_SFTP
4445 #include <wolfssh/wolfsftp.h>
4546#endif
@@ -1894,6 +1895,14 @@ int main(int argc, char** argv)
18941895 (void )argc ;
18951896 (void )argv ;
18961897
1898+ /* Tests load key files via relative paths (e.g. "keys/..."). When invoked
1899+ * from a build directory such as make distcheck's _build/sub, walk up to
1900+ * the source tree before running tests that read those files. */
1901+ #if !defined(WOLFSSL_MDK_ARM ) && !defined(WOLFSSL_KEIL_FS ) && \
1902+ !defined(WOLFSSL_TIRTOS ) && !defined(WOLFSSL_NUCLEUS )
1903+ ChangeToWolfSshRoot ();
1904+ #endif
1905+
18971906 wolfSSH_Init ();
18981907
18991908 ctx = wolfSSH_CTX_new (WOLFSSH_ENDPOINT_CLIENT , NULL );
You can’t perform that action at this time.
0 commit comments