From be7eb026436f6b68eb718a01cdd249acd85b05c5 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Tue, 8 Sep 2020 14:12:41 -0700 Subject: [PATCH] Update HW test to use environmental variables Signed-off-by: Travis F. Collins --- test/auto_rate_test_hw.c | 4 +++- test/filter_designer_hw.c | 6 ++++-- test/fmcomms5_sync_test.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/auto_rate_test_hw.c b/test/auto_rate_test_hw.c index 20edf25..af9bae3 100644 --- a/test/auto_rate_test_hw.c +++ b/test/auto_rate_test_hw.c @@ -52,7 +52,9 @@ int main(void) unsigned long rates[] = {520888, 600000, 1000000, 10000000, 20000000, 40000000, 60000000}; - char * uri = "ip:192.168.2.1"; + const char* uri = getenv("URI_AD9361"); + if (uri == NULL) + exit(0);// Cant find anything don't run tests ctx = iio_create_context_from_uri(uri); if (ctx == NULL) { printf("No device found... skipping test"); diff --git a/test/filter_designer_hw.c b/test/filter_designer_hw.c index f441ee6..f239662 100644 --- a/test/filter_designer_hw.c +++ b/test/filter_designer_hw.c @@ -22,13 +22,15 @@ int main(void) unsigned long rates[] = {1000000, 10000000, 20000000, 60000000}; - char * uri = "ip:192.168.2.1"; + const char* uri = getenv("URI_AD9361"); + if (uri == NULL) + exit(0);// Cant find anything don't run tests ctx = iio_create_context_from_uri(uri); if (ctx == NULL) exit(0);// Cant find anything don't run tests dev = iio_context_find_device(ctx, "ad9361-phy"); - for (k = 0; k < 1; k++) { + for (k = 0; k < 3; k++) { printf("Testing rate: %lu\n",rates[k]); diff --git a/test/fmcomms5_sync_test.c b/test/fmcomms5_sync_test.c index 054a71f..5dd3807 100644 --- a/test/fmcomms5_sync_test.c +++ b/test/fmcomms5_sync_test.c @@ -204,7 +204,9 @@ int main(void) { // Set up context struct iio_context *ctx; - char * uri = "ip:192.168.1.208"; + const char* uri = getenv("URI_FMCOMMS5"); + if (uri == NULL) + exit(0);// Cant find anything don't run tests ctx = iio_create_context_from_uri(uri); if (ctx==NULL) exit(0);// Cant find anything don't run tests