Re: [Vala] testrunner.sh on OpenIndiana

2017-11-01 Thread Jason Martin
All but three pass now. My patch below. Comments might help someone.

/control-flow/bug736774-2
ERROR:/export/home/agrellum/vala-0.36.6/tests/_test/main.c:111:control_flow_bug736774_2_main:
assertion failed: (keep != "test")
control_flow.bug736774_2.check: line 2: 17168 Abort   (core
dumped) ./test /control-flow/bug736774-2

/dbus/enum-string-marshalling
main.vala:17.42-17.57: error: The type name `UnixOutputStream' could not be
found
public abstract void test3 (FooEnum e1, UnixOutputStream output_stream,
FooEnum e2) throws DBusError;

Loaded package
`/export/home/agrellum/vala-0.36.6/tests/./../vapi/glib-2.0.vapi'
Loaded package
`/export/home/agrellum/vala-0.36.6/tests/./../vapi/gobject-2.0.vapi'
Loaded package
`/export/home/agrellum/vala-0.36.6/tests/./../vapi/gio-2.0.vapi'

/dbus/filedescriptor-errors/server
Conversion from character set '646' to 'UTF-8' is not supported

Patch:

--- /export/home/agrellum/vala-0.36.6/tests/testrunner.sh.orig
+++ /export/home/agrellum/vala-0.36.6/tests/testrunner.sh
@@ -29,7 +29,12 @@
 export G_DEBUG=fatal_warnings

 VALAC=$topbuilddir/compiler/valac$EXEEXT
-VALAFLAGS="$VALAFLAGS --vapidir $vapidir --disable-warnings --main main
--save-temps -X -g -X -O0 -X -pipe -X -lm -X -DGETTEXT_PACKAGE=\"valac\" -X
-Werror=return-type -X -Werror=init-self -X -Werror=implicit -X
-Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X
-Werror=pointer-arith -X -Werror=int-to-pointer-cast -X
-Werror=pointer-to-int-cast -X -Wformat -X -Werror=format-security -X
-Werror=format-nonliteral -X -Werror=redundant-decls -X
-Werror=int-conversion"
+#VALAFLAGS="$VALAFLAGS --vapidir $vapidir --disable-warnings --main main
--save-temps -X -g -X -O0 -X -pipe -X -lm -X -DGETTEXT_PACKAGE=\"valac\" -X
-Werror=return-type -X -Werror=init-self -X -Werror=implicit -X
-Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X
-Werror=pointer-arith -X -Werror=int-to-pointer-cast -X
-Werror=pointer-to-int-cast -X -Wformat -X -Werror=format-security -X
-Werror=format-nonliteral -X -Werror=redundant-decls -X
-Werror=int-conversion"
+# OpenIndiana add -v flag for extra logging
+# Hardcoded --cc flag for now; Use ./configure CC=gcc when building vala
+# System can have many CC's and gcc may not be default
+# Remove -X -Werror=int-conversion; Not an option with gcc (GCC) 4.9.4
OpenIndiana build
+VALAFLAGS="$VALAFLAGS -v --cc=gcc --vapidir $vapidir --disable-warnings
--main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X
-DGETTEXT_PACKAGE=\"valac\" -X -Werror=return-type -X -Werror=init-self -X
-Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X
-Werror=uninitialized -X -Werror=pointer-arith -X
-Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -Wformat -X
-Werror=format-security -X -Werror=format-nonliteral -X
-Werror=redundant-decls"
 VAPIGEN=$topbuilddir/vapigen/vapigen$EXEEXT
 VAPIGENFLAGS="--vapidir $vapidir"

@@ -114,26 +119,32 @@
 }

 testdir=_test
-rm -rf $testdir
-mkdir $testdir
-cd $testdir
-
-echo -n -e "TEST: Building...\033[72G"
-
-cat << "EOF" > checkall
+
+# Added
+echo "Use gmake check &> test.log for hard coded log file"
+# Changed echo -n -e to printf; No echo -options SunOS; just use newline
+printf "TEST: Building...\n"
+
+for testfile in "$@"; do
+PACKAGES=gio-2.0
+SOURCEFILES=
+cd $builddir
+rm -rf $testdir
+mkdir $testdir
+cd $testdir
+
+cat << "EOF" > checkall
 all=0
 fail=0
 EOF

