Testing Infrastructure

Test Coverage & File Architecture

ZepraBrowser Testing Architecture

The ZepraBrowser project maintains a massive test suite scaling identically with core development. Test components are broadly organized into native C++ integration tests handling core DOM and browser integration alongside dedicated ZepraScript test environments.

šŸŽÆ Overall Test Tree

The core test/ directory coordinates integration testing for networking, crypto, DOM, garbage collection algorithms, and rendering engines. 26 total directories governing 108 test files exist today.

bash
zeprabrowser/test/
ā”œā”€ā”€ browser_test_runner.cpp             # Central Test Orchestration
ā”œā”€ā”€ CMakeLists.txt                      # CMake Build Setup
ā”œā”€ā”€ dom_test.html                       # HTML Execution Tests
ā”œā”€ā”€ nxcrypto_tests.cpp                  # Native Cryptography Integration
ā”œā”€ā”€ nxhttp_security_test.cpp            # HTTP Protocol & Security Validation
ā”œā”€ā”€ nxhttp_tests.cpp                    # Native networking assertions
ā”œā”€ā”€ smart_ram_allocator_test.cpp        # RAM Memory Limiting Validation
ā”œā”€ā”€ test_basic.cpp                      # Core Application Base Setup
ā”œā”€ā”€ visual_test_nxsvg.cpp               # NX SVG Native Rendering Validation
ā”œā”€ā”€ demos/                              # App GUI Emulation
│   └── zepraEngine
│       ā”œā”€ā”€ examples
│       │   ā”œā”€ā”€ gl_demo.cpp             # Direct OpenGL Hardware Benchmarks
│       │   ā”œā”€ā”€ webgl_demo.cpp          # WebGL Native Translation Sandbox
│       │   └── zepra_window_demo.cpp   # Full Desktop Application Pipeline Sandbox
│       └── src
│           ā”œā”€ā”€ zepra_browser_app.cpp
│           └── zepra_browser_nxgfx.cpp
ā”œā”€ā”€ webexstest/                         # Extensions & Threading Tests
│   ā”œā”€ā”€ connectest
│   └── crawlinf
ā”œā”€ā”€ htmltest/
│   └── test_css_cascade.html           # Full HTML CSS cascade assertions
ā”œā”€ā”€ layouttest/
│   └── test_layout.html                # Browser reflow verification
└── jstest/
    └── test_javascript.html            # Inline JS injection testing

šŸ—‘ļø Deep Garbage Collection Validation

Memory integrity and deterministic collection is pivotal to ZepraScript and the Browser DOM bridging functionality. Memory assertions evaluate isolated boundaries continuously:

  • gc_age_table_test.cpp - Validating object longevity metrics in the Nursery.
  • gc_barrier_test.cpp - Multi-tier write barriers cross-generational bounds.
  • gc_capacity_test.cpp - Strict memory cap boundary checks to guarantee application RAM footprint thresholds.
  • gc_card_table_test.cpp - High-speed Card Table manipulation for large object heaps.
  • gc_evacuation_test.cpp - Live memory defragmentation correctness inside the Tenured space.
  • gc_free_list_test.cpp - Quick allocation pipeline tracking validation.
  • gc_nursery_test.cpp - Ephemeral object rapid garbage sweep logic testing.
  • gc_object_header_test.cpp - Verifying 64-bit word tagging and headers aren't mutating improperly.
  • gc_pretenure_test.cpp - Validating enormous object memory tracking mechanisms straight to tenured heap spaces.
  • gc_root_set_test.cpp - Testing the internal compiler AST, stack registers, global execution context objects root tracking.
  • gc_scheduler_test.cpp - Ensures garbage collection timing mechanics halt WebCore engines appropriately.
  • gc_snapshot_test.cpp - Validating Heap Dump mechanics utilized via Developer Tools Performance trackers.
  • gc_tlab_test.cpp - Thread-Local Allocation Buffers locking validations.
  • gc_wb_buffer_test.cpp - Concurrent generational store tracking logic.
  • gc_weak_test.cpp - Testing WeakMap / WeakRef zero-reference cleanup checks.

šŸ¦“ ZepraScript Engine Test Suite

ZepraScript maintains a fully modularized test suite encompassing exactly 72 tests focusing on standalone logic, compliance with Test262 standard ECMA validations, JIT correctness, Interpreter boundaries, WASM translation, and Core Web API bridging correctness.

