Skip to content

Commit

Permalink
Merge pull request #197 from luoliwoshang/gogensig/testlib
Browse files Browse the repository at this point in the history
chore:gogensig test with link file
  • Loading branch information
tsingbx authored Mar 5, 2025
2 parents 63ba9e2 + d7dde62 commit be483a3
Show file tree
Hide file tree
Showing 27 changed files with 83 additions and 5 deletions.
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/_depcjson/conf/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "depcjson",
"include": ["temp.h"],
"cflags" :"$(pkg-config --cflags libcjson)",
"libs": "$(pkg-config --libs libcjson)",
"cplusplus":false,
"deps": [
"github.com/goplus/llcppg/cmd/gogensig/convert/testdata/cjson",
Expand Down
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/_depcjson/gogensig.expect
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import (

type X_depcjsonType c.Int

===== _depcjson_autogen_link.go =====
package _depcjson

const LLGoPackage string = "link: $(pkg-config --libs libcjson);"

===== temp.go =====
package _depcjson

Expand Down
3 changes: 2 additions & 1 deletion cmd/gogensig/convert/_testdata/_systopkg/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "avoidkeyword",
"name": "systopkg",
"include": ["temp.h"],
"cplusplus":false,
"libs": "$(pkg-config --libs xxx)",
"deps":["c","c/time"]
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/_systopkg/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== _systopkg_autogen_link.go =====
package _systopkg

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package _systopkg

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "avoidkeyword",
"include": ["temp.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/avoidkeyword/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== avoidkeyword_autogen_link.go =====
package avoidkeyword

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package avoidkeyword

Expand Down
3 changes: 2 additions & 1 deletion cmd/gogensig/convert/_testdata/cjson/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "libcjson",
"name": "cjson",
"include": [
"cJSON.h",
"cJSON_Utils.h"
],
"trimPrefixes": ["cJSON_", "cJSONUtils_","CJSON_"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus": false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/cjson/gogensig.expect
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ func (recv_ *JSON) SortObject() {
func (recv_ *JSON) SortObjectCaseSensitive() {
}

===== cjson_autogen_link.go =====
package cjson

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== llcppg.pub =====
cJSON JSON
cJSON_Hooks Hooks
Expand Down
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/enum/conf/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"name": "enum",
"include": ["temp.h"],
"cplusplus":false,
"libs": "$(pkg-config --libs xxx)",
"trimPrefixes": ["gpg_err_","GPG_ERR_"]
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/enum/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== enum_autogen_link.go =====
package enum

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package enum

Expand Down
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/forwarddecl/conf/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"name": "forwarddecl",
"include": ["temp.h", "impl.h"],
"trimPrefixes": ["sqlite3_","lua_","LUA_"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/forwarddecl/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== forwarddecl_autogen_link.go =====
package forwarddecl

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== impl.go =====
package forwarddecl

Expand Down
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/funcrefer/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "funcrefer",
"include": ["temp.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/funcrefer/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== funcrefer_autogen_link.go =====
package funcrefer

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package funcrefer

Expand Down
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/keepcomment/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "comment",
"include": ["temp.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/keepcomment/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== keepcomment_autogen_link.go =====
package keepcomment

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package keepcomment

Expand Down
3 changes: 2 additions & 1 deletion cmd/gogensig/convert/_testdata/nested/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "pubfile",
"name": "nested",
"include": ["temp.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/nested/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== nested_autogen_link.go =====
package nested

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package nested

Expand Down
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/pubfile/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "pubfile",
"include": ["temp.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/pubfile/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== pubfile_autogen_link.go =====
package pubfile

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package pubfile

Expand Down
3 changes: 2 additions & 1 deletion cmd/gogensig/convert/_testdata/receiver/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "comment",
"name": "reveiver",
"include": ["temp.h","use.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/receiver/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== receiver_autogen_link.go =====
package receiver

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package receiver

Expand Down
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/selfref/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "selfref",
"include": ["temp.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/selfref/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== selfref_autogen_link.go =====
package selfref

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package selfref

Expand Down
1 change: 1 addition & 0 deletions cmd/gogensig/convert/_testdata/stdtype/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "stdtype",
"include": ["temp.h"],
"libs": "$(pkg-config --libs xxx)",
"cplusplus":false
}
5 changes: 5 additions & 0 deletions cmd/gogensig/convert/_testdata/stdtype/gogensig.expect
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
===== stdtype_autogen_link.go =====
package stdtype

const LLGoPackage string = "link: $(pkg-config --libs xxx);"

===== temp.go =====
package stdtype

Expand Down
2 changes: 1 addition & 1 deletion cmd/gogensig/convert/_testdata/union/conf/llcppg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "enum",
"name": "union",
"include": ["temp.h"],
"cplusplus":false
}

0 comments on commit be483a3

Please sign in to comment.