diff mrjunejune/test/auto_generated_test.c @ 244:b8aa08503378

[tools] Add sandboxed online LaTeX editor Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Mon, 03 Aug 2026 16:56:25 -0700
parents 543df0fe7168
children 1f9877b637e9
line wrap: on
line diff
--- a/mrjunejune/test/auto_generated_test.c	Mon Aug 03 15:26:44 2026 -0700
+++ b/mrjunejune/test/auto_generated_test.c	Mon Aug 03 16:56:25 2026 -0700
@@ -30,6 +30,8 @@
     {"/tools/file_converter/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
     {"/tools/hls_player", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
     {"/tools/hls_player/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+    {"/tools/latex_editor", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+    {"/tools/latex_editor/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
     // TODO: POST route - POST /api/convert/image-to-webp - requires request body
     // TODO: POST route - POST /api/convert/video-to-mp4 - requires request body
     // TODO: Dynamic route - GET /api/download/:filename - fill in actual path
@@ -40,7 +42,28 @@
   };
 
   int count = sizeof(configs) / sizeof(configs[0]);
-  int result = Seobeo_Snapshots_Create_Batch(configs, count);
+  int result = 0;
+  if (argc > 2)
+  {
+    int found = 0;
+    for (int i = 0; i < count; i++)
+    {
+      if (strcmp(configs[i].path, argv[2]) != 0)
+        continue;
+      result = Seobeo_Snapshot_Create(&configs[i]);
+      found = 1;
+      break;
+    }
+    if (!found)
+    {
+      fprintf(stderr, "No snapshot route configured for %s\n", argv[2]);
+      result = 1;
+    }
+  }
+  else
+  {
+    result = Seobeo_Snapshots_Create_Batch(configs, count);
+  }
 
   stop_test_server(server_pid);
   return result;