bash
zeprabrowser/test/zeprascript/
ā”œā”€ā”€ ZepraScriptTestRunner.cpp           # Master ZepraScript Engine Wrapper Driver
ā”œā”€ā”€ CMakeLists.txt
ā”œā”€ā”€ unit/                               # Deep Internal C++ Assertions
│   ā”œā”€ā”€ ast_tests.cpp                   # AST Pipeline Evaluation
│   ā”œā”€ā”€ async_tests.cpp                 # Async / Await Event Loop Ticking
│   ā”œā”€ā”€ browser_integration_tests.cpp   # WebCore Native Extension C++ Bridging
│   ā”œā”€ā”€ builtin_tests.cpp               # Native Javascript Base Utilities C++ validation
│   ā”œā”€ā”€ class_tests.cpp                 # JS Class and ES6 prototype tree building
│   ā”œā”€ā”€ gc_concurrent_stress_test.cpp   # GC Thread Starving Engine Benchmarks
│   ā”œā”€ā”€ gc_tests.cpp                    # Standalone Engine specific memory boundaries
│   ā”œā”€ā”€ generator_tests.cpp             # JS State Machine yielding and execution
│   ā”œā”€ā”€ jit_stress_test.cpp             # Extensive Just-In-Time Heat Testing Logic
│   ā”œā”€ā”€ JITTests.cpp                    # Strict JIT Tier Execution Assertion Checks
│   ā”œā”€ā”€ lexer_tests.cpp                 # Raw UTF-8 to Token Stream Parsing Checks
│   ā”œā”€ā”€ parser_tests.cpp                # Heavy AST Evaluation Parsing Tests
│   ā”œā”€ā”€ robustness_tests.cpp            # Engine failure crash protections
│   ā”œā”€ā”€ runtime_tests.cpp               # Bytecode Virtual Machine Native Evaluation
│   ā”œā”€ā”€ RuntimeTests.cpp                # Native Core Execution Evaluation Boundaries
│   ā”œā”€ā”€ sandbox_tests.cpp               # Site-Isolation Threat Protection and Jailbreak testing
│   ā”œā”€ā”€ stress_tests.cpp                # Memory and Compute Timeout Validation Checks
│   ā”œā”€ā”€ url_tests.cpp                   # Native C++ Network Layer Routing Checks
│   ā”œā”€ā”€ value_tests.cpp                 # JS Value NaN Tagging Boundaries inside Registers
│   ā”œā”€ā”€ vm_stress_test.cpp              # Extreme Operations Pipeline Bottleneck Validations
│   ā”œā”€ā”€ vm_tests.cpp                    # Raw Execution Pipeline Validations
│   ā”œā”€ā”€ wasm_tests.cpp                  # Assembly parsing and runtime limits
│   ā”œā”€ā”€ WASMTests.cpp                   # Native C++ Engine interaction to WASM Modules
│   ā”œā”€ā”€ build_comprehensive_tests.cpp   # Integration with CLI tooling
│   └── zir_tests.cpp                   # Zepra Intermediate Representation (Bytecode) Parsing Check
ā”œā”€ā”€ spec/                               # ECMA Specification Tools
│   ā”œā”€ā”€ EngineIntrospection.h
│   ā”œā”€ā”€ SpecTestRunner.cpp
│   ā”œā”€ā”€ SpecTestRunner.h
│   ā”œā”€ā”€ Test262Harness.cpp
│   └── Test262Harness.h
ā”œā”€ā”€ test262/                            # Raw ECMA Code Compliance Scripts
│   ā”œā”€ā”€ basic_compliance.js
│   └── extended_compliance.js
ā”œā”€ā”€ scripts/                            # Engine Standard Sanity Checking
│   ā”œā”€ā”€ 01_variables.js
│   ā”œā”€ā”€ 02_arithmetic.js
│   ā”œā”€ā”€ 03_strings.js
│   ā”œā”€ā”€ 04_control_flow.js
│   ā”œā”€ā”€ 05_functions.js
│   ā”œā”€ā”€ 06_objects.js
│   ā”œā”€ā”€ 07_arrays.js
│   ā”œā”€ā”€ 08_classes.js
│   ā”œā”€ā”€ 09_error_handling.js
│   └── 10_operators.js
ā”œā”€ā”€ runtime/
│   ā”œā”€ā”€ smart_ram_allocator_test.cpp
│   └── tab_lifecycle_test.cpp          # Browser Architecture Site Isolation Pipeline checks
ā”œā”€ā”€ js/                                 # Advanced Deep JS Verification
│   ā”œā”€ā”€ api_audit.js
│   ā”œā”€ā”€ async_test.js
│   ā”œā”€ā”€ builtin_tests.js
│   ā”œā”€ā”€ core_tests.js
│   ā”œā”€ā”€ es6_tests.js
│   ā”œā”€ā”€ full_compliance_test.js
│   ā”œā”€ā”€ p1_api_test.js
│   └── simple_test.js
ā”œā”€ā”€ jit/
│   └── jit_correctness_test.cpp        # Confirm machine code execution is equivalent to bytecode results
ā”œā”€ā”€ interpreter/
│   └── interpreter_edge_cases_test.cpp # Ensure massive objects and call stacks do not break the C++ frames
ā”œā”€ā”€ integration/                        # Web API Validation Checks
│   ā”œā”€ā”€ browser_vm_integration_test.cpp
│   ā”œā”€ā”€ fetch_tests.cpp                 # Network bridging JS -> C++ -> OS checks
│   ā”œā”€ā”€ indexeddb_tests.cpp             # Persistent File System Disk Sync validation
│   ā”œā”€ā”€ js_execution_test.cpp
│   ā”œā”€ā”€ module_tests.cpp                # Importing JS/TS inside native contexts
│   └── promise_tests.cpp               # Heavy native promise multi-threaded coordination
ā”œā”€ā”€ gc/
│   ā”œā”€ā”€ gc_generational_test.cpp
│   ā”œā”€ā”€ gc_stress_test.cpp
│   └── gc_tab_isolation_test.cpp       # Checks Tab Cross-Communication memory protections are absolute
ā”œā”€ā”€ browser_apis/
│   ā”œā”€ā”€ fetch_test.cpp
│   └── secure_storage_test.cpp
ā”œā”€ā”€ benchmarks/                         # Heavy Node versus Zepra Script Engine Processing tests
│   ā”œā”€ā”€ array_ops.js
│   └── fibonacci.js
└── wasm/
    └── wasm_execution_test.cpp         # High performance WASM assembly interaction module validations

Note: 14 directories, 72 files strictly within the ZepraScript runtime module.


Last Updated: 2026-03-15
Version: v0.01 Alpha
Maintainer: Swanaya

HomeDocsCommunityBlog