[libsoup/autobahn-integration-new: 22/23] autobahn-test.c: Define env variables AUTOBAHN_NUM_CASES and AUTOBAHN_NUM_CASE




commit ab3916179c8ae5d2c922be4d3c2f8df1975d3ef1
Author: Diego Pino Garcia <dpino igalia com>
Date:   Fri Feb 26 10:45:23 2021 +0800

    autobahn-test.c: Define env variables AUTOBAHN_NUM_CASES and AUTOBAHN_NUM_CASE
    
    AUTOBAHN_NUM_CASES can be used to set the number of total cases to run.
    AUTOBAHN_NUM_CASE can be used to run a specific test.
    
    autobahn-test.c: Define AUTOBAHN_NUM_CASE env variable that allows to run a specific test

 tests/autobahn/autobahn-test.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/tests/autobahn/autobahn-test.c b/tests/autobahn/autobahn-test.c
index b782eeb0..81e4bb35 100644
--- a/tests/autobahn/autobahn-test.c
+++ b/tests/autobahn/autobahn-test.c
@@ -231,7 +231,7 @@ done:
 int main (int argc, char *argv[])
 {
         int ret = 0;
-        guint64 num_cases;
+        guint64 num_case = 1, num_cases;
         SoupSession *session;
 
         test_init (argc, argv, NULL);
@@ -239,10 +239,18 @@ int main (int argc, char *argv[])
         if (!autobahn_server ("--start", &num_cases))
                 exit (1);
 
+        if (getenv ("AUTOBAHN_NUM_CASES"))
+                num_cases = atol (getenv ("AUTOBAHN_NUM_CASES"));
+
+        if (getenv ("AUTOBAHN_NUM_CASE")) {
+                num_case = atol (getenv ("AUTOBAHN_NUM_CASE"));
+               num_cases = num_case;
+       }
+
         session = soup_session_new ();
         soup_session_add_feature_by_type (session, SOUP_TYPE_WEBSOCKET_EXTENSION_MANAGER);
 
-        for (int i = 1; i <= num_cases; i++) {
+        for (int i = num_case; i <= num_cases; i++) {
                 char *test_path = g_strdup_printf ("/autobahn/%u", i);
 
                 TestBundle *bundle = g_new0 (TestBundle, 1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]