summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Pino Garcia <dpino@igalia.com>2021-02-26 10:45:23 +0800
committerPatrick Griffis <tingping@tingping.se>2021-04-13 21:14:37 +0000
commitb7a78ad4d9287970ce6fca5d95afdd5692dce089 (patch)
treed5882955669537bff698c1eeb9435ed2a8a68ca6
parent6ad4cfd78ee4960d6dfd53bb4820439f57e4f165 (diff)
downloadlibsoup-b7a78ad4d9287970ce6fca5d95afdd5692dce089.tar.gz
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
-rw-r--r--tests/autobahn/autobahn-test.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/autobahn/autobahn-test.c b/tests/autobahn/autobahn-test.c
index b782eeb0..e9c6fd88 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);