ci(release test):hello check cpp & todo build

This commit is contained in:
luoliwoshang
2025-09-04 15:24:39 +08:00
parent e5c86fe936
commit 40b142f947
2 changed files with 25 additions and 7 deletions

View File

@@ -1,11 +1,11 @@
name: 'Test Hello World'
description: 'Test Hello World with specific Go and module versions'
name: "Test Hello World"
description: "Test Hello World with specific Go and module versions"
inputs:
go-version:
description: 'Go version being tested'
description: "Go version being tested"
required: true
mod-version:
description: 'Go module version to use'
description: "Go module version to use"
required: true
runs:
using: "composite"
@@ -24,12 +24,30 @@ runs:
import (
"fmt"
"github.com/goplus/lib/c"
"github.com/goplus/lib/cpp/std"
)
func main() {
fmt.Println("Hello, LLGo!")
println("Hello, LLGo!")
c.Printf(c.Str("Hello, LLGo!\n"))
c.Printf(std.Str("Hello LLGo by cpp/std.Str\n").CStr())
}
EOL
go mod tidy
llgo run .
EXPECTED="Hello, LLGo!
Hello, LLGo!
Hello, LLGo!
Hello LLGo by cpp/std.Str"
OUTPUT=$(llgo run . 2>&1)
if echo "$OUTPUT" | grep -qF "$EXPECTED"; then
echo "Basic test passed"
else
echo "Basic test failed"
echo "Expected to contain:"
echo "$EXPECTED"
echo "Got:"
echo "$OUTPUT"
exit 1
fi
#TODO(zzy): Test embed targets, need dispatch target dir