1
.github/workflows/llgo.yml
vendored
1
.github/workflows/llgo.yml
vendored
@@ -165,6 +165,7 @@ jobs:
|
||||
|
||||
- name: run llgo test
|
||||
run: |
|
||||
llgo test ./...
|
||||
cd _demo
|
||||
llgo test -v ./runtest
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
/*
|
||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
/*
|
||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
/*
|
||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
/*
|
||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -175,6 +175,14 @@ func Do(args []string, conf *Config) ([]Package, error) {
|
||||
}
|
||||
case ModeRun:
|
||||
return nil, fmt.Errorf("cannot run multiple packages")
|
||||
case ModeTest:
|
||||
newInitial := make([]*packages.Package, 0, len(initial))
|
||||
for _, pkg := range initial {
|
||||
if needLink(pkg, mode) {
|
||||
newInitial = append(newInitial, pkg)
|
||||
}
|
||||
}
|
||||
initial = newInitial
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
package build
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
package buildtags
|
||||
|
||||
import (
|
||||
|
||||
3
compiler/internal/env/env_test.go
vendored
3
compiler/internal/env/env_test.go
vendored
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
package env
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
/*
|
||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||
*
|
||||
|
||||
@@ -387,14 +387,13 @@ func (p Program) NewPackage(name, pkgPath string) Package {
|
||||
pyobjs := make(map[string]PyObjRef)
|
||||
pymods := make(map[string]Global)
|
||||
strs := make(map[string]llvm.Value)
|
||||
goStrs := make(map[string]llvm.Value)
|
||||
chkabi := make(map[types.Type]bool)
|
||||
glbDbgVars := make(map[Expr]bool)
|
||||
// Don't need reset p.needPyInit here
|
||||
// p.needPyInit = false
|
||||
ret := &aPackage{
|
||||
mod: mod, vars: gbls, fns: fns, stubs: stubs,
|
||||
pyobjs: pyobjs, pymods: pymods, strs: strs, goStrs: goStrs,
|
||||
pyobjs: pyobjs, pymods: pymods, strs: strs,
|
||||
chkabi: chkabi, Prog: p,
|
||||
di: nil, cu: nil, glbDbgVars: glbDbgVars,
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
/*
|
||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
package ssatest
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
package abi
|
||||
|
||||
import (
|
||||
|
||||
21
test/c_test.go
Normal file
21
test/c_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
//go:build llgo
|
||||
// +build llgo
|
||||
|
||||
package test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/goplus/llgo/c"
|
||||
)
|
||||
|
||||
// Can't put it in c/ package because it is marked as 'decl'
|
||||
func TestCstr(t *testing.T) {
|
||||
cstr := c.Str("foo")
|
||||
if cstr == nil {
|
||||
t.Fatal("cstr() returned nil")
|
||||
}
|
||||
if c.Strlen(cstr) != 3 {
|
||||
t.Fatal("cstr() returned invalid length")
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !llgo
|
||||
// +build !llgo
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022 The GoPlus Authors (goplus.org). All rights reserved.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user