Skip to content

How to run the Test? #2

Open
Open

Description

@mlch911

I can run the project and run the demo, but there is no way to run the tests.
Even if I manually add testTarget in Package.swift, it won't work.
Because UIKit is heavily referenced in QuickLayoutCore, but MacroTest must run on a Mac.

Activity

  1. mlch911 commented on Nov 28, 2025

    @mlch911
    ContributorAuthor

    Only after I comment out QuickLayoutCore and QuickLayoutBridge in Package.swift, I can run the tests.

  2. constantine-fry commented on Nov 29, 2025

    @constantine-fry
    Contributor

    Thanks a lot for taking a look at the tests and for putting in the effort to get them running!

    Just to give a bit of context from Meta’s side: internally we run all QuickLayout tests on every pull request, including snapshot tests, unit tests and macro tests. Unfortunately, when I open-sourced QuickLayout, I wasn’t able to make any of the test running in Package.swift.

    The bulk of the original suite lives in server_snapshot_tests, but those tests rely on reference images stored in a private cloud that I can’t make public. Without those images the snapshot suite won’t run, so those files are included mostly for context rather than execution.

    I haven’t yet been able as well to run the macro test through SwiftPM in this public repository. The compiler plugin system, SwiftSyntax versioning, and cross-platform constraints (macOS host vs iOS runtime) have been tricky to reconcile. I’ve been experimenting with test targets, disabling prebuilts, platform constraints, and separating the UIKit-only runtime from the macro host, but I haven’t found a clean setup that works in a pure SPM environment.

    If you have a working configuration or a PR that solves any piece of this puzzle, I’m more than happy to take a look and merge it.

    Thanks again for taking the time to dig into this!

  3. mlch911 commented on Dec 1, 2025

    @mlch911
    ContributorAuthor

    Comment out QuickLayoutCore and QuickLayoutBridge in Package.swift, that's the only way I can

    Thanks a lot for taking a look at the tests and for putting in the effort to get them running!

    Just to give a bit of context from Meta’s side: internally we run all QuickLayout tests on every pull request, including snapshot tests, unit tests and macro tests. Unfortunately, when I open-sourced QuickLayout, I wasn’t able to make any of the test running in Package.swift.

    The bulk of the original suite lives in server_snapshot_tests, but those tests rely on reference images stored in a private cloud that I can’t make public. Without those images the snapshot suite won’t run, so those files are included mostly for context rather than execution.

    I haven’t yet been able as well to run the macro test through SwiftPM in this public repository. The compiler plugin system, SwiftSyntax versioning, and cross-platform constraints (macOS host vs iOS runtime) have been tricky to reconcile. I’ve been experimenting with test targets, disabling prebuilts, platform constraints, and separating the UIKit-only runtime from the macro host, but I haven’t found a clean setup that works in a pure SPM environment.

    If you have a working configuration or a PR that solves any piece of this puzzle, I’m more than happy to take a look and merge it.

    Thanks again for taking the time to dig into this!

    Done. #4

  4. added a commit that references this issue on Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions