comparison 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
comparison
equal deleted inserted replaced
243:823f2a8b16c8 244:b8aa08503378
28 {"/tools/markdown_to_html/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 28 {"/tools/markdown_to_html/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
29 {"/tools/file_converter", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 29 {"/tools/file_converter", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
30 {"/tools/file_converter/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 30 {"/tools/file_converter/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
31 {"/tools/hls_player", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 31 {"/tools/hls_player", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
32 {"/tools/hls_player/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 32 {"/tools/hls_player/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
33 {"/tools/latex_editor", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
34 {"/tools/latex_editor/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
33 // TODO: POST route - POST /api/convert/image-to-webp - requires request body 35 // TODO: POST route - POST /api/convert/image-to-webp - requires request body
34 // TODO: POST route - POST /api/convert/video-to-mp4 - requires request body 36 // TODO: POST route - POST /api/convert/video-to-mp4 - requires request body
35 // TODO: Dynamic route - GET /api/download/:filename - fill in actual path 37 // TODO: Dynamic route - GET /api/download/:filename - fill in actual path
36 {"/blog", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 38 {"/blog", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
37 // TODO: Dynamic route - GET /blog/:blog_id - fill in actual path 39 // TODO: Dynamic route - GET /blog/:blog_id - fill in actual path
38 {"/talk", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 40 {"/talk", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
39 {"/talk/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, 41 {"/talk/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
40 }; 42 };
41 43
42 int count = sizeof(configs) / sizeof(configs[0]); 44 int count = sizeof(configs) / sizeof(configs[0]);
43 int result = Seobeo_Snapshots_Create_Batch(configs, count); 45 int result = 0;
46 if (argc > 2)
47 {
48 int found = 0;
49 for (int i = 0; i < count; i++)
50 {
51 if (strcmp(configs[i].path, argv[2]) != 0)
52 continue;
53 result = Seobeo_Snapshot_Create(&configs[i]);
54 found = 1;
55 break;
56 }
57 if (!found)
58 {
59 fprintf(stderr, "No snapshot route configured for %s\n", argv[2]);
60 result = 1;
61 }
62 }
63 else
64 {
65 result = Seobeo_Snapshots_Create_Batch(configs, count);
66 }
44 67
45 stop_test_server(server_pid); 68 stop_test_server(server_pid);
46 return result; 69 return result;
47 } 70 }