Repository: Konstantin8105/c4go
Pull request #352 (2019-03-22 16:36:15)

change temp folder

codecov[bot]: # [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=h1) Report
> Merging [#352](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=desc) into [master](https://codecov.io/gh/Konstantin8105/c4go/commit/b849228ab41d83b23c7f95756a4167042be85624?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/Konstantin8105/c4go/pull/352/graphs/tree.svg?width=650&token=esH2rHXlZ2&height=150&src=pr)](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #352   +/-   ##
=======================================
  Coverage   86.45%   86.45%           
=======================================
  Files         186      186           
  Lines       10639    10639           
=======================================
  Hits         9198     9198           
  Misses       1027     1027           
  Partials      414      414
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=footer). Last update [b849228...adae2ee](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

codecov[bot]: # [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=h1) Report
> Merging [#352](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=desc) into [master](https://codecov.io/gh/Konstantin8105/c4go/commit/b849228ab41d83b23c7f95756a4167042be85624?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/Konstantin8105/c4go/pull/352/graphs/tree.svg?width=650&token=esH2rHXlZ2&height=150&src=pr)](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #352   +/-   ##
=======================================
  Coverage   86.45%   86.45%           
=======================================
  Files         186      186           
  Lines       10639    10639           
=======================================
  Hits         9198     9198           
  Misses       1027     1027           
  Partials      414      414
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=footer). Last update [b849228...adae2ee](https://codecov.io/gh/Konstantin8105/c4go/pull/352?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/main.go b/main.go
index bb5b097..172d6e0 100644
--- a/main.go
+++ b/main.go
@@ -190,6 +190,7 @@ func buildTree(nodes []treeNode, depth int) []ast.Node {
 			*ast.InlineCommandComment, *ast.ParagraphComment,
 			*ast.ParamCommandComment, *ast.TextComment,
 			*ast.VerbatimLineComment, *ast.VerbatimBlockComment,
+			*ast.AnnotateAttr,
 			*ast.VerbatimBlockLineComment:
 			continue
 
diff --git a/scripts/9wm.sh b/scripts/9wm.sh
index f06f426..c946c00 100755
--- a/scripts/9wm.sh
+++ b/scripts/9wm.sh
@@ -9,7 +9,7 @@ mkdir -p ./testdata/
 # prepare variables
 	export C4GO_DIR=$GOPATH/src/github.com/Konstantin8105/c4go
 	export C4GO=$C4GO_DIR/c4go
-	export TEMP_FOLDER="/tmp/9wm"
+	export TEMP_FOLDER="./testdata/9wm"
 
 # prepare C code
     if [ ! -d $TEMP_FOLDER ]; then
diff --git a/scripts/cis71.sh b/scripts/cis71.sh
index a96a9fc..c1d7fec 100755
--- a/scripts/cis71.sh
+++ b/scripts/cis71.sh
@@ -9,7 +9,7 @@ mkdir -p ./testdata/
 # prepare variables
 	export C4GO_DIR=$GOPATH/src/github.com/Konstantin8105/c4go
 	export C4GO=$C4GO_DIR/c4go
-	export TEMP_FOLDER="/tmp/CIS71"
+	export TEMP_FOLDER="./testdata/CIS71"
 
 # prepare C code
     if [ ! -d $TEMP_FOLDER ]; then
diff --git a/scripts/code_quality.sh b/scripts/code_quality.sh
index f5899fa..dce3b7a 100755
--- a/scripts/code_quality.sh
+++ b/scripts/code_quality.sh
@@ -37,8 +37,8 @@ eval "$CLANG_FORMAT -version"
 C_TEST_FILES=`ls ./tests/*.c ./tests/code_quality/*.c ./examples/*.c`
 for C_FILE in $C_TEST_FILES
 do
-	eval "$CLANG_FORMAT -style=WebKit $C_FILE > /tmp/out"
-	if [ -n "$(diff $C_FILE /tmp/out)" ]; then
+	eval "$CLANG_FORMAT -style=WebKit $C_FILE > ./testdata/out"
+	if [ -n "$(diff $C_FILE ./testdata/out)" ]; then
     	echo "C test code '$C_FILE' is not properly formatted. Use '$CLANG_FORMAT -style=WebKit'."
 	fi
 done
diff --git a/scripts/ed.sh b/scripts/ed.sh
index 0a43308..ac46f61 100755
--- a/scripts/ed.sh
+++ b/scripts/ed.sh
@@ -9,7 +9,7 @@ mkdir -p ./testdata/
 # prepare variables
 	export C4GO_DIR=$GOPATH/src/github.com/Konstantin8105/c4go
 	export C4GO=$C4GO_DIR/c4go
-	export TEMP_FOLDER="/tmp/ed"
+	export TEMP_FOLDER="./testdata/ed"
 	export VERSION="ed-1.15"
 
 # prepare C code
diff --git a/scripts/neateqn.sh b/scripts/neateqn.sh
index 5d52404..6a9a52d 100755
--- a/scripts/neateqn.sh
+++ b/scripts/neateqn.sh
@@ -11,7 +11,7 @@ mkdir -p ./testdata/
 	export C4GO=$C4GO_DIR/c4go
 	export GIT_SOURCE="https://github.com/aligrudi/neateqn.git"
 	export NAME="neateqn"
-	export TEMP_FOLDER="/tmp/$NAME"
+	export TEMP_FOLDER="./testdata/$NAME"
 	export GO_FILE="$TEMP_FOLDER/$NAME.go"
 	export GO_APP="$TEMP_FOLDER/$NAME.app"
 
@@ -19,7 +19,7 @@ mkdir -p ./testdata/
     if [ ! -d $TEMP_FOLDER ]; then
 		mkdir -p $TEMP_FOLDER
 		git clone $GIT_SOURCE $TEMP_FOLDER
-		sed -i.bak -e '215,233d' /tmp/neateqn/eqn.c
+		sed -i.bak -e '215,233d' $TEMP_FOLDER/eqn.c
 	fi
 
 # remove go files from last transpilation
diff --git a/scripts/neatmkfn.sh b/scripts/neatmkfn.sh
index ba95716..0f5482c 100755
--- a/scripts/neatmkfn.sh
+++ b/scripts/neatmkfn.sh
@@ -11,7 +11,7 @@ mkdir -p ./testdata/
 	export C4GO=$C4GO_DIR/c4go
 	export GIT_SOURCE="https://github.com/aligrudi/neatmkfn.git"
 	export NAME="neatmkfn"
-	export TEMP_FOLDER="/tmp/$NAME"
+	export TEMP_FOLDER="./testdata/$NAME"
 	export GO_FILE="$TEMP_FOLDER/$NAME.go"
 	export GO_APP="$TEMP_FOLDER/$NAME.app"
 
diff --git a/scripts/neatpost.sh b/scripts/neatpost.sh
index ecd6e8e..1189cdc 100755
--- a/scripts/neatpost.sh
+++ b/scripts/neatpost.sh
@@ -11,7 +11,7 @@ mkdir -p ./testdata/
 	export C4GO=$C4GO_DIR/c4go
 	export GIT_SOURCE="https://github.com/aligrudi/neatpost.git"
 	export NAME="neatpost"
-	export TEMP_FOLDER="/tmp/$NAME"
+	export TEMP_FOLDER="./testdata/$NAME"
 	export GO_FILE="$TEMP_FOLDER/$NAME.go"
 	export GO_APP="$TEMP_FOLDER/$NAME.app"
 
diff --git a/scripts/neatrefer.sh b/scripts/neatrefer.sh
index eed2be5..891c784 100755
--- a/scripts/neatrefer.sh
+++ b/scripts/neatrefer.sh
@@ -11,7 +11,7 @@ mkdir -p ./testdata/
 	export C4GO=$C4GO_DIR/c4go
 	export GIT_SOURCE="https://github.com/aligrudi/neatrefer.git"
 	export NAME="neatrefer"
-	export TEMP_FOLDER="/tmp/$NAME"
+	export TEMP_FOLDER="./testdata/$NAME"
 	export GO_FILE="$TEMP_FOLDER/$NAME.go"
 	export GO_APP="$TEMP_FOLDER/$NAME.app"
 
diff --git a/scripts/neatroff.sh b/scripts/neatroff.sh
index 8f2d25c..727353c 100755
--- a/scripts/neatroff.sh
+++ b/scripts/neatroff.sh
@@ -11,7 +11,7 @@ mkdir -p ./testdata/
 	export C4GO=$C4GO_DIR/c4go
 	export GIT_SOURCE="https://github.com/aligrudi/neatroff.git"
 	export NAME="neatroff"
-	export TEMP_FOLDER="/tmp/$NAME"
+	export TEMP_FOLDER="./testdata/$NAME"
 	export GO_FILE="$TEMP_FOLDER/$NAME.go"
 	export GO_APP="$TEMP_FOLDER/$NAME.app"
 
diff --git a/scripts/neatvi.sh b/scripts/neatvi.sh
index 8804548..23e64c5 100755
--- a/scripts/neatvi.sh
+++ b/scripts/neatvi.sh
@@ -11,7 +11,7 @@ mkdir -p ./testdata/
 	export C4GO=$C4GO_DIR/c4go
 	export GIT_SOURCE="https://github.com/aligrudi/neatvi.git"
 	export NAME="neatvi"
-	export TEMP_FOLDER="/tmp/$NAME"
+	export TEMP_FOLDER="./testdata/$NAME"
 	export GO_FILE="$TEMP_FOLDER/$NAME.go"
 	export GO_APP="$TEMP_FOLDER/$NAME.app"
 
diff --git a/scripts/scripts.txt b/scripts/scripts.txt
index 4203ff5..386b511 100644
--- a/scripts/scripts.txt
+++ b/scripts/scripts.txt
@@ -1,42 +1,42 @@
 
-Calculate warnings : /tmp/9wm
+Calculate warnings : ./testdata/9wm
 		After transpiling : 5 warnings.
 		Go build : 12 warnings
 		Unsafe   : 371
 
-Calculate warnings : /tmp/ed
+Calculate warnings : ./testdata/ed
 		After transpiling : 4 warnings.
 		Go build : 2 warnings
 		Unsafe   : 156
 
-Calculate warnings in file: /tmp/neateqn/neateqn.go
+Calculate warnings in file: ./testdata/neateqn/neateqn.go
 		After transpiling : 3 warnings.
 		Go build : 12 warnings
 		Unsafe   : 14
 
-Calculate warnings in file: /tmp/neatmkfn/neatmkfn.go
+Calculate warnings in file: ./testdata/neatmkfn/neatmkfn.go
 		After transpiling : 557 warnings.
 		Go build : 86 warnings
 		Unsafe   : 16
 
-Calculate warnings in file: /tmp/neatpost/neatpost.go
+Calculate warnings in file: ./testdata/neatpost/neatpost.go
 		After transpiling : 2 warnings.
 		Go build : 63 warnings
 		Unsafe   : 27
 
-Calculate warnings in file: /tmp/neatrefer/neatrefer.go
+Calculate warnings in file: ./testdata/neatrefer/neatrefer.go
 		After transpiling : 2 warnings.
 		Go build : 3 warnings
 		Unsafe   : 11
 
-Calculate warnings in file: /tmp/neatroff/neatroff.go
+Calculate warnings in file: ./testdata/neatroff/neatroff.go
 		After transpiling : 4 warnings.
 		Go build : 52 warnings
 		Unsafe   : 168
 
-Calculate warnings in file: /tmp/neatvi/neatvi.go
+Calculate warnings in file: ./testdata/neatvi/neatvi.go
 		After transpiling : 36 warnings.
-		Go build : 7 warnings
+		Go build : 3 warnings
 		Unsafe   : 76
 
 Calculate warnings in file: testdata/vorbis/vorbis.go
diff --git a/scripts/sqlite.sh b/scripts/sqlite.sh
index 6e0c520..2ab80f6 100755
--- a/scripts/sqlite.sh
+++ b/scripts/sqlite.sh
@@ -16,7 +16,7 @@ export C4GO=$C4GO_DIR/c4go
 export SQLITE3_FILE=sqlite-amalgamation-3250200
 
 # Variable for location of temp sqlite files
-SQLITE_TEMP_FOLDER="/tmp/SQLITE"
+SQLITE_TEMP_FOLDER="./testdata/SQLITE"
 mkdir -p $SQLITE_TEMP_FOLDER
 
 # Download/unpack SQLite if required.


Test patch:
diff --git a/scripts/test.sh b/scripts/test.sh
index ddcaef8..f4df0ec 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -44,9 +44,9 @@ export C4GO_DIR=$GOPATH/src/github.com/Konstantin8105/c4go
 export C4GO=$C4GO_DIR/c4go
 
 echo "Run: c4go transpile prime.c"
-$C4GO transpile -o=/tmp/prime.go $C4GO_DIR/examples/prime.c
-echo "47" | go run /tmp/prime.go
-if [ $(cat /tmp/prime.go | wc -l) -eq 0 ]; then exit 1; fi
+$C4GO transpile -o=./testdata/prime.go $C4GO_DIR/examples/prime.c
+echo "47" | go run ./testdata/prime.go
+if [ $(cat ./testdata/prime.go | wc -l) -eq 0 ]; then exit 1; fi
 if [ $($C4GO ast $C4GO_DIR/examples/prime.c | wc -l) -eq 0 ]; then exit 1; fi
 
 echo "----------------------"
diff --git a/tests/stdio.c b/tests/stdio.c
index 88cb004..d9f493b 100644
--- a/tests/stdio.c
+++ b/tests/stdio.c
@@ -100,7 +100,7 @@ void test_rename()
 void test_fopen()
 {
     FILE* pFile;
-    pFile = fopen("/tmp/myfile.txt", "w");
+    pFile = fopen("./testdata/myfile.txt", "w");
     if (pFile != NULL) {
         is_not_null(pFile);
         fclose(pFile);
@@ -140,20 +140,20 @@ void test_tmpnam()
 
 void test_fclose()
 {
-    remove("/tmp/myfile.txt");
+    remove("./testdata/myfile.txt");
     FILE* pFile;
-    pFile = fopen("/tmp/myfile.txt", "w");
+    pFile = fopen("./testdata/myfile.txt", "w");
     fputs("fclose example", pFile);
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/myfile.txt"), 0)
+    is_eq(remove("./testdata/myfile.txt"), 0)
 }
 
 void test_fflush()
 {
     char mybuffer[80];
     FILE* pFile;
-    pFile = fopen("/tmp/example.txt", "w+");
+    pFile = fopen("./testdata/example.txt", "w+");
     is_not_null(pFile) or_return();
 
     fputs("test", pFile);
@@ -161,17 +161,17 @@ void test_fflush()
     fgets(mybuffer, 80, pFile);
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/example.txt"), 0)
+    is_eq(remove("./testdata/example.txt"), 0)
 }
 
 void test_fprintf()
 {
-    remove("/tmp/myfile1.txt");
+    remove("./testdata/myfile1.txt");
     FILE* pFile;
     int n;
     char* name = "John Smith";
 
-    pFile = fopen("/tmp/myfile1.txt", "w");
+    pFile = fopen("./testdata/myfile1.txt", "w");
     is_not_null(pFile);
 
     for (n = 0; n < 3; n++) {
@@ -180,12 +180,12 @@ void test_fprintf()
 
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/myfile1.txt"), 0)
+    is_eq(remove("./testdata/myfile1.txt"), 0)
 }
 
 void test_fscanf()
 {
-    remove("/tmp/myfile2.txt");
+    remove("./testdata/myfile2.txt");
 
     char str[80];
     char end[80];
@@ -193,7 +193,7 @@ void test_fscanf()
     int i;
     FILE* pFile;
 
-    pFile = fopen("/tmp/myfile2.txt", "w+");
+    pFile = fopen("./testdata/myfile2.txt", "w+");
     is_not_null(pFile);
 
     fprintf(pFile, "%f \r\n %s %d %s", 3.1416, "PI", 42, "end");
@@ -212,7 +212,7 @@ void test_fscanf()
 
     // read again
     FILE* pFile2;
-    pFile2 = fopen("/tmp/myfile2.txt", "r");
+    pFile2 = fopen("./testdata/myfile2.txt", "r");
     is_not_null(pFile2);
 
     fscanf(pFile2, "%f", &f);
@@ -228,7 +228,7 @@ void test_fscanf()
     is_streq(end, "end");
 
     // remove temp file
-    is_eq(remove("/tmp/myfile2.txt"), 0)
+    is_eq(remove("./testdata/myfile2.txt"), 0)
 }
 
 void test_fgetc()
@@ -279,11 +279,11 @@ void test_fputs()
     FILE* pFile;
     char* sentence = "Hello, World";
 
-    pFile = fopen("/tmp/mylog.txt", "w");
+    pFile = fopen("./testdata/mylog.txt", "w");
     fputs(sentence, pFile);
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/mylog.txt"), 0)
+    is_eq(remove("./testdata/mylog.txt"), 0)
 }
 
 void test_getc()
@@ -309,25 +309,25 @@ void test_putc()
     FILE* pFile;
     char c;
 
-    pFile = fopen("/tmp/whatever.txt", "w");
+    pFile = fopen("./testdata/whatever.txt", "w");
     for (c = 'A'; c <= 'Z'; c++) {
         putc(c, pFile);
     }
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/whatever.txt"), 0)
+    is_eq(remove("./testdata/whatever.txt"), 0)
 }
 
 void test_fseek()
 {
     FILE* pFile;
-    pFile = fopen("/tmp/example.txt", "w");
+    pFile = fopen("./testdata/example.txt", "w");
     fputs("This is an apple.", pFile);
     fseek(pFile, 9, SEEK_SET);
     fputs(" sam", pFile);
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/example.txt"), 0)
+    is_eq(remove("./testdata/example.txt"), 0)
 }
 
 void test_ftell()
@@ -378,11 +378,11 @@ void test_fread()
 void test_fwrite()
 {
     FILE* pFile;
-    pFile = fopen("/tmp/myfile.bin", "w");
+    pFile = fopen("./testdata/myfile.bin", "w");
     fwrite("xyz", 1, 3, pFile);
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/myfile.bin"), 0)
+    is_eq(remove("./testdata/myfile.bin"), 0)
 }
 
 void test_fgetpos()
@@ -413,14 +413,14 @@ void test_fsetpos()
     FILE* pFile;
     fpos_t position;
 
-    pFile = fopen("/tmp/myfile.txt", "w");
+    pFile = fopen("./testdata/myfile.txt", "w");
     fgetpos(pFile, &position);
     fputs("That is a sample", pFile);
     fsetpos(pFile, &position);
     fputs("This", pFile);
     fclose(pFile);
     // remove temp file
-    is_eq(remove("/tmp/myfile.txt"), 0)
+    is_eq(remove("./testdata/myfile.txt"), 0)
 }
 
 void test_rewind()
@@ -429,7 +429,7 @@ void test_rewind()
     FILE* pFile;
     char buffer[27];
 
-    pFile = fopen("/tmp/myfile.txt", "w+");
+    pFile = fopen("./testdata/myfile.txt", "w+");
     for (n = 'A'; n <= 'Z'; n++)
         fputc(n, pFile);
     rewind(pFile);
@@ -440,7 +440,7 @@ void test_rewind()
     is_eq(strlen(buffer), 26);
 
     // remove temp file
-    is_eq(remove("/tmp/myfile.txt"), 0)
+    is_eq(remove("./testdata/myfile.txt"), 0)
 }
 
 void test_feof()