view mrjunejune/test/auto_generated_test.c @ 279:b3b547563ec7

Add Google connector service and agent wiki Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code. Co-authored-by: Copilot <[email protected]> Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:22:36 -0700
parents 1f9877b637e9
children
line wrap: on
line source

// Auto-generated test file
// Source: /Users/mrjunejune/zenbu/mrjunejune/main.c
// DO NOT EDIT - Regenerate with: bazel run //seobeo:test_generator

#include "mrjunejune/test/test.h"

#define TEST_HOST "127.0.0.1"
#define TEST_PORT "6969"

int main(int argc, char *argv[])
{
  printf("=== Auto-generated Snapshot Creator ===\n\n");

  const char *server_binary = "./mrjunejune_server";
  if (argc > 1) server_binary = argv[1];

  pid_t server_pid = start_test_server(server_binary);
  if (server_pid < 0) return 1;

  SnapshotConfig configs[] = {
    {"/", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/resume", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/resume/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/tools", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/tools/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/tools/markdown_to_html", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/tools/markdown_to_html/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/tools/file_converter", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/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
    {"/blog", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    // TODO: Dynamic route - GET /blog/:blog_id - fill in actual path
    {"/talk", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/talk/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/jrpg", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
    {"/jrpg/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
  };

  int count = sizeof(configs) / sizeof(configs[0]);
  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;
}