From e63d7b6f9739f4dff5b1371f9e6e4bfe8c9d78c9 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 12 Feb 2019 11:12:50 +0100 Subject: [PATCH] Mutualise RebootNow() method on Client --- emlid/{updater => }/reboot_now.go | 2 +- emlid/{updater => }/reboot_now_test.go | 14 ++++---------- emlid/updater/util_test.go | 5 ----- emlid/util_test.go | 10 ++++++++++ 4 files changed, 15 insertions(+), 16 deletions(-) rename emlid/{updater => }/reboot_now.go (98%) rename emlid/{updater => }/reboot_now_test.go (56%) diff --git a/emlid/updater/reboot_now.go b/emlid/reboot_now.go similarity index 98% rename from emlid/updater/reboot_now.go rename to emlid/reboot_now.go index de09855..b9bf72f 100644 --- a/emlid/updater/reboot_now.go +++ b/emlid/reboot_now.go @@ -1,4 +1,4 @@ -package updater +package emlid import ( "context" diff --git a/emlid/updater/reboot_now_test.go b/emlid/reboot_now_test.go similarity index 56% rename from emlid/updater/reboot_now_test.go rename to emlid/reboot_now_test.go index 0527776..cff66a7 100644 --- a/emlid/updater/reboot_now_test.go +++ b/emlid/reboot_now_test.go @@ -1,26 +1,20 @@ -package updater +package emlid import ( "context" "testing" "time" - - "forge.cadoles.com/Pyxis/orion/emlid" ) func TestClientRebootNow(t *testing.T) { - if !*runUpdaterIntegrationTests { - t.Skip("To run this test, use: go test -updater-integration") - } - if !*runRebootTest { - t.Skip("To run this test, use: go test -updater-reboot-test") + t.Skip("To run this test, use: go test -reboot-test") } client := NewClient( - emlid.WithStandardLogger(), - emlid.WithEndpoint(*reachHost, 80), + WithStandardLogger(), + WithEndpoint(*reachHost, 80), ) if err := client.Connect(); err != nil { t.Fatal(err) diff --git a/emlid/updater/util_test.go b/emlid/updater/util_test.go index a4e27b0..7bb5361 100644 --- a/emlid/updater/util_test.go +++ b/emlid/updater/util_test.go @@ -7,11 +7,6 @@ var runUpdaterIntegrationTests = flag.Bool( "Run the 'Updater' integration tests (in addition to the unit tests)", ) -var runRebootTest = flag.Bool( - "updater-reboot-test", false, - "Run the updater 'Reboot' test (in addition to the unit tests)", -) - var runJoinNetworkTest = flag.Bool( "updater-join-network-test", false, "Run the updater 'JoinWiFiNetwork' test (in addition to the unit tests)", diff --git a/emlid/util_test.go b/emlid/util_test.go index 77a597c..d94176b 100644 --- a/emlid/util_test.go +++ b/emlid/util_test.go @@ -6,3 +6,13 @@ var runDiscoveryIntegrationTests = flag.Bool( "discovery-integration", false, "Run the 'Discovery' integration tests (in addition to the unit tests)", ) + +var runRebootTest = flag.Bool( + "reboot-test", false, + "Run the updater 'Reboot' test (in addition to the unit tests)", +) + +var reachHost = flag.String( + "reach-host", "192.168.42.1", + "The Reach module host to use in integration tests", +)