Comments (5)
How to run test for that issue:
go test -v -tags=integration -run=TestIntegrationScripts/tests/time.c
go test -v -run=TestCSTD
from c4go.
I was going to take a crack at this but it looks like the existing time tests fail which makes me skittish about adding anything.
=== RUN TestIntegrationScripts
=== RUN TestIntegrationScripts/tests/time.c
TAP: # Total tests: 0
--- FAIL: TestIntegrationScripts (0.64s)
--- FAIL: TestIntegrationScripts/tests/time.c (0.64s)
main_test.go:280:
Expect:
`1..19
# asctime
1 ok - asctime(timeinfo) == "Thu Jan 1 22:13:20 1970\n"
# ctime
2 ok - s != NULL
3 ok - s == "Fri Dec 31 HH:mm:58 1999\n"
# gmtime
4 ok - timeinfo->tm_sec == 20
5 ok - timeinfo->tm_min == 13
6 ok - timeinfo->tm_hour == 22
7 ok - timeinfo->tm_mday == 1
8 ok - timeinfo->tm_mon == 0
9 ok - timeinfo->tm_year == 70
10 ok - timeinfo->tm_wday == 4
11 ok - timeinfo->tm_yday == 0
12 ok - timeinfo->tm_isdst == 0
# mktime
13 ok - timeinfo.tm_wday == 6
14 ok - timeinfo.tm_year == 100
15 ok - timeinfo.tm_mon == 4
16 ok - timeinfo.tm_mday == 20
# time
17 ok - now != 0
18 ok - now != 0
19 ok - now == tloc
`
Actial:
`# command-line-arguments [command-line-arguments.test]
build/tests/time/main_test.go:211:21: undefined: __int8_t
`
Parts of code:
+========================+
File : ./build/tests/time/main_test.go
Line : 192 : // Warning (*ast.CStyleCastExpr): $GOPATH/src/github.com/Konstantin8105/c4go/tests/time.c:72 :argument position is 3. Cannot transpileToExpr. err = Cannot transpileImplicitCastExpr. err = Cannot transpileToExpr. err = Not acceptable nil node
Line : 193 : // Warning (*ast.CallExpr): $GOPATH/src/github.com/Konstantin8105/c4go/tests/time.c:72 :Cannot transpileToStmt : Cannot transpileToExpr. err = Error in transpileCallExpr : name of call function is noarch.Printf. argument position is 3. Cannot transpileToExpr. err = Cannot transpileImplicitCastExpr. err = Cannot transpileToExpr. err = Not acceptable nil node
Line : 194 : // Warning (*ast.ImplicitCastExpr): $GOPATH/src/github.com/Konstantin8105/c4go/tests/time.c:79 :argument position is 0. Cannot transpileToExpr. err = Cannot transpileImplicitCastExpr. err = Cannot transpileToExpr. err = Not acceptable nil node
Line : 195 : // Warning (*ast.BinaryOperator): $GOPATH/src/github.com/Konstantin8105/c4go/tests/time.c:79 :Cannot transpile BinaryOperator with type 'struct tm *' : result type = {unknown53}. Error: operator is `=`. cannot atomic for right part. Cannot transpileToExpr. err = Error in transpileCallExpr : name of call function is noarch.Gmtime. argument position is 0. Cannot transpileToExpr. err = Cannot transpileImplicitCastExpr. err = Cannot transpileToExpr. err = Not acceptable nil node
Line : 196 : // Warning (*ast.BinaryOperator): $GOPATH/src/github.com/Konstantin8105/c4go/tests/time.c:79 :Cannot transpileToStmt : Cannot transpileToExpr. err = Cannot transpile BinaryOperator with type 'struct tm *' : result type = {unknown53}. Error: operator is `=`. cannot atomic for right part. Cannot transpileToExpr. err = Error in transpileCallExpr : name of call function is noarch.Gmtime. argument position is 0. Cannot transpileToExpr. err = Cannot transpileImplicitCastExpr. err = Cannot transpileToExpr. err = Not acceptable nil node
Line : 197 :
Line : 198 : package main
Line : 199 :
Line : 200 : import "io/ioutil"
Line : 201 : import "testing"
Line : 202 : import "os"
Line : 203 : import "fmt"
Line : 204 : import "math"
Line : 205 : import "github.com/Konstantin8105/c4go/linux"
Line : 206 : import "github.com/Konstantin8105/c4go/noarch"
Line : 207 :
Line : 208 : type size_t uint32
Line : 209 : type va_list int64
Line : 210 : type __gnuc_va_list int64
Line : 211 *: type __int_least8_t __int8_t
Line : 212 : type __uint_least8_t __uint8_t
Line : 213 : type __int_least16_t __int16_t
Line : 214 : type __uint_least16_t uint16
Line : 215 : type __int_least32_t __int32_t
Line : 216 : type __uint_least32_t uint32
* 1 "1..19" "# command-line-arguments [command-line-arguments.test]"
* 2 "# asctime" "build/tests/time/main_test.go:211:21: undefined: __int8_t"
* 3 "1 ok - asctime(timeinfo) == \"Thu Jan 1 22:13:20 1970\\n\""""
* 4 "# ctime"
* 5 "2 ok - s != NULL"
* 6 "3 ok - s == \"Fri Dec 31 HH:mm:58 1999\\n\""
* 7 "# gmtime"
* 8 "4 ok - timeinfo->tm_sec == 20"
* 9 "5 ok - timeinfo->tm_min == 13"
* 10 "6 ok - timeinfo->tm_hour == 22"
* 11 "7 ok - timeinfo->tm_mday == 1"
* 12 "8 ok - timeinfo->tm_mon == 0"
* 13 "9 ok - timeinfo->tm_year == 70"
* 14 "10 ok - timeinfo->tm_wday == 4"
* 15 "11 ok - timeinfo->tm_yday == 0"
* 16 "12 ok - timeinfo->tm_isdst == 0"
* 17 "# mktime"
* 18 "13 ok - timeinfo.tm_wday == 6"
* 19 "14 ok - timeinfo.tm_year == 100"
* 20 "15 ok - timeinfo.tm_mon == 4"
* 21 "16 ok - timeinfo.tm_mday == 20"
* 22 "# time"
* 23 "17 ok - now != 0"
* 24 "18 ok - now != 0"
* 25 "19 ok - now == tloc"
* 26 ""
FAIL
exit status 1
FAIL github.com/Konstantin8105/c4go 0.644s
@Konstantin8105 do you know why the above errors might be occuring?
from c4go.
@IngCr3at1on , tests is ok by travis and my local laptop. Now, darwin(MacOS) is not supported. Could you clarify:
- OS
- golang version
- clang version
from c4go.
Sure; Arch Linux, go version go1.11 linux/amd64, clang version 7.0.0
from c4go.
It is look very nice.
Now, we use clang 6.0 for testing. May be is the problem.
Line 34 in 44a79fa
May be you have some specific implementation of glibc.
from c4go.
Related Issues (20)
- Panic limit
- Transpilation by make
- Transpilation example HOT 1
- C example
- COBOL or PL1 transpile HOT 3
- #define as constant
- AST
- Gettings thousands of lines of the following prefix with very simple files HOT 3
- AST Error : cannot parse line: `AvailabilityAttr HOT 2
- AST Error in trans-piling your program only --prime.c HOT 4
- AST error when transpiling mimalloc/src/bitmap.inc.c HOT 2
- AST error on Ubuntu 20.04 with Clang 10.0 HOT 2
- strange usage of switch won't be able to be transpiled to Go HOT 4
- reference to undefined identifier 'syscall.TIOCGPTN' (gollvm) HOT 2
- Merry Christmas HOT 2
- Bug HOT 1
- Minimaze string
- possible to transpiling C code to Go code HOT 1
- unknown node type: `TypeVisibilityAttr 0x2962acf3b20 <<invalid sloc>> Implicit Default`
- The 'raylib' under the 'tests' directory contains vulnerabilities
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c4go.