test(cl): when expect.txt is ';', skip diff only, not execution

Open Beginner friendly
#1,742 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
testing-qa

Research direction

Start in cl/cltest/cltest.go at testRunFrom and inspect how RunAndCaptureWithConf and expect.txt comparison are handled. Run go test ./cl, reproduce the cl/_testgo/cgobasic case if needed, and add a regression test showing that ; executes the case while skipping only textual output comparison.

Written by the indexing model from the issue text.

Description

Background

In cl runtime tests, many cases use a single ; in expect.txt. In practice this is often used for outputs that are not stable for textual golden comparison (for example, address-like values or environment-dependent formatting).

However, the current implementation treats this marker as skip the whole run, so tests appear green while the case is never executed.

Current Behavior

In cl/cltest/cltest.go (testRunFrom):

if bytes.Equal(expected, []byte{';'}) { // expected == ";" means skipping expect.txt
    return
}

This returns before RunAndCaptureWithConf(...).

Why This Is a Problem

expect.txt == ";" effectively means “do not run”, not just “do not diff output”.

Consequences:

  • build/runtime regressions can be hidden in go test ./cl;
  • false confidence: CI reports pass while manual llgo run fails for the same case.
Expected Behavior

For expect.txt == ";":

  • still execute RunAndCaptureWithConf(...) (at least validate build/run success);
  • skip only output vs expect.txt textual diff.

If we still need “skip execution entirely”, introduce a separate explicit marker.

Reproduction Example
cd cl/_testgo/cgobasic
llgo run -target esp32c3-basic -emulator .

This fails with build/SSA errors, while the current go test ./cl path may not execute this case when expect.txt == ";".


If helpful, I can follow up with a PR that changes ; to run-only/no-diff semantics and adds a regression test.

Dominant language
LLVM
Stars
758
Forks
49
Avg merge
1d 6h
Merged PRs (30d)
137

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xgo-dev/llgo

All issues in xgo-dev/llgo

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.