]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
enable authopt and misc unit tests
authorDamien Miller <djm@mindrot.org>
Sat, 3 Apr 2021 07:21:08 +0000 (18:21 +1100)
committerDamien Miller <djm@mindrot.org>
Sat, 3 Apr 2021 07:21:08 +0000 (18:21 +1100)
Neither were wired into the build, both required some build
adaptations for -portable

Makefile.in
regress/Makefile
regress/unittests/authopt/tests.c
regress/unittests/misc/test_argv.c
regress/unittests/misc/test_convtime.c
regress/unittests/misc/test_expand.c
regress/unittests/misc/test_parse.c
regress/unittests/misc/tests.c

index 15db373d22a2a190b705469c264ef9cd8886f968..dddb2e4210b399f5d609da299469c911530320a5 100644 (file)
@@ -272,12 +272,8 @@ clean:     regressclean
        rm -f regress/mkdtemp$(EXEEXT)
        rm -f regress/unittests/test_helper/*.a
        rm -f regress/unittests/test_helper/*.o
-       rm -f regress/unittests/sshbuf/*.o
-       rm -f regress/unittests/sshbuf/test_sshbuf$(EXEEXT)
-       rm -f regress/unittests/sshkey/*.o
-       rm -f regress/unittests/sshkey/test_sshkey$(EXEEXT)
-       rm -f regress/unittests/sshsig/*.o
-       rm -f regress/unittests/sshsig/test_sshsig$(EXEEXT)
+       rm -f regress/unittests/authopt/*.o
+       rm -f regress/unittests/authopt/test_authopt$(EXEEXT)
        rm -f regress/unittests/bitmap/*.o
        rm -f regress/unittests/bitmap/test_bitmap$(EXEEXT)
        rm -f regress/unittests/conversion/*.o
@@ -288,6 +284,14 @@ clean:     regressclean
        rm -f regress/unittests/kex/test_kex$(EXEEXT)
        rm -f regress/unittests/match/*.o
        rm -f regress/unittests/match/test_match$(EXEEXT)
+       rm -f regress/unittests/misc/*.o
+       rm -f regress/unittests/misc/test_misc$(EXEEXT)
+       rm -f regress/unittests/sshbuf/*.o
+       rm -f regress/unittests/sshbuf/test_sshbuf$(EXEEXT)
+       rm -f regress/unittests/sshkey/*.o
+       rm -f regress/unittests/sshkey/test_sshkey$(EXEEXT)
+       rm -f regress/unittests/sshsig/*.o
+       rm -f regress/unittests/sshsig/test_sshsig$(EXEEXT)
        rm -f regress/unittests/utf8/*.o
        rm -f regress/unittests/utf8/test_utf8$(EXEEXT)
        rm -f regress/misc/sk-dummy/*.o
@@ -305,12 +309,8 @@ distclean: regressclean
        rm -f regress/mkdtemp
        rm -f regress/unittests/test_helper/*.a
        rm -f regress/unittests/test_helper/*.o
-       rm -f regress/unittests/sshbuf/*.o
-       rm -f regress/unittests/sshbuf/test_sshbuf
-       rm -f regress/unittests/sshkey/*.o
-       rm -f regress/unittests/sshkey/test_sshkey
-       rm -f regress/unittests/sshsig/*.o
-       rm -f regress/unittests/sshsig/test_sshsig
+       rm -f regress/unittests/authopt/*.o
+       rm -f regress/unittests/authopt/test_authopt
        rm -f regress/unittests/bitmap/*.o
        rm -f regress/unittests/bitmap/test_bitmap
        rm -f regress/unittests/conversion/*.o
@@ -321,6 +321,14 @@ distclean: regressclean
        rm -f regress/unittests/kex/test_kex
        rm -f regress/unittests/match/*.o
        rm -f regress/unittests/match/test_match
+       rm -f regress/unittests/misc/*.o
+       rm -f regress/unittests/misc/test_misc
+       rm -f regress/unittests/sshbuf/*.o
+       rm -f regress/unittests/sshbuf/test_sshbuf
+       rm -f regress/unittests/sshkey/*.o
+       rm -f regress/unittests/sshkey/test_sshkey
+       rm -f regress/unittests/sshsig/*.o
+       rm -f regress/unittests/sshsig/test_sshsig
        rm -f regress/unittests/utf8/*.o
        rm -f regress/unittests/utf8/test_utf8
        (cd openbsd-compat && $(MAKE) distclean)
@@ -485,14 +493,16 @@ uninstall:
 
 regress-prep:
        $(MKDIR_P) `pwd`/regress/unittests/test_helper
-       $(MKDIR_P) `pwd`/regress/unittests/sshbuf
-       $(MKDIR_P) `pwd`/regress/unittests/sshkey
-       $(MKDIR_P) `pwd`/regress/unittests/sshsig
+       $(MKDIR_P) `pwd`/regress/unittests/authopt
        $(MKDIR_P) `pwd`/regress/unittests/bitmap
        $(MKDIR_P) `pwd`/regress/unittests/conversion
        $(MKDIR_P) `pwd`/regress/unittests/hostkeys
        $(MKDIR_P) `pwd`/regress/unittests/kex
        $(MKDIR_P) `pwd`/regress/unittests/match
+       $(MKDIR_P) `pwd`/regress/unittests/misc
+       $(MKDIR_P) `pwd`/regress/unittests/sshbuf
+       $(MKDIR_P) `pwd`/regress/unittests/sshkey
+       $(MKDIR_P) `pwd`/regress/unittests/sshsig
        $(MKDIR_P) `pwd`/regress/unittests/utf8
        $(MKDIR_P) `pwd`/regress/misc/sk-dummy
        [ -f `pwd`/regress/Makefile ] || \
@@ -578,6 +588,18 @@ regress/unittests/bitmap/test_bitmap$(EXEEXT): ${UNITTESTS_TEST_BITMAP_OBJS} \
            regress/unittests/test_helper/libtest_helper.a \
            -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
 
+UNITTESTS_TEST_AUTHOPT_OBJS=\
+       regress/unittests/authopt/tests.o \
+       auth-options.o \
+       $(SKOBJS)
+
+regress/unittests/authopt/test_authopt$(EXEEXT): \
+    ${UNITTESTS_TEST_AUTHOPT_OBJS} \
+    regress/unittests/test_helper/libtest_helper.a libssh.a
+       $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_AUTHOPT_OBJS) \
+           regress/unittests/test_helper/libtest_helper.a \
+           -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
+
 UNITTESTS_TEST_CONVERSION_OBJS=\
        regress/unittests/conversion/tests.o
 
@@ -621,6 +643,20 @@ regress/unittests/match/test_match$(EXEEXT): \
            regress/unittests/test_helper/libtest_helper.a \
            -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
 
+UNITTESTS_TEST_MISC_OBJS=\
+       regress/unittests/misc/tests.o \
+       regress/unittests/misc/test_parse.o \
+       regress/unittests/misc/test_expand.o \
+       regress/unittests/misc/test_convtime.o \
+       regress/unittests/misc/test_argv.o
+
+regress/unittests/misc/test_misc$(EXEEXT): \
+    ${UNITTESTS_TEST_MISC_OBJS} \
+    regress/unittests/test_helper/libtest_helper.a libssh.a
+       $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_MISC_OBJS) \
+           regress/unittests/test_helper/libtest_helper.a \
+           -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
+
 UNITTESTS_TEST_UTF8_OBJS=\
        regress/unittests/utf8/tests.o
 
@@ -655,14 +691,16 @@ regress-binaries: regress-prep $(LIBCOMPAT) \
        $(SK_DUMMY_LIBRARY)
 
 regress-unit-binaries: regress-prep $(REGRESSLIBS) \
-       regress/unittests/sshbuf/test_sshbuf$(EXEEXT) \
-       regress/unittests/sshkey/test_sshkey$(EXEEXT) \
-       regress/unittests/sshsig/test_sshsig$(EXEEXT) \
+       regress/unittests/authopt/test_authopt$(EXEEXT) \
        regress/unittests/bitmap/test_bitmap$(EXEEXT) \
        regress/unittests/conversion/test_conversion$(EXEEXT) \
        regress/unittests/hostkeys/test_hostkeys$(EXEEXT) \
        regress/unittests/kex/test_kex$(EXEEXT) \
        regress/unittests/match/test_match$(EXEEXT) \
+       regress/unittests/misc/test_misc$(EXEEXT) \
+       regress/unittests/sshbuf/test_sshbuf$(EXEEXT) \
+       regress/unittests/sshkey/test_sshkey$(EXEEXT) \
+       regress/unittests/sshsig/test_sshsig$(EXEEXT) \
        regress/unittests/utf8/test_utf8$(EXEEXT) \
 
 tests: file-tests t-exec interop-tests unit
index 43da7c7db9407d1804daa21fc527698e3841cee5..ced21a11d698fcf77edfce282e57679f6709cac1 100644 (file)
@@ -249,17 +249,20 @@ unit:
                V="" ; \
                test "x${USE_VALGRIND}" = "x" || \
                    V=${.CURDIR}/valgrind-unit.sh ; \
-               $$V ${.OBJDIR}/unittests/sshbuf/test_sshbuf ; \
-               $$V ${.OBJDIR}/unittests/sshkey/test_sshkey \
+                $$V ${.OBJDIR}/unittests/sshbuf/test_sshbuf ; \
+                $$V ${.OBJDIR}/unittests/sshkey/test_sshkey \
                        -d ${.CURDIR}/unittests/sshkey/testdata ; \
                $$V ${.OBJDIR}/unittests/sshsig/test_sshsig \
                        -d ${.CURDIR}/unittests/sshsig/testdata ; \
+               $$V ${.OBJDIR}/unittests/authopt/test_authopt \
+                       -d ${.CURDIR}/unittests/authopt/testdata ; \
                $$V ${.OBJDIR}/unittests/bitmap/test_bitmap ; \
                $$V ${.OBJDIR}/unittests/conversion/test_conversion ; \
                $$V ${.OBJDIR}/unittests/kex/test_kex ; \
                $$V ${.OBJDIR}/unittests/hostkeys/test_hostkeys \
                        -d ${.CURDIR}/unittests/hostkeys/testdata ; \
                $$V ${.OBJDIR}/unittests/match/test_match ; \
+               $$V ${.OBJDIR}/unittests/misc/test_misc ; \
                if test "x${TEST_SSH_UTF8}" = "xyes"  ; then \
                        $$V ${.OBJDIR}/unittests/utf8/test_utf8 ; \
                fi \
index 0e8aacb91699191476c4f8a541f4727a9ea8521a..8c51b3802aa6d0789b4a60453577c15ab20fdabc 100644 (file)
@@ -6,6 +6,8 @@
  * Placed in the public domain
  */
 
