@gcov -o coverage oceani.mdc > /dev/null 2> /dev/null
@mv *.gcov coverage ; [ -f .gcov ] && mv .gcov coverage
- @ awk '/^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
+ @ awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
- if (ran < (ran + skip) *0.90) exit(1) }' \
+ if (ran < (ran + skip) *0.93) exit(1) }' \
coverage/oceani.mdc.gcov
@rm -f .tmp*
###### output: setvar
1.07374e+09 1
+Now some contants
+
+###### test list
+ oceani_tests += "consts"
+
+###### test: consts
+ const:
+ pi ::= 3.1415926
+ four ::= 2 + 2 ; five ::= 10/2
+ const pie ::= "I like Pie";
+ cake ::= "The cake is"
+ ++ " a lie"
+
+ program:
+ print "Hello World, what lovely oceans you have!"
+ print "are there", five, "?"
+ print pi, pie, "but", cake
+
+###### output: consts
+ Hello World, what lovely oceans you have!
+ are there 5 ?
+ 3.14159 I like Pie but The cake is a lie
+
## Conditions and Loops
Now we need to test if/else and some different loops
###### output: syn1
.tmp.code:3:11: error: unhandled parse error: then
+ oceani: no program found.
###### test: tokerr
program:
.tmp.code:3:14: info: this is where 'b' was set to label
oceani: type error in program - not running.
+###### test list
+ oceani_failing_tests += type_err_const type_err_const1
+
+###### test: type_err_const
+ const:
+ foo :: number = 45
+ bar ::= "string" + 56
+ const:
+ bar ::= "baz"
+ program:
+ foo := 4
+ print foo, bar
+
+###### output: type_err_const
+ .tmp.code:4:16: error: expected number found string
+ .tmp.code:6:8: error: name already declared: bar
+ .tmp.code:4:8: info: this is where 'bar' was first declared
+ .tmp.code:8:8: error: variable 'foo' redeclared
+ .tmp.code:3:8: info: this is where 'foo' was first declared
+
+###### test: type_err_const1
+ const:
+ foo : number = 45
+ bar := "string"
+ program:
+ foo := 4
+ print foo, bar
+
+###### output: type_err_const1
+ .tmp.code:3:12: error: unhandled parse error: :
+ oceani: no program found.
+
+
## Test erroneous command line args
To improve coverage, we want to test correct handling of strange command