From 0e7b5d2d225d90d6b6d2498b0a89049757c77ef5 Mon Sep 17 00:00:00 2001 From: Martin Stiemerling <martin.stiemerling@h-da.de> Date: Fri, 30 Jun 2023 16:59:12 +0200 Subject: [PATCH] pkg testing instead of main.go --- main.go => main_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename main.go => main_test.go (95%) diff --git a/main.go b/main_test.go similarity index 95% rename from main.go rename to main_test.go index 75da36b..c5559dd 100644 --- a/main.go +++ b/main_test.go @@ -7,13 +7,16 @@ import ( "flag" "log" "net" + "testing" "time" "code.fbi.h-da.de/m.stiemerling/proto-kms/kms" "github.com/google/uuid" ) -func main() { +//func main() { + +func TestMain(m *testing.M) { // run a self-test if set to yes var selfTesting bool // my own Name @@ -26,7 +29,7 @@ func main() { // quantumlayer so generated keys can be fetched. This is mainly to simplify // the initial setup process. - flag.BoolVar(&selfTesting, "selftesting", false, + flag.BoolVar(&selfTesting, "selftesting", true, "Will perform self-testing with second quantum link if set to true") flag.StringVar(&udpQL1AddrString, "my-address", "[::1]:50900", -- GitLab