added definitions for using test score server
authorHolger Schemel <info@artsoft.org>
Sun, 12 Sep 2021 11:27:07 +0000 (13:27 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 12 Sep 2021 11:27:07 +0000 (13:27 +0200)
src/Makefile
src/files.c
src/libgame/system.h

index 21ca5f9534648dbb977c5a93c38c9191a11bb3fe..5cbc559ea2daa697ea2dec5eeadb55e2b5a01c0f 100644 (file)
@@ -133,6 +133,10 @@ OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes
 # OPTIONS = -O2 -Wall
 # OPTIONS = -O2
 
+ifdef BUILD_TEST                       # test build
+OPTIONS := $(OPTIONS) -DTESTING
+endif
+
 ifdef BUILD_DIST                       # distribution build
 SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) |   \
                       sed -e "s%-rpath,[^ ]*%-rpath,'\$$ORIGIN/lib'%")
index c14d8396c8306ed4a44f43df3a526bab91feb35d..e73ce9c594144cdb4756b5354130572665bf8819 100644 (file)
@@ -9760,23 +9760,23 @@ static struct TokenInfo global_setup_tokens[] =
   },
   {
     TYPE_SWITCH,
-    &setup.use_api_server,                     "use_api_server"
+    &setup.use_api_server,          TEST_PREFIX        "use_api_server"
   },
   {
     TYPE_STRING,
-    &setup.api_server_hostname,                        "api_server_hostname"
+    &setup.api_server_hostname,     TEST_PREFIX        "api_server_hostname"
   },
   {
     TYPE_STRING,
-    &setup.api_server_password,                        "api_server_password"
+    &setup.api_server_password,     TEST_PREFIX        "api_server_password"
   },
   {
     TYPE_SWITCH,
-    &setup.ask_for_uploading_tapes,            "ask_for_uploading_tapes"
+    &setup.ask_for_uploading_tapes, TEST_PREFIX        "ask_for_uploading_tapes"
   },
   {
     TYPE_SWITCH,
-    &setup.provide_uploading_tapes,            "provide_uploading_tapes"
+    &setup.provide_uploading_tapes, TEST_PREFIX        "provide_uploading_tapes"
   },
   {
     TYPE_STRING,
index ecc5f69855079f578ce6e1ba4f9b3878a6c308b0..2943e645c14033521ab84e12d65032ffb50dc67c 100644 (file)
 #define API_SERVER_URI_GET             "/api/scores/get"
 #define API_SERVER_URI_RENAME          "/api/players/rename"
 
+#if defined(TESTING)
+#undef API_SERVER_HOSTNAME
+#define API_SERVER_HOSTNAME            "api-test.artsoft.org"
+#define TEST_PREFIX                    "test."
+#else
+#define TEST_PREFIX                    ""
+#endif
+
 // values for touch control
 #define TOUCH_CONTROL_OFF              "off"
 #define TOUCH_CONTROL_VIRTUAL_BUTTONS  "virtual_buttons"