+#include "includes.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <stdio.h>
@@ -13,7 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_helper.h"
+#include "../test_helper/test_helper.h"
 
 #include "sshkey.h"
 #include "authfile.h"
index 0ce86694d38e4728da42e8740b4bf917c3c495ef..7a28f64e5e575684acb500192ae9a87031d11e58 100644 (file)
@@ -5,6 +5,8 @@
  * Placed in the public domain.
  */
 
+#include "includes.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <stdio.h>
@@ -12,7 +14,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_helper.h"
+#include "../test_helper/test_helper.h"
 
 #include "log.h"
 #include "misc.h"
index 8da05a26181faab7d5a5778dbbcee502c4ae135e..5be3ee43ad6e6c9b32ca9b5536980a7c6731e6d6 100644 (file)
@@ -5,6 +5,8 @@
  * Placed in the public domain.
  */
 
+#include "includes.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <stdio.h>
@@ -12,7 +14,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_helper.h"
+#include "../test_helper/test_helper.h"
 
 #include "log.h"
 #include "misc.h"
index 2a5e1bf1a5da4cf26f039e1733c394b17a75bfe9..3cfe0e7123e02bdf0f53e9ff8381ed2ab5ae37af 100644 (file)
@@ -5,6 +5,8 @@
  * Placed in the public domain.
  */
 
+#include "includes.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <stdio.h>
@@ -12,7 +14,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_helper.h"
+#include "../test_helper/test_helper.h"
 
 #include "log.h"
 #include "misc.h"
index 6fa4558e22d8f57c9d41d82f534a3dd72baf535f..dd99068d070056ca75018c88aafd3d4eb072865d 100644 (file)
@@ -5,6 +5,8 @@
  * Placed in the public domain.
  */
 
+#include "includes.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <stdio.h>
@@ -12,7 +14,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_helper.h"
+#include "../test_helper/test_helper.h"
 
 #include "log.h"
 #include "misc.h"
index fe9544a93fa09e9c93b4d7d821101f5e0335efa8..75013f481cb53f6a8fbf7cdcb2e2cbe647c09561 100644 (file)
@@ -5,6 +5,8 @@
  * Placed in the public domain.
  */
 
+#include "includes.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <stdio.h>
@@ -12,7 +14,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_helper.h"
+#include "../test_helper/test_helper.h"
 
 #include "log.h"
 #include "misc.h"