remove comments
All checks were successful
build-dsl-smoke / Build judge (push) Successful in 12s
build-dsl-smoke / debug / clang / linux (push) Successful in 7s
build-dsl-smoke / debug / gcc / linux (push) Successful in 6s
build-dsl-smoke / release / clang / linux (push) Successful in 6s
build-dsl-smoke / release / gcc / linux (push) Successful in 7s
build-dsl-smoke / sanitized / clang / linux (push) Successful in 6s
build-dsl-smoke / sanitized / gcc / linux (push) Successful in 7s
build-dsl-smoke / debug / clang / windows (push) Successful in 14s
build-dsl-smoke / debug-valgrind / gcc / linux (push) Successful in 15s
build-dsl-smoke / release / clang / windows (push) Successful in 15s
build-dsl-smoke / debug / msvc / windows (push) Successful in 17s
build-dsl-smoke / release / msvc / windows (push) Successful in 16s
build-dsl-smoke / SUMMARY (push) Successful in 4s
All checks were successful
build-dsl-smoke / Build judge (push) Successful in 12s
build-dsl-smoke / debug / clang / linux (push) Successful in 7s
build-dsl-smoke / debug / gcc / linux (push) Successful in 6s
build-dsl-smoke / release / clang / linux (push) Successful in 6s
build-dsl-smoke / release / gcc / linux (push) Successful in 7s
build-dsl-smoke / sanitized / clang / linux (push) Successful in 6s
build-dsl-smoke / sanitized / gcc / linux (push) Successful in 7s
build-dsl-smoke / debug / clang / windows (push) Successful in 14s
build-dsl-smoke / debug-valgrind / gcc / linux (push) Successful in 15s
build-dsl-smoke / release / clang / windows (push) Successful in 15s
build-dsl-smoke / debug / msvc / windows (push) Successful in 17s
build-dsl-smoke / release / msvc / windows (push) Successful in 16s
build-dsl-smoke / SUMMARY (push) Successful in 4s
This commit is contained in:
@@ -76,9 +76,6 @@ func (r *Runner) Run() *SuiteResult {
|
||||
return result
|
||||
}
|
||||
|
||||
// runLegacyBuild handles the classic `build "shell-string"` form. It produces
|
||||
// a single BuildRun named "default" so that downstream consumers always see
|
||||
// the same shape.
|
||||
func (r *Runner) runLegacyBuild() *BuildRun {
|
||||
run := &BuildRun{Name: "default"}
|
||||
|
||||
@@ -100,9 +97,6 @@ func (r *Runner) runLegacyBuild() *BuildRun {
|
||||
return run
|
||||
}
|
||||
|
||||
// runStructuredBuilds handles the new DSL form with one or more named builds.
|
||||
// Each build is resolved against the current OS and toolchain, compiled via
|
||||
// the structured translator, and then exercised against every group.
|
||||
func (r *Runner) resolveRuntimeToolchain() (Toolchain, string) {
|
||||
goos := runtime.GOOS
|
||||
wanted := os.Getenv("JUDGE_TOOLCHAIN")
|
||||
@@ -125,9 +119,6 @@ func (r *Runner) runStructuredBuilds() []*BuildRun {
|
||||
run := &BuildRun{Name: b.Name, Toolchain: tc.Name}
|
||||
|
||||
if r.cfg.TargetBuild != "" && r.cfg.TargetBuild != b.Name {
|
||||
// User asked for a different build. Don't include this one
|
||||
// in the result at all — discovery via --list-builds is the
|
||||
// caller's responsibility.
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -164,8 +155,6 @@ func (r *Runner) runStructuredBuilds() []*BuildRun {
|
||||
return runs
|
||||
}
|
||||
|
||||
// runGroups exercises every group/test in the suite against the currently
|
||||
// selected binary (r.binary) and records the outcome into run.
|
||||
func (r *Runner) runGroups(run *BuildRun) {
|
||||
for _, g := range r.file.Groups {
|
||||
gr := r.runGroup(g)
|
||||
@@ -174,9 +163,6 @@ func (r *Runner) runGroups(run *BuildRun) {
|
||||
}
|
||||
}
|
||||
|
||||
// fillBuildError populates a BuildRun with one failing synthetic test per
|
||||
// group when the build itself failed. This keeps the reported totals at 0
|
||||
// and matches the legacy behaviour.
|
||||
func (r *Runner) fillBuildError(run *BuildRun) {
|
||||
run.Groups = r.synthesizeBuildError()
|
||||
}
|
||||
@@ -205,8 +191,6 @@ func (r *Runner) synthesizeBuildError() []*GroupResult {
|
||||
return out
|
||||
}
|
||||
|
||||
// legacyBuild runs the free-form shell build command. Kept under the old
|
||||
// name so reviewers can diff against the previous implementation easily.
|
||||
func (r *Runner) legacyBuild() (string, error) {
|
||||
buildCmd := r.buildCommand()
|
||||
|
||||
@@ -241,11 +225,7 @@ func (r *Runner) legacyBuild() (string, error) {
|
||||
return out.String(), nil
|
||||
}
|
||||
|
||||
// compileStructured compiles one structured build via the translator and
|
||||
// returns the build log plus the absolute path to the produced binary.
|
||||
// The compiler is invoked via exec.Command directly — no shell involved.
|
||||
func (r *Runner) compileStructured(name string, cfg dsl.BuildConfig, tc Toolchain) (string, string, error) {
|
||||
// Expand source globs against the work dir.
|
||||
sources, err := expandSources(r.cfg.WorkDir, cfg.Sources)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
@@ -255,7 +235,6 @@ func (r *Runner) compileStructured(name string, cfg dsl.BuildConfig, tc Toolchai
|
||||
}
|
||||
cfg.Sources = sources
|
||||
|
||||
// Decide output path: <workdir>/build/<name>/<output>[.exe].
|
||||
outputName := cfg.Output
|
||||
if outputName == "" {
|
||||
outputName = "solution"
|
||||
@@ -298,9 +277,6 @@ func (r *Runner) compileStructured(name string, cfg dsl.BuildConfig, tc Toolchai
|
||||
return logPrefix + out.String(), outputPath, nil
|
||||
}
|
||||
|
||||
// expandSources expands each glob in patterns against workDir and returns
|
||||
// a slice of paths relative to workDir. Globs that match no files cause an
|
||||
// error — silent zero matches are almost always a typo.
|
||||
func expandSources(workDir string, patterns []string) ([]string, error) {
|
||||
var out []string
|
||||
seen := map[string]bool{}
|
||||
@@ -310,7 +286,6 @@ func expandSources(workDir string, patterns []string) ([]string, error) {
|
||||
return nil, fmt.Errorf("glob %q: %w", pat, err)
|
||||
}
|
||||
if len(matches) == 0 {
|
||||
// Fall back to treating it as a literal path.
|
||||
if _, statErr := os.Stat(filepath.Join(workDir, pat)); statErr == nil {
|
||||
matches = []string{filepath.Join(workDir, pat)}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user