-cat << "EOF" > main.vala
+cat << "EOF" > main.vala
 void main (string[] args) {
 switch (args[1]) {
 EOF

-PACKAGES=gio-2.0
-SOURCEFILES=
-for testfile in "$@"; do
-rm -f prepare check
+# Changed; entire $testdir is removed inside loop now
+#rm -f prepare check
 echo 'set -e' >> prepare

 case "$testfile" in
@@ -172,7 +183,8 @@
 INHEADER=0
 fi
 else
-if echo "$line" | grep -q "^[A-Za-z]\+:"; then
+# Changed "^[A-Za-z]\+:" to "^[A-Za-z]*:"
+if echo "$line" | grep -q "^[A-Za-z]*:"; then
 sourceend
 PART=$(($PART + 1))
 INHEADER=1
@@ -189,24 +201,28 @@
 esac

 cat prepare check > $ns.check
+# Changed echo -n -e and echo -e to printf
+# Changed [72G to [50G TEST RESULT SUMMARY all one line and < 80
chars.
 cat << EOF >> checkall
-echo -n -e "  /$testpath: \033[72G"
+printf "  /$testpath: \033[50G"
 ((all++))
 if bash $ns.check &>log; then
-echo -e "\033[0;32mOK\033[m"
+printf "\033[0;32mOK\033[m"
 else
 ((fail++))
-echo -e "\033[0;31mFAIL\033[m"
+printf "\033[0;31mFAIL\033[m"
 cat log
 fi
 EOF
-done
-
+# Moved to end
+#done
+
+# Adds space between RESULT and Summary
 cat << "EOF" >> checkall
 if [ $fail -eq 0 ]; then
-echo "All $all tests passed"
+echo " All $all tests passed"
 

Re: [Vala] Help with pub-sub class

2017-11-01 Thread Steven Oliver
I've made some progress on this if anyone wants some answers for posterity.

* Instead of using a struct I created a new class and I now pass an full
object. This let's me have default values.

The following are still eluding me:
* The signal "publish" seems unable to take two parameters. (I don't
understand this, though it's no longer an issue for me.)
* I can't figure out a way to get the method which writes to the log inside
the logging class because I keep needing access to instance members from a
static function. (https://github.com/steveno/balistica/blob/master/src/
BalisticaApplication.vala#L284)

Steven N. Oliver

On Sat, Oct 28, 2017 at 1:46 PM, Steven Oliver 
wrote:

> With the help of other developers here on the list I managed to get my
> logging class setup and working (thanks!). Now, that it's there, though, I
> want to continue adding to it. The first big thing I want to do is come up
> with default values for incoming messages (e.g. a default log level of
> ERROR for new messages).
>
> I've been trying to figure this out on my own and I keep hitting walls.
>
> Here is my class:
> https://github.com/steveno/balistica/blob/master/src/Logging.vala
>
> Issues I've encountered:
> * The signal "publish" seems unable to take two parameters.
> * You apparently can't add a default value to a member of a struct.
> * I can't figure out a way to get the method which writes to the log
> inside the logging class because I keep needing access to instance members
> from a static function. (https://github.com/steveno/
> balistica/blob/master/src/BalisticaApplication.vala#L284)
>
> If anyone has any help or suggestions I'm all ears!
>
> Steven N. Oliver
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Class vs struct with signal

2017-11-01 Thread Steven Oliver
I finally figured this out, though I don't understand why what I did works.

I changed the signal connection to use a non-existent variable named msg.

 Logging.get_default ().publish.connect ((msg) => {

this.log (msg) ;

 }) ;

Can anyone explain why doing that lets me use my new LogMsg object with my
Logger class' signal??


Steven N. Oliver

On Sun, Oct 29, 2017 at 8:43 PM, Steven Oliver 
wrote:

> I was using a struct when connecting to my signal, but now I'm using a
> class. This code now longer compiles, does anyone know what I'm doing wrong?
>
>  Logging.get_default ().publish.connect ((LogMsg) => {
>
> this.log (LogMsg) ;
>
>  }) ;
>
> I get the following error message:
>
> BalisticaApplication.c: In function ‘__lambda12_’:
> BalisticaApplication.c:311:10: error: ‘_tmp0_’ undeclared (first use in
> this function)
>   LogMsg* _tmp0_ = NULL;
>   ^
> BalisticaApplication.c:311:10: note: each undeclared identifier is
> reported only once for each function it appears in
> src/CMakeFiles/balistica.dir/build.make:178: recipe for target
> 'src/CMakeFiles/balistica.dir/BalisticaApplication.c.o' failed
>
> Steven N. Oliver
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list