Jelajahi Sumber

Add basic framework to do some script tests

Marc Di Luzio 6 tahun lalu
induk
melakukan
cbf7f975d3
1 mengubah file dengan 20 tambahan dan 1 penghapusan
  1. 20 1
      daemon/gamemode-tests.c

+ 20 - 1
daemon/gamemode-tests.c

@@ -310,7 +310,26 @@ static int game_mode_run_feature_tests(void)
 	}
 
 	/* Do custom scripts run? */
-	/* TODO */
+	int scriptstatus = 0;
+	{
+		/* Grab the scripts */
+		char scripts[CONFIG_LIST_MAX][CONFIG_VALUE_MAX];
+		memset(scripts, 0, sizeof(scripts));
+		config_get_gamemode_start_scripts(config, scripts);
+
+		if (scripts[0][0] != '\0') {
+			/* Print out the scripts to run */
+			LOG_MSG("Custom scripts:\n");
+
+			int i = 0;
+			while (*scripts[i] != '\0' && i < CONFIG_LIST_MAX)
+				LOG_MSG("%s\n", scripts[i]);
+		}
+
+		/* TODO: Somehow verify these get run
+		 * Possibly by watching if the the binary part gets run?
+		 */
+	}
 
 	/* Does the screensaver get inhibited? */
 	/* TODO */