Mercurial
annotate mrjunejune/test/auto_generated_test.c @ 177:24fe8ff94056
Fixed few issues with current setup.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Wed, 21 Jan 2026 19:40:48 -0800 |
| parents | c1eab8c0b0f9 |
| children |
| rev | line source |
|---|---|
| 129 | 1 // Auto-generated test file |
| 2 // Source: /Users/mrjunejune/zenbu/mrjunejune/main.c | |
| 3 // DO NOT EDIT - Regenerate with: bazel run //seobeo:test_generator | |
| 4 | |
| 5 #include "mrjunejune/test/test.h" | |
| 6 | |
| 7 #define TEST_HOST "127.0.0.1" | |
| 8 #define TEST_PORT "6969" | |
| 9 | |
| 10 int main(int argc, char *argv[]) | |
| 11 { | |
| 12 printf("=== Auto-generated Snapshot Creator ===\n\n"); | |
| 13 | |
|
145
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
14 const char *server_binary = "./mrjunejune_server"; |
| 129 | 15 if (argc > 1) server_binary = argv[1]; |
| 16 | |
| 17 pid_t server_pid = start_test_server(server_binary); | |
| 18 if (server_pid < 0) return 1; | |
| 19 | |
| 20 SnapshotConfig configs[] = { | |
| 21 {"/", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 22 {"/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 23 {"/resume", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 24 {"/resume/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 25 {"/tools", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 26 {"/tools/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 27 {"/tools/markdown_to_html", 200, 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}, | |
| 30 {"/tools/file_converter/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 31 // TODO: POST route - POST /api/convert/image-to-webp - requires request body | |
| 32 // TODO: POST route - POST /api/convert/video-to-mp4 - requires request body | |
| 33 // TODO: Dynamic route - GET /api/download/:filename - fill in actual path | |
| 34 {"/blog", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 35 // TODO: Dynamic route - GET /blog/:blog_id - fill in actual path | |
| 36 {"/talk", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 37 {"/talk/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT}, | |
| 38 }; | |
| 39 | |
| 40 int count = sizeof(configs) / sizeof(configs[0]); | |
| 41 int result = Seobeo_Snapshots_Create_Batch(configs, count); | |
| 42 | |
| 43 stop_test_server(server_pid); | |
| 44 return result; | |
| 45 } |