From brian at westwoodsvcs.com Sat Feb 1 05:48:44 2020 From: brian at westwoodsvcs.com (Brian G) Date: Fri, 31 Jan 2020 20:48:44 -0800 (PST) Subject: [Gambas-user] Linux mint 19.3 tina, Gambas3 not in repository Message-ID: <1326194141.4851.1580532524794.JavaMail.zimbra@westwoodsvcs.com> Gambas3 seems to not yet be in the Mint 19.3 repository. When might we see it there? Thank You Brian G -------------- next part -------------- An HTML attachment was scrubbed... URL: From bagonergi at gmail.com Sun Feb 2 18:23:59 2020 From: bagonergi at gmail.com (Gianluigi) Date: Sun, 2 Feb 2020 18:23:59 +0100 Subject: [Gambas-user] Translation of mouse static method "Translate" Message-ID: I am having difficulty translating into Italian qt4 mouse static method "Translate" (*) I can't understand if for example this code: Public Sub Form_MouseUp() Button1.Visible = True Mouse.Translate(100, 100) Button1.X = Mouse.X Button1.Y = Mouse.Y End It is the same as: Public Sub Form_MouseUp() Button1.Visible = True Button1.X = Mouse.X + 100 Button1.Y = Mouse.Y + 100 End otherwise? (*) http://gambaswiki.org/wiki/comp/gb.qt4/mouse Regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.lee.davidson at gmail.com Sun Feb 2 20:03:35 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Sun, 2 Feb 2020 14:03:35 -0500 Subject: [Gambas-user] _free() event not firing when object has a Handle on a Process Message-ID: I have a class (TestClass) that, in its _new() method, spawns a SHELL Process with `ispell` in pipe mode: $pServerInstance = Shell "ispell -a" The class also has a _free() method that kills the Process: If $pServerInstance Then $pServerInstance.Kill I create an object of the class in the main form with: TestObject = New TestClass But, when I destroy the object, "TestObject = Null", the _free() method does not get called. This means the Process does not get killed, and the application hangs. Is this a bug, or just bad programming practice on my part? -- Lee -------------- next part -------------- A non-text attachment was scrubbed... Name: TestGraphical-0.0.24.tar.gz Type: application/gzip Size: 29532 bytes Desc: not available URL: From brian at westwoodsvcs.com Mon Feb 3 00:06:15 2020 From: brian at westwoodsvcs.com (Brian G) Date: Sun, 2 Feb 2020 15:06:15 -0800 (PST) Subject: [Gambas-user] I am trying to access a gambas library from a gambas script file. How Too? Message-ID: <1691911208.5110.1580684775280.JavaMail.zimbra@westwoodsvcs.com> I am trying to access some Gambas libraries from a Gambas script and just don't see how to do that anywhere. I am able to access and use inside gambas projects from the IDE, no issues there. Does anyone have any experience with this? I could make it a component and did try that but can't find the right name to use for the component created! Any help would be very appreciated Thank You Brian G -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.lee.davidson at gmail.com Mon Feb 3 01:13:10 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Sun, 2 Feb 2020 19:13:10 -0500 Subject: [Gambas-user] I am trying to access a gambas library from a gambas script file. How Too? In-Reply-To: <1691911208.5110.1580684775280.JavaMail.zimbra@westwoodsvcs.com> References: <1691911208.5110.1580684775280.JavaMail.zimbra@westwoodsvcs.com> Message-ID: On 2/2/20 6:06 PM, Brian G wrote: > I am trying to access some Gambas libraries from a Gambas script and just don't see how to do that anywhere. > > I am able to access and use inside gambas projects from the IDE, no issues there. > > Does anyone have any experience with this? > > I could make it a component and did try that but can't find the right name to use for the component created! > > Any help would be very appreciated > > Thank You > Brian G No experience with that. But, maybe this will help? http://gambaswiki.org/wiki/lang/include -- Lee From gambas.fr at gmail.com Mon Feb 3 08:27:07 2020 From: gambas.fr at gmail.com (Fabien Bodard) Date: Mon, 3 Feb 2020 08:27:07 +0100 Subject: [Gambas-user] I am trying to access a gambas library from a gambas script file. How Too? In-Reply-To: References: <1691911208.5110.1580684775280.JavaMail.zimbra@westwoodsvcs.com> Message-ID: When gb script was written the library way was not in use so we ve. Not implemented it. Well maybe it's time ? Le lun. 3 f?vr. 2020 ? 01:14, T Lee Davidson a ?crit : > On 2/2/20 6:06 PM, Brian G wrote: > > I am trying to access some Gambas libraries from a Gambas script and > just don't see how to do that anywhere. > > > > I am able to access and use inside gambas projects from the IDE, no > issues there. > > > > Does anyone have any experience with this? > > > > I could make it a component and did try that but can't find the right > name to use for the component created! > > > > Any help would be very appreciated > > > > Thank You > > Brian G > > No experience with that. But, maybe this will help? > http://gambaswiki.org/wiki/lang/include > > > -- > Lee > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at gambas-es.org Mon Feb 3 23:54:34 2020 From: admin at gambas-es.org (Jesus Guardon) Date: Mon, 3 Feb 2020 23:54:34 +0100 Subject: [Gambas-user] Translation of mouse static method "Translate" In-Reply-To: References: Message-ID: <9ecac38b-d82b-b96c-c458-1b65252c0234@gambas-es.org> El 02/02/20 a las 18:23, Gianluigi escribi?: > I am having difficulty translating into Italian qt4 mouse static method > "Translate" (*) > I can't understand if for example this code: > > Mouse.Translate(100, 100) > > Regards > Gianluigi Hi Gianluigi How about: spostare, trasferire ? To me, it is like moving coordinates, hence its meaning: move, transfer, displace or place. In Spanish it would be something like: mover, trasladar, transportar, ubicar, mudar, desplazar, llevar... Oh, well. Spanish is so complicated and rich in synonyms, I know, but Italian comes from latin, too. Best regards Jesus From g4mba5 at gmail.com Tue Feb 4 09:42:20 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 4 Feb 2020 09:42:20 +0100 Subject: [Gambas-user] Translation of mouse static method "Translate" In-Reply-To: References: Message-ID: <665cd077-c61c-c4d4-d3fc-b61ff5fd44e4@gmail.com> Le 02/02/2020 ? 18:23, Gianluigi a ?crit?: > I am having difficulty translating into Italian qt4 mouse static method > "Translate" (*) > I can't understand if for example this code: > > Public Sub Form_MouseUp() > > ? Button1.Visible = True > ? Mouse.Translate(100, 100) > ? Button1.X = Mouse.X > ? Button1.Y = Mouse.Y > > End > > It is the same as: > > Public Sub Form_MouseUp() > > ? Button1.Visible = True > ? Button1.X = Mouse.X + 100 > ? Button1.Y = Mouse.Y + 100 > > End > > otherwise? > > (*) http://gambaswiki.org/wiki/comp/gb.qt4/mouse > > Regards > Gianluigi > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Yes. -- Beno?t Minisini From bagonergi at gmail.com Tue Feb 4 10:09:15 2020 From: bagonergi at gmail.com (Gianluigi) Date: Tue, 4 Feb 2020 10:09:15 +0100 Subject: [Gambas-user] Translation of mouse static method "Translate" In-Reply-To: <9ecac38b-d82b-b96c-c458-1b65252c0234@gambas-es.org> References: <9ecac38b-d82b-b96c-c458-1b65252c0234@gambas-es.org> Message-ID: Il giorno mar 4 feb 2020 alle ore 00:02 Jesus Guardon ha scritto: > El 02/02/20 a las 18:23, Gianluigi escribi?: > > > I am having difficulty translating into Italian qt4 mouse static method > > "Translate" (*) > > Hi Gianluigi > > How about: spostare, trasferire ? > ... > > Best regards > > Jesus > Hi Jesus, I used "spostare". Thank you & regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From bagonergi at gmail.com Tue Feb 4 10:11:27 2020 From: bagonergi at gmail.com (Gianluigi) Date: Tue, 4 Feb 2020 10:11:27 +0100 Subject: [Gambas-user] Translation of mouse static method "Translate" In-Reply-To: <665cd077-c61c-c4d4-d3fc-b61ff5fd44e4@gmail.com> References: <665cd077-c61c-c4d4-d3fc-b61ff5fd44e4@gmail.com> Message-ID: Il giorno mar 4 feb 2020 alle ore 09:43 Beno?t Minisini ha scritto: > Le 02/02/2020 ? 18:23, Gianluigi a ?crit : > > I am having difficulty translating into Italian qt4 mouse static method > > "Translate" (*) > > I can't understand if for example this code: > ... Yes. > Hi Benoit, thank you for the confirmation. Regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisml at deganius.de Tue Feb 4 11:02:28 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 4 Feb 2020 11:02:28 +0100 Subject: [Gambas-user] Translation of mouse static method "Translate" In-Reply-To: <665cd077-c61c-c4d4-d3fc-b61ff5fd44e4@gmail.com> References: <665cd077-c61c-c4d4-d3fc-b61ff5fd44e4@gmail.com> Message-ID: Am 04.02.20 um 09:42 schrieb Beno?t Minisini: >> It is the same as: >> >> Public Sub Form_MouseUp() >> >> ? Button1.Visible = True >> ? Button1.X = Mouse.X + 100 >> ? Button1.Y = Mouse.Y + 100 >> >> End > Yes. So in English shouldn't it be called "Transfer", not "Translate"? Or "Beam"? ;-) Alles Gute Christof Thalhofer -- Dies ist keine Signatur From admin at allunix.ru Tue Feb 4 15:01:14 2020 From: admin at allunix.ru (Admin) Date: Tue, 4 Feb 2020 21:01:14 +0700 Subject: [Gambas-user] Gambas on FreeBSD Message-ID: <686e7a9a-bce7-45a3-fd31-b6aa4f63b449@allunix.ru> To whom it may concern. I was willing to create a Cisco-style remote CLI for FreeBSD for a very long time, but since I'm no so good at any native programming languages for that system, I could only wish that gambas would be available for FreeBSD once again some time. There used to be an official port of Gambas2 in FreeBSD port subsystem, but it's long gone. And Gambas3 simply could not be built on FreeBSD due to some libraries absence. Well, that changed when Gambas 3.14 was released.? There are still some header files missing in base FreeBSD system, but that's fixable. Also, I'm not even talking about Gambas IDE at this point, all I needed was an interpreter. Realistically it is what's most people need, I think, since FreeBSD is not as popular as a desktop system then it is as a server platform (which it's great at btw), so all I always wanted to compile is basically speaking - a gbrx3 binary. There's a FreeBSD install instructions on a gambaswiki.org, but they are literally last-century-old, because, for example, there's mentioning that FreeBSD has it's OpenGL libraries at /usr/X11R6 which isn't true since, like, 2003. And a lot more. So this page is no good. It's actually better to take it down completely, because if you follow those instructions, you will break any modern FreeBSD installation this way. Anyway, let's get to the point: So, after some trial and error I was able to find a stable way to build a Gambas 3.14.2 interpreter from sources and created a binary package that works on currently last stable syetem realease - FreeBSD 12.1 x64. I've created some scripts. So, if you happen to also want to write non-graphical software for BSD, this is what I can now offer: on a fresh install of FreeBSD 12.1 x64 just run this command you're good to go: # fetch http://allunix.ru/back/gbinst.sh && sh gbinst.sh this will install required dependencies, and you will have your Gambas infrastructure installed in /usr/local/ (just as all software under FreeBSD does) This is purely binary installation, no compilation needed. If you want to compile Gambas 3.14.2 under FreeBSD yourself, here's another command for you: # fetch http://allunix.ru/back/gb3compile.sh && sh gb3compile.sh this will fetch a tarball of vanilla gambas 3.14.2 sources and make all necessary modifications to them, then compile and install Gambas3 in /usr/local Since I did all this firstly for myself, you may find my choice of dependencies strange or unsuitable for your needs, but since I only needed this amount of functionality (like, for example, mysql but not postgres or sqlite), you may want to change the script any way you like. I hope this would be useful for somebody in the future. Best Regards Dmitry Bachilo admin at allunix.ru From bagonergi at gmail.com Wed Feb 5 09:50:04 2020 From: bagonergi at gmail.com (Gianluigi) Date: Wed, 5 Feb 2020 09:50:04 +0100 Subject: [Gambas-user] Translation of mouse static method "Translate" In-Reply-To: References: <665cd077-c61c-c4d4-d3fc-b61ff5fd44e4@gmail.com> Message-ID: Il giorno mar 4 feb 2020 alle ore 11:03 Christof Thalhofer < chrisml at deganius.de> ha scritto: > So in English shouldn't it be called "Transfer", not "Translate"? > > Or "Beam"? ;-) > Translate, according to the translator it seems correct: "move from one place or condition to another" It wasn't the word "translate" that put me in trouble, but the concision of the phrase which seems to say to move the event. I hope I explained myself :-) Regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From pebauer68 at gmail.com Wed Feb 5 12:50:44 2020 From: pebauer68 at gmail.com (Peter Bauer) Date: Wed, 5 Feb 2020 12:50:44 +0100 Subject: [Gambas-user] Example script on Gambaswiki fails (GetUsedMemory) - needs Clong Message-ID: Hello, http://gambaswiki.org/wiki/doc/whatisgambas?nh http://gambaswiki.org/wiki/doc/whatisgambas?nh#t4 Gambas 3.14 output: MMain.GetUsedMemory.14: #6: Type mismatch: wanted Integer, got String instead MMain.GetUsedMemory.14 MMain.Main.23 While I do not fully understand the Type mismatch (got String !?, really ?). -When I replace Cint(aRes[1] with CLong(aRes[1]) it works again. Used memory: 265040 Kb /* Output checked on Gambas Playground for stable and daily Who could please update the script on Gambaswiki ? Scripting with Gambas is nice and gets the job done with good performance. Just wrote a script for testing connectivity, hopefully its useful. https://github.com/pebauer68/scripts/blob/master/networkcheck Best Regards, Peter Working Script: Function GetUsedMemory() As Integer Dim sRes As String Dim aRes As String[] Dim cVal As New Collection Dim sVal As String Exec ["cat", "/proc/meminfo"] To sRes For Each sVal In Split(sRes, "\n", "", True) aRes = Split(sVal, " ", "", True) cVal[Left$(aRes[0], -1)] = *CLong(aRes[1])* Next Return cVal!MemTotal - cVal!MemFree - cVal!Buffers - cVal!Cached + cVal!SwapTotal - cVal!SwapFree - cVal!SwapCached End Print Subst("Used memory: &1 Kb", GetUsedMemory()) -------------- next part -------------- An HTML attachment was scrubbed... URL: From bagonergi at gmail.com Wed Feb 5 16:07:47 2020 From: bagonergi at gmail.com (Gianluigi) Date: Wed, 5 Feb 2020 16:07:47 +0100 Subject: [Gambas-user] Example script on Gambaswiki fails (GetUsedMemory) - needs Clong In-Reply-To: References: Message-ID: Hi Peter, I changed the code to CLong, you could have done it too. :-) Regards Gianluigi Il giorno mer 5 feb 2020 alle ore 12:51 Peter Bauer ha scritto: > Hello, > http://gambaswiki.org/wiki/doc/whatisgambas?nh > http://gambaswiki.org/wiki/doc/whatisgambas?nh#t4 > Gambas 3.14 output: > MMain.GetUsedMemory.14: #6: Type mismatch: wanted Integer, got String > instead MMain.GetUsedMemory.14 MMain.Main.23 > > While I do not fully understand the Type mismatch (got String !?, really > ?). > -When I replace Cint(aRes[1] with CLong(aRes[1]) it works again. > > Used memory: 265040 Kb /* Output checked on Gambas Playground for stable > and daily > Who could please update the script on Gambaswiki ? > > Scripting with Gambas is nice and gets the job done with good performance. > Just wrote a script for testing connectivity, hopefully its useful. > https://github.com/pebauer68/scripts/blob/master/networkcheck > > Best Regards, Peter > > Working Script: > Function GetUsedMemory() As Integer > > Dim sRes As String > Dim aRes As String[] > Dim cVal As New Collection > Dim sVal As String > > Exec ["cat", "/proc/meminfo"] To sRes > > For Each sVal In Split(sRes, "\n", "", True) > aRes = Split(sVal, " ", "", True) > cVal[Left$(aRes[0], -1)] = *CLong(aRes[1])* > Next > > Return cVal!MemTotal - cVal!MemFree - cVal!Buffers - cVal!Cached + > cVal!SwapTotal - cVal!SwapFree - cVal!SwapCached > > End > > Print Subst("Used memory: &1 Kb", GetUsedMemory()) > > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bagonergi at gmail.com Wed Feb 5 16:44:12 2020 From: bagonergi at gmail.com (Gianluigi) Date: Wed, 5 Feb 2020 16:44:12 +0100 Subject: [Gambas-user] Example script on Gambaswiki fails (GetUsedMemory) - needs Clong In-Reply-To: References: Message-ID: Il giorno mer 5 feb 2020 alle ore 12:51 Peter Bauer ha scritto: > Hello, > http://gambaswiki.org/wiki/doc/whatisgambas?nh > http://gambaswiki.org/wiki/doc/whatisgambas?nh#t4 > Gambas 3.14 output: > MMain.GetUsedMemory.14: #6: Type mismatch: wanted Integer, got String > instead MMain.GetUsedMemory.14 MMain.Main.23 > > While I do not fully understand the Type mismatch (got String !?, really > ?). > -When I replace Cint(aRes[1] with CLong(aRes[1]) it works again. > It fails on VmallocTotal that for example in my computer is 34359738367 kB, higher than the limit of an integer variable. String has nothing to do with it and Clong() instead of CInt() works well. It would also works with Val(). Regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jussi.lahtinen at gmail.com Wed Feb 5 19:25:45 2020 From: jussi.lahtinen at gmail.com (Jussi Lahtinen) Date: Wed, 5 Feb 2020 20:25:45 +0200 Subject: [Gambas-user] Example script on Gambaswiki fails (GetUsedMemory) - needs Clong In-Reply-To: References: Message-ID: aRes[] is string array and it contains value, which cannot be converted to integer. Thus the error message. Jussi On Wed, Feb 5, 2020 at 1:51 PM Peter Bauer wrote: > Hello, > http://gambaswiki.org/wiki/doc/whatisgambas?nh > http://gambaswiki.org/wiki/doc/whatisgambas?nh#t4 > Gambas 3.14 output: > MMain.GetUsedMemory.14: #6: Type mismatch: wanted Integer, got String > instead MMain.GetUsedMemory.14 MMain.Main.23 > > While I do not fully understand the Type mismatch (got String !?, really > ?). > -When I replace Cint(aRes[1] with CLong(aRes[1]) it works again. > > Used memory: 265040 Kb /* Output checked on Gambas Playground for stable > and daily > Who could please update the script on Gambaswiki ? > > Scripting with Gambas is nice and gets the job done with good performance. > Just wrote a script for testing connectivity, hopefully its useful. > https://github.com/pebauer68/scripts/blob/master/networkcheck > > Best Regards, Peter > > Working Script: > Function GetUsedMemory() As Integer > > Dim sRes As String > Dim aRes As String[] > Dim cVal As New Collection > Dim sVal As String > > Exec ["cat", "/proc/meminfo"] To sRes > > For Each sVal In Split(sRes, "\n", "", True) > aRes = Split(sVal, " ", "", True) > cVal[Left$(aRes[0], -1)] = *CLong(aRes[1])* > Next > > Return cVal!MemTotal - cVal!MemFree - cVal!Buffers - cVal!Cached + > cVal!SwapTotal - cVal!SwapFree - cVal!SwapCached > > End > > Print Subst("Used memory: &1 Kb", GetUsedMemory()) > > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g4mba5 at gmail.com Wed Feb 5 21:33:05 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Wed, 5 Feb 2020 21:33:05 +0100 Subject: [Gambas-user] _free() event not firing when object has a Handle on a Process In-Reply-To: References: Message-ID: <038a71c0-e0c3-49d0-a58f-e9f68e4b18ba@gmail.com> Le 02/02/2020 ? 20:03, T Lee Davidson a ?crit?: > I have a class (TestClass) that, in its _new() method, spawns a SHELL > Process with `ispell` in pipe mode: > $pServerInstance = Shell "ispell -a" > > The class also has a _free() method that kills the Process: > If $pServerInstance Then $pServerInstance.Kill > > I create an object of the class in the main form with: > TestObject = New TestClass > > But, when I destroy the object, "TestObject = Null", the _free() method > does not get called. This means the Process does not get killed, and the > application hangs. > > Is this a bug, or just bad programming practice on my part? > > It's a bug, normally fixed in commit https://gitlab.com/gambas/gambas/commit/d4860710c0623a9e4e9d5d7b47e2cc2e3df454e3. Regards, -- Beno?t Minisini From brian at westwoodsvcs.com Thu Feb 6 04:43:14 2020 From: brian at westwoodsvcs.com (Brian G) Date: Thu, 6 Feb 2020 03:43:14 +0000 (UTC) Subject: [Gambas-user] I am trying to access a gambas library from a gambas script file. How Too? In-Reply-To: References: <1691911208.5110.1580684775280.JavaMail.zimbra@westwoodsvcs.com> Message-ID: <605B1DED34848F44.4d63af28-f353-420f-b06e-7e42178ecde8@mail.outlook.com> I did make it a component, works well the component page needs updated too. I did change gbs3 code to allow lib directive it now creates the project file correctly. But the compiler still does not see the exports. Posted a copy to bugtracker with a request . Maybe? thank you brian On Sun, Feb 2, 2020 at 11:28 PM -0800, "Fabien Bodard" wrote: When gb script was written the library way was not in use so we ve. Not implemented it. Well maybe it's time ? Le lun. 3 f?vr. 2020 ? 01:14, T Lee Davidson a ?crit?: On 2/2/20 6:06 PM, Brian G wrote: > I am trying to access some Gambas libraries from a Gambas script and just don't see how to do that anywhere. > > I am able to access and use inside gambas projects from the IDE, no issues there. > > Does anyone have any experience with this? > > I could make it a component and did try that but can't find the right name to use for the component created! > > Any help would be very appreciated > > Thank You > Brian G No experience with that. But, maybe this will help? http://gambaswiki.org/wiki/lang/include -- Lee ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisml at deganius.de Sun Feb 9 10:14:10 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 9 Feb 2020 10:14:10 +0100 Subject: [Gambas-user] 3.14.3 on Launchpad Message-ID: Hello, on Lanchpad there is still Gambas 3.14.2. Shouldn't it be updated now? Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From sebikul at gmail.com Sun Feb 9 11:01:55 2020 From: sebikul at gmail.com (=?UTF-8?Q?Sebasti=C3=A1n_Kulesz?=) Date: Sun, 9 Feb 2020 11:01:55 +0100 Subject: [Gambas-user] 3.14.3 on Launchpad In-Reply-To: References: Message-ID: Hi Christof, Sorry for the delay in pushing the update, but I'm on holidays and don't have my computer with me. I will do it this week as soon as I get back. Regards, Sebastian On Sun, Feb 9, 2020, 10:15 AM Christof Thalhofer wrote: > Hello, > > on Lanchpad there is still Gambas 3.14.2. Shouldn't it be updated now? > > Alles Gute > > Christof Thalhofer > > -- > Dies ist keine Signatur > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisml at deganius.de Sun Feb 9 11:34:54 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 9 Feb 2020 11:34:54 +0100 Subject: [Gambas-user] 3.14.3 on Launchpad In-Reply-To: References: Message-ID: <3f4316c2-a74a-5097-b41f-802ceda46fa9@deganius.de> Hi Sebasti?n, Am 09.02.20 um 11:01 schrieb Sebasti?n Kulesz: > Sorry for the delay in pushing the update, but I'm on holidays and don't > have my computer with me. I will do it this week as soon as I get back. No problem, it's not urgent for me, please enjoy your holidays! :-) Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From gambas.fr at gmail.com Mon Feb 10 19:29:39 2020 From: gambas.fr at gmail.com (Fabien Bodard) Date: Mon, 10 Feb 2020 19:29:39 +0100 Subject: [Gambas-user] I am trying to access a gambas library from a gambas script file. How Too? In-Reply-To: <605B1DED34848F44.4d63af28-f353-420f-b06e-7e42178ecde8@mail.outlook.com> References: <1691911208.5110.1580684775280.JavaMail.zimbra@westwoodsvcs.com> <605B1DED34848F44.4d63af28-f353-420f-b06e-7e42178ecde8@mail.outlook.com> Message-ID: Hum remember that the library must be in the same path than the executable. Maybe the scripter must generate a symlink in the executable path stored in the temp dir. Can you send me a sample of what you are doing so I can do some tests. Le jeu. 6 f?vr. 2020 ? 04:54, Brian G a ?crit : > I did make it a component, works well the component page needs updated too. > I did change gbs3 code to allow lib directive it now creates the project > file correctly. But the compiler still does not see the exports. > Posted a copy to bugtracker with a request . Maybe? > > thank you > brian > > > > > On Sun, Feb 2, 2020 at 11:28 PM -0800, "Fabien Bodard" < > gambas.fr at gmail.com> wrote: > > When gb script was written the library way was not in use so we ve. Not >> implemented it. Well maybe it's time ? >> >> Le lun. 3 f?vr. 2020 ? 01:14, T Lee Davidson >> a ?crit : >> >>> On 2/2/20 6:06 PM, Brian G wrote: >>> > I am trying to access some Gambas libraries from a Gambas script and >>> just don't see how to do that anywhere. >>> > >>> > I am able to access and use inside gambas projects from the IDE, no >>> issues there. >>> > >>> > Does anyone have any experience with this? >>> > >>> > I could make it a component and did try that but can't find the right >>> name to use for the component created! >>> > >>> > Any help would be very appreciated >>> > >>> > Thank You >>> > Brian G >>> >>> No experience with that. But, maybe this will help? >>> http://gambaswiki.org/wiki/lang/include >>> >>> >>> -- >>> Lee >>> >>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- >>> >> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g4mba5 at gmail.com Tue Feb 11 02:02:48 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 11 Feb 2020 02:02:48 +0100 Subject: [Gambas-user] PEEK and managing ssh Message-ID: Hi, In the last commit, I have added two new features: 1) A PEEK command, that allows to peek some bytes from a stream without removing them, so that they are available to the next READ instruction. Note that if you issue another PEEK, without having called READ before, then the bytes are lost. In other words, the second PEEK does not read the same bytes again. 2) A new class named "Terminal". The name is not very good, it may change if I find or if someone suggests something better. This class encapsulates a Process object, and provides an Expect() method that allows to tell what to answer to the process when it issues a specific prompt. This is useful for commands that work by asking passwords to the user without being able to take it from its arguments. For example, if you want to run an "scp" command from Gambas, you will do that: hProcess = Exec ["scp", ... ] For Input Output As "Process" hTerminal = New Terminal(hProcess) As "Terminal" hTerminal.Expect("(yes/no*)?", "yes") hTerminal.Expect(":", "the password for my ssh key") hProcess.Wait Comments, suggestions and questions are welcome! Regards, -- Beno?t Minisini From adamnt42 at gmail.com Tue Feb 11 02:13:57 2020 From: adamnt42 at gmail.com (Bruce) Date: Tue, 11 Feb 2020 11:43:57 +1030 Subject: [Gambas-user] PEEK and managing ssh In-Reply-To: References: Message-ID: 8< On 11/2/20 11:32 am, Beno?t Minisini wrote: > 2) A new class named "Terminal". The name is not very good, it may > change if I find or if someone suggests something better. > > This class encapsulates a Process object, and provides an Expect() > method that allows to tell what to answer to the process when it issues > a specific prompt. > Comments, suggestions and questions are welcome! "ProcessIO" "ProcessQA" "ProcIO" "ProcQA" and for the Expect method perhaps "Respond" Public Sub Repond ( prompt As String, answer As String ) Provides a response to a prompt issued by the process. JM20C bruce From admin at allunix.ru Tue Feb 11 08:11:27 2020 From: admin at allunix.ru (Admin) Date: Tue, 11 Feb 2020 14:11:27 +0700 Subject: [Gambas-user] PEEK and managing ssh In-Reply-To: References: Message-ID: <33a12d27-c5d8-e862-105a-eeedf166b73b@allunix.ru> That is very good news!!! Thanks! Can't wait to try it, have a demand for it. Dmitry. 11.02.2020 8:02, Beno?t Minisini ?????: > Hi, > > In the last commit, I have added two new features: > > 1) A PEEK command, that allows to peek some bytes from a stream > without removing them, so that they are available to the next READ > instruction. > > Note that if you issue another PEEK, without having called READ > before, then the bytes are lost. In other words, the second PEEK does > not read the same bytes again. > > 2) A new class named "Terminal". The name is not very good, it may > change if I find or if someone suggests something better. > > This class encapsulates a Process object, and provides an Expect() > method that allows to tell what to answer to the process when it > issues a specific prompt. > > This is useful for commands that work by asking passwords to the user > without being able to take it from its arguments. > > For example, if you want to run an "scp" command from Gambas, you will > do that: > > ? hProcess = Exec ["scp", ... ] For Input Output As "Process" > > ? hTerminal = New Terminal(hProcess) As "Terminal" > > ? hTerminal.Expect("(yes/no*)?", "yes") > ? hTerminal.Expect(":", "the password for my ssh key") > > ? hProcess.Wait > > Comments, suggestions and questions are welcome! > > Regards, > From g4mba5 at gmail.com Tue Feb 11 17:41:08 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 11 Feb 2020 17:41:08 +0100 Subject: [Gambas-user] PEEK and managing ssh In-Reply-To: References: Message-ID: Le 11/02/2020 ? 02:13, Bruce a ?crit?: > 8< > > On 11/2/20 11:32 am, Beno?t Minisini wrote: >> 2) A new class named "Terminal". The name is not very good, it may >> change if I find or if someone suggests something better. >> >> This class encapsulates a Process object, and provides an Expect() >> method that allows to tell what to answer to the process when it >> issues a specific prompt. > >> Comments, suggestions and questions are welcome! > > "ProcessIO" "ProcessQA" "ProcIO" "ProcQA" Beeh... ugly! :-) > > and for the Expect method perhaps "Respond" I chose "Expect" because it's a name of a "famous" TCL library on unix that aims at doing the same thing. And you are never sure that the running process will actually emit the expected prompt. :-) I'm currently thinking of extending the Process class instead of using a new class. The only thing that bothers me is that it will add new private fields to the Process class that may be useless to the uses of 'gb.util'. -- Beno?t Minisini From brian at westwoodsvcs.com Tue Feb 11 21:18:01 2020 From: brian at westwoodsvcs.com (Brian G) Date: Tue, 11 Feb 2020 12:18:01 -0800 (PST) Subject: [Gambas-user] I am trying to access a gambas library from a gambas script file. How Too? In-Reply-To: References: <1691911208.5110.1580684775280.JavaMail.zimbra@westwoodsvcs.com> <605B1DED34848F44.4d63af28-f353-420f-b06e-7e42178ecde8@mail.outlook.com> Message-ID: <1826040101.6083.1581452281233.JavaMail.zimbra@westwoodsvcs.com> I am not sure how it works, The documents say there is a path depending upon if it is global shared or private. I was able to use it inside ide app from the global location. I have written a lib for some functions i needed for a project I am working on. I have converted it to a component which is working. After trying to get it working even updating the scripter to allow the keyword lib for libraries and create an entry into the project file. The compiler does not complain about it but does seem to ignore it as there is no output from the compiler to the .startup. The .startup file with my global library seems to just have the lib name :xxxx:1.0 in the .startup with no path. It looks like the runtime searches for the library in the different locations listed in the documentation. I am not sure what the compiler is looking for. I include an example of a script that needs the library, and a component install and library install hope this helps Thank You Brian G From: "Fabien Bodard" To: "Gambas mailing list" Sent: Monday, February 10, 2020 10:29:39 AM Subject: Re: [Gambas-user] I am trying to access a gambas library from a gambas script file. How Too? Hum remember that the library must be in the same path than the executable. Maybe the scripter must generate a symlink in the executable path stored in the temp dir. Can you send me a sample of what you are doing so I can do some tests. Le jeu. 6 f?vr. 2020 ? 04:54, Brian G < [ mailto:brian at westwoodsvcs.com | brian at westwoodsvcs.com ] > a ?crit : I did make it a component, works well the component page needs updated too. I did change gbs3 code to allow lib directive it now creates the project file correctly. But the compiler still does not see the exports. Posted a copy to bugtracker with a request . Maybe? thank you brian On Sun, Feb 2, 2020 at 11:28 PM -0800, "Fabien Bodard" < [ mailto:gambas.fr at gmail.com | gambas.fr at gmail.com ] > wrote: BQ_BEGIN When gb script was written the library way was not in use so we ve. Not implemented it. Well maybe it's time \uD83D\uDE0A Le lun. 3 f?vr. 2020 ? 01:14, T Lee Davidson < [ mailto:t.lee.davidson at gmail.com | t.lee.davidson at gmail.com ] > a ?crit : BQ_BEGIN On 2/2/20 6:06 PM, Brian G wrote: > I am trying to access some Gambas libraries from a Gambas script and just don't see how to do that anywhere. > > I am able to access and use inside gambas projects from the IDE, no issues there. > > Does anyone have any experience with this? > > I could make it a component and did try that but can't find the right name to use for the component created! > > Any help would be very appreciated > > Thank You > Brian G No experience with that. But, maybe this will help? [ http://gambaswiki.org/wiki/lang/include | http://gambaswiki.org/wiki/lang/include ] -- Lee ----[ [ http://gambaswiki.org/wiki/doc/netiquette | http://gambaswiki.org/wiki/doc/netiquette ] ]---- BQ_END ----[ [ http://gambaswiki.org/wiki/doc/netiquette | http://gambaswiki.org/wiki/doc/netiquette ] ]---- BQ_END ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: westwood-sharedmem_3.14.60-0ubuntu1_all.deb Type: application/x-deb Size: 59200 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gambas3-westwood-sharedmem-qt5_3.14.60-0ubuntu1_all.deb Type: application/x-deb Size: 1584 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Samplescripts Type: application/octet-stream Size: 1728 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleScriptBG Type: application/octet-stream Size: 923 bytes Desc: not available URL: From brian at westwoodsvcs.com Wed Feb 12 00:44:12 2020 From: brian at westwoodsvcs.com (Brian G) Date: Tue, 11 Feb 2020 15:44:12 -0800 (PST) Subject: [Gambas-user] Build of sdl component fails with la message -lGL Message-ID: <281153066.6181.1581464652376.JavaMail.zimbra@westwoodsvcs.com> Mint 19.3 trying to build gambas master Anyone know what GL/version lib its looking for, there are no errors during ./configue says all components will be built Thank You Brian G -------------- next part -------------- An HTML attachment was scrubbed... URL: From adamnt42 at gmail.com Thu Feb 13 10:10:37 2020 From: adamnt42 at gmail.com (Bruce) Date: Thu, 13 Feb 2020 19:40:37 +1030 Subject: [Gambas-user] gb.args - Probably a dumb question but ... Message-ID: <9e5ec734-ed7a-7e2d-4f2a-73750b32bee6@gmail.com> If Args.Has("t", "today", "Run plots for today") Then $runtoday = True I have probably done something wrong here but if $runtoday has already been set True then that line, if there is no "-t" on the command line seems to set $runtoday false. (Unless I have done something stupid somewhere else?) Any clues? There doesn't seem to be a default value for "If Args.Has" mentioned in the help docs. tia b From sserbanro at gmail.com Thu Feb 13 12:08:21 2020 From: sserbanro at gmail.com (Serban Stanescu) Date: Thu, 13 Feb 2020 13:08:21 +0200 Subject: [Gambas-user] Hello! Thanks! Message-ID: <9ab0d7a8-a56d-a6a4-f8e6-11e419301b37@gmail.com> *Hello everybody!** * 1. My name is ?erban St?nescu, I am from Rom?nia and I just started learning Gambas. "?" in my name is spelled as --> EN: Sh, FR: ch and "?", like the first two letters in "another". Since my French is poor, I'll stick to English. *2. I just wanted to say "Thanks" to the Admin: Thanks Beno?t!* And *a warm to all people around here!* *3. My programming skills*... Are poor. I am a self-taught, so lower your expectations. I have some experience though... I started learning with VB (5.5? That was back in 1995), then I tried my hand with some CPP (C++) and then I tried *RapidQ*, which I really loved. Same concept as Gambas, but... for Windows. Long story, so I'll skip it. That was till 22-07-2012, when I moved for good to Linux. Never used Windows since. Sometime ago, I found Gambas. One month ago, I started learning. Had lots of trouble with the documentation, but I managed to rebuild from scratch a program I made years ago in RapidQ, called /*CD Manager*/ (was listed on nonags.com and got 5 ducks out of 6). It is a simple program, designed to list directories and save results into .txt files, for archive information management purposes. It allwes me to search the DirLists (hence the name: *DirLister*) and then perform various searches for WhatEverRequired, list the results, save the list, narrow the search and so on. It's easier to find a file in such a list than mangling with media. And my archives, exceed 2 TB of data. So, if you grasp the idea of looking for a needle in a hay stack, you understand my point. Here are 2 screenshots: https://www.facebook.com/photo.php?fbid=2697670833614144 I chose the URL due to image size. I guess the list supports some 250 K files so adding many files lead to a waste of space. _*4. To Beno?t.*_ *A. Amazing RAD!* Has more than I dreamed of! *B. The [Dir] class* has a flaw. I needed a flag to exclude some files/directories. Among the constants it is required a [gbListCurrentUser], otherwise the program rises the [Access Denied] error when encountering say, "root/root" or other owner than the current user. Using the App as Root on the other hand, it's something to better avoid, except for experienced users. *C. The [Dialog] class.* It took me a lot of time (many hours!) to figure out that the [Dialog.SelectDirectory()] class is actually the [Dialog.OpenFile()] stripped down. Bad programming choice, since if you use the somewhere and then you try to open a directory. the dialog shown is crippled and useless. You first need to issue a dummy call of the class with in order to delete the previous filters. The "Choose Directory" dialog will never ever show, but you can select a directory in this way. If possible (= can do it in a reasonable time), change the hierarchy of the classes and make [SelectDirectory] the superclass and then add the prototypes for [OpenFile] and create the subclass for this control. This way you avoid similar collisions and who-knows-what-else... *D. SearchBox for the documentation site.* Sorry, but using the documentation is such a curse! The only option is to move back and forth through pages, looking for WHAT? How is anyone supposed to know what he's looking for, supposedly that the "something" really is there? Does anyone expect from someone NEW to Gambas to know already everything? If so, what's the purpose of the documentation? It takes about 300% more time to find something IF you'tre lucky enough. Otherwise, it takes up to 10 times more time moving back and forth through countless pages, in the hope you'll find something useful. A SEARCH function, very much like in https://lists.gambas-basic.org/cgi-bin/search.cgi, would solve the problem. Also, in the built-in Help, would be very helpful a SEARCH function. Best regards! ?erban -------------- next part -------------- An HTML attachment was scrubbed... URL: From adamnt42 at gmail.com Thu Feb 13 12:20:23 2020 From: adamnt42 at gmail.com (Bruce) Date: Thu, 13 Feb 2020 21:50:23 +1030 Subject: [Gambas-user] Hello! Thanks! In-Reply-To: <9ab0d7a8-a56d-a6a4-f8e6-11e419301b37@gmail.com> References: <9ab0d7a8-a56d-a6a4-f8e6-11e419301b37@gmail.com> Message-ID: ?erban Welcome and keep going Gambas is ... the best. > *D. SearchBox for the documentation site.* Sorry, but using the > documentation is such a curse! The only option is to move back and forth > through pages, There is a searchbox, you just have to register as a known user. (It's not hard) then not only do you get the searchbox but the ability to see the latest news (helpwise) but also you can then start to contribute to the Romanian translations for help. Just one thing, the help is "terse". You must read every word in the page and consider it. In time it will become clear why this is so. best wishes b From rwe-sse at osnanet.de Thu Feb 13 12:50:16 2020 From: rwe-sse at osnanet.de (Rolf-Werner Eilert) Date: Thu, 13 Feb 2020 12:50:16 +0100 Subject: [Gambas-user] Hello! Thanks! In-Reply-To: <9ab0d7a8-a56d-a6a4-f8e6-11e419301b37@gmail.com> References: <9ab0d7a8-a56d-a6a4-f8e6-11e419301b37@gmail.com> Message-ID: <35e71396-14b5-b09f-abf1-7415a2119a56@osnanet.de> Hello Serban, Am 13.02.20 um 12:08 schrieb Serban Stanescu: > *Hello everybody!** > * > *D. SearchBox for the documentation site.* Sorry, but using the > documentation is such a curse! The only option is to move back and forth > through pages, I can imagine what you mean. Being on a keyword, Gambas will pop up the help page about that keyword. At least in most cases... Benoit, e. g. being on an event, this doesn't function. Neither it will with a name for a control. Simple example: Form_Open() Neither "Form" nor "Open" will lead you to the help page. When there is a control with a name you changed, say "Zeit" for a Label, it will lead to a page saying "Zeit as Label", but you neither can click on "Label" to get to the help page for Labels, nor can you see the class you will have to look for it. Regards Rolf From rwe-sse at osnanet.de Thu Feb 13 16:31:06 2020 From: rwe-sse at osnanet.de (Rolf-Werner Eilert) Date: Thu, 13 Feb 2020 16:31:06 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet Message-ID: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> There are two questions I have about making an Installation Packet from a Gambas project. 1. Will the package automatically install Gambas if Gambas is not yet on the system? And if yes, which version - the one from the repos or the one you recommend? 2. Which package group and which menu item will I choose if I do not find a match? I know there is a menu item "Others" or "Special". It is not in the list, how can I choose it? Thank you for all ideas! Rolf From charlie at cogier.com Thu Feb 13 17:22:57 2020 From: charlie at cogier.com (Charlie Ogier) Date: Thu, 13 Feb 2020 16:22:57 +0000 Subject: [Gambas-user] gb.args - Probably a dumb question but ... In-Reply-To: <9e5ec734-ed7a-7e2d-4f2a-73750b32bee6@gmail.com> References: <9e5ec734-ed7a-7e2d-4f2a-73750b32bee6@gmail.com> Message-ID: <1331797c-7980-8bd0-0353-2168db65987d@cogier.com> This code works for me. *Public Sub Form_Open()** ** **? Dim $runtoday As Boolean = True** ** **? Args.Begin()** **? If Args.Has("t", "today", "Run plots for today") Then $runtoday = True** **? Args.End** ** **? Print $runtoday** ** **End** ** *The result is *True* even if there is no *-t*, tested with 'global' and local Boolean. This was done in the IDE. Charlie On 13/02/2020 09:10, Bruce wrote: > If Args.Has("t", "today", "Run plots for today") Then $runtoday = True > > I have probably done something wrong here but if $runtoday has already > been set True then that line, if there is no "-t" on the command line > seems to set $runtoday false. > > (Unless I have done something stupid somewhere else?) > > Any clues? There doesn't seem to be a default value for "If Args.Has" > mentioned in the help docs. > > tia > b > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.lee.davidson at gmail.com Thu Feb 13 18:47:10 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Thu, 13 Feb 2020 12:47:10 -0500 Subject: [Gambas-user] Indexing Strings? Message-ID: <1dd4b9da-1d2e-987a-83b8-e5a4ca542144@gmail.com> http://gambaswiki.org/wiki/lang/type/string states, "The first character of a string is numbered one, not zero." Yet, this code: Dim sText As String = "Hello World" Print sText[1] 'prints "e" Print sText[0] 'prints "H" appears to demonstrate that strings are indexed starting with 0. However, string functions seem to use a 1-based index. What's the reason for this discrepancy? -- Lee From g4mba5 at gmail.com Thu Feb 13 19:16:57 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Thu, 13 Feb 2020 19:16:57 +0100 Subject: [Gambas-user] Indexing Strings? In-Reply-To: <1dd4b9da-1d2e-987a-83b8-e5a4ca542144@gmail.com> References: <1dd4b9da-1d2e-987a-83b8-e5a4ca542144@gmail.com> Message-ID: <200ed46c-112f-528a-d717-f3188c8ce473@gmail.com> Le 13/02/2020 ? 18:47, T Lee Davidson a ?crit?: > http://gambaswiki.org/wiki/lang/type/string states, "The first character > of a string is numbered one, not zero." Yet, this code: > ? Dim sText As String = "Hello World" > > ? Print sText[1] 'prints "e" > ? Print sText[0] 'prints "H" > > appears to demonstrate that strings are indexed starting with 0. > However, string functions seem to use a 1-based index. > > What's the reason for this discrepancy? > > The array syntax was introduced recently for people who prefer it, so the documentation is not up to date. And array indexes start at 0. But string functions count from 1, because of BASIC legacy. Regards, -- Beno?t Minisini From t.lee.davidson at gmail.com Thu Feb 13 19:32:18 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Thu, 13 Feb 2020 13:32:18 -0500 Subject: [Gambas-user] Indexing Strings? In-Reply-To: <200ed46c-112f-528a-d717-f3188c8ce473@gmail.com> References: <1dd4b9da-1d2e-987a-83b8-e5a4ca542144@gmail.com> <200ed46c-112f-528a-d717-f3188c8ce473@gmail.com> Message-ID: <8a04ec0d-3ff7-b646-fda2-ccf559668cac@gmail.com> On 2/13/20 1:16 PM, Beno?t Minisini wrote: > Le 13/02/2020 ? 18:47, T Lee Davidson a ?crit?: >> http://gambaswiki.org/wiki/lang/type/string states, "The first character of a string is numbered one, not zero." Yet, this code: >> ?? Dim sText As String = "Hello World" >> >> ?? Print sText[1] 'prints "e" >> ?? Print sText[0] 'prints "H" >> >> appears to demonstrate that strings are indexed starting with 0. However, string functions seem to use a 1-based index. >> >> What's the reason for this discrepancy? >> >> > > The array syntax was introduced recently for people who prefer it, so the documentation is not up to date. > > And array indexes start at 0. But string functions count from 1, because of BASIC legacy. > Okay, good. I have updated the documentation. Please see if it needs any correction. -- Lee From dosida at gmail.com Fri Feb 14 01:59:48 2020 From: dosida at gmail.com (Dimitris Anogiatis) Date: Thu, 13 Feb 2020 17:59:48 -0700 Subject: [Gambas-user] gb.args - Probably a dumb question but ... In-Reply-To: <1331797c-7980-8bd0-0353-2168db65987d@cogier.com> References: <9e5ec734-ed7a-7e2d-4f2a-73750b32bee6@gmail.com> <1331797c-7980-8bd0-0353-2168db65987d@cogier.com> Message-ID: Perhaps try: *Public Sub Form_Open()* * 'Dim $runtoday As Boolean = True* * Args.Begin()* * 'If Args.Has("t", "today", "Run plots for today") Then $runtoday = True* * Print *Args.Has("t", "today", "Run plots for today") *Args.End* * 'Print $runtoday* *End* Compile and run and check whether you get the correct values for Args.Has That way you'll see under what initial value you need to give to $runtoday and whether you need to modify your if slightly to get the functionality you need Hope this helps Regards, Dimtiris On Thu, Feb 13, 2020 at 9:44 AM Charlie Ogier wrote: > This code works for me. > > *Public Sub Form_Open()* > > * Dim $runtoday As Boolean = True* > > * Args.Begin()* > * If Args.Has("t", "today", "Run plots for today") Then $runtoday = True* > * Args.End* > > * Print $runtoday* > > *End* > > The result is *True* even if there is no *-t*, tested with 'global' and > local Boolean. This was done in the IDE. > > Charlie > > On 13/02/2020 09:10, Bruce wrote: > > If Args.Has("t", "today", "Run plots for today") Then $runtoday = True > > I have probably done something wrong here but if $runtoday has already > been set True then that line, if there is no "-t" on the command line seems > to set $runtoday false. > > (Unless I have done something stupid somewhere else?) > > Any clues? There doesn't seem to be a default value for "If Args.Has" > mentioned in the help docs. > > tia > b > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisml at deganius.de Fri Feb 14 10:31:56 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 14 Feb 2020 10:31:56 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> Message-ID: <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> Am 13.02.20 um 16:31 schrieb Rolf-Werner Eilert: > There are two questions I have about making an Installation Packet from > a Gambas project. > > 1. Will the package automatically install Gambas if Gambas is not yet on > the system? And if yes, which version - the one from the repos or the > one you recommend? I can speak for Debian/Ubuntu. Yes it installs Gambas. It will deny to install at all if the distributions version of Gambas is too old. The Reason lies in this line in the Debian control file inside the created package, for instance: > Depends: gambas3-runtime (>= 3.14), gambas3-runtime (<< 3.99.0) "Depends" is the strictest instruction for Debian, it forces the installation of the dependent. For me this is always a pain in the ass if there is a self-compiled version of Gambas on the machine, because the package manager doesn't recognize that and will install the version of the distribution over it which likely will crash the whole Gambas installation on that system. This is one of the reasons for me why I create my Debian packages via GNU Make and shell scripts and not by the IDE. Btw (@Beno?t and others): Wouldn't it be better to use "recommends" or even "suggests" in the Debian control file instead of "depends"? Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From g4mba5 at gmail.com Fri Feb 14 13:21:23 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Fri, 14 Feb 2020 13:21:23 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> Message-ID: <3e894129-e03f-0975-5a04-e8685e010e2b@gmail.com> Le 14/02/2020 ? 10:31, Christof Thalhofer a ?crit?: > > Btw (@Beno?t and others): > > Wouldn't it be better to use "recommends" or even "suggests" in the > Debian control file instead of "depends"? > > Alles Gute > > Christof Thalhofer > I don't know, I'm not a Debian specialist. But for me, by default, if you create a Gambas package, it depends on the Gambas version of your system (or any other version specified in the packager dialog). Isn't it like a binary package of a perl program that depends on the perl interpreter package? -- Beno?t Minisini From g4mba5 at gmail.com Fri Feb 14 13:42:28 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Fri, 14 Feb 2020 13:42:28 +0100 Subject: [Gambas-user] /!\ WARNING ! /!\ File compression in the IDE Message-ID: Hi, This mail is a warning about a recent change in the IDE about file compression. Before that change, you had the ability to "compress" js, css and html files with two buttons : one for compress the file, one for uncompress it. Here, "compress" means rewriting the file in a more compact way to speed the download and the interpretation of the file a bit (or to obfuscate it). By the way I should have named it "compact" instead of "compress". Once compressed, the uncompressed file was stored in the ".hidden/Uncompressed" project directory. Now the compression is more transparent. - You have only one button, that toggles between compression and no compression. - The uncompressed file is stored in ".hidden/.uncompressed" instead. You don't see it anymore in the project tree. - When you edit a compressed file in the IDE, you always see the uncompress contents. If you save the file, the compressed and uncompressed versions are updated accordingly. - To be backward-compatible, if you open a project using the old compression mode, the file in ".hidden/Uncompressed" is opened instead. The first time you save the file, the uncompressed version is stored in ".hidden/.uncompressed", and the file stored in ".hidden/Uncompressed" is deleted. /!\ **** WARNING! **** /!\ Consequently, if you have compressed a file, uncompress it, and modified it, you may lose these modifications, as the uncompressed version stored in ".hidden/Uncompressed" will be used, unless its modification time is 1 minute lower than the modification time of the normal file. If someone find a better way to distinguish between the uncompressed version stored in ".hidden/Uncompressed" and the uncompressed version currently at its normal location (because modification time is not reliable, if, for example, you play with 'git'), he is welcome to share it! Regards, -- Beno?t Minisini From chrisml at deganius.de Fri Feb 14 15:45:40 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 14 Feb 2020 15:45:40 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: <3e894129-e03f-0975-5a04-e8685e010e2b@gmail.com> References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> <3e894129-e03f-0975-5a04-e8685e010e2b@gmail.com> Message-ID: Am 14.02.20 um 13:21 schrieb Beno?t Minisini: >> Wouldn't it be better to use "recommends" or even "suggests" in the >> Debian control file instead of "depends"? > I don't know, I'm not a Debian specialist. > > But for me, by default, if you create a Gambas package, it depends on > the Gambas version of your system (or any other version specified in the > packager dialog). > > Isn't it like a binary package of a perl program that depends on the > perl interpreter package? Yes you are right. It is so. With "Depends:" apt cannot be hindered to install the Gambas runtime and components at all. But if the IDE would package with "Recommends:" instead of "Depends:" one could install the package with: apt-get --no-install-recommends install package-xyz.deb And it would not install Gambas from the distribution. This is quite handy if you have a self-compiled Gambas version on that computer. With "Recommends:" apt installs the Gambas runtime and every component needed by default if invoked with: apt-get install package-xyz.deb ... which is the standard way to install Debian packages. --- But maybe I am the only one who wants to deploy a Gambas program as Debian package without installing the distribution's Gambas at a special machine at all. If that's the case, don't mind. I am packaging most of my Gambas programs with Make. Alles Gute Christof Thalhofer -- [x] nail here for new monitor From g4mba5 at gmail.com Fri Feb 14 15:52:25 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Fri, 14 Feb 2020 15:52:25 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> <3e894129-e03f-0975-5a04-e8685e010e2b@gmail.com> Message-ID: Le 14/02/2020 ? 15:45, Christof Thalhofer a ?crit?: > Am 14.02.20 um 13:21 schrieb Beno?t Minisini: > >>> Wouldn't it be better to use "recommends" or even "suggests" in the >>> Debian control file instead of "depends"? > >> I don't know, I'm not a Debian specialist. >> >> But for me, by default, if you create a Gambas package, it depends on >> the Gambas version of your system (or any other version specified in the >> packager dialog). >> >> Isn't it like a binary package of a perl program that depends on the >> perl interpreter package? > > Yes you are right. It is so. > > With "Depends:" apt cannot be hindered to install the Gambas runtime and > components at all. > > But if the IDE would package with "Recommends:" instead of "Depends:" > one could install the package with: > > apt-get --no-install-recommends install package-xyz.deb > > And it would not install Gambas from the distribution. This is quite > handy if you have a self-compiled Gambas version on that computer. > > With "Recommends:" apt installs the Gambas runtime and every component > needed by default if invoked with: > > apt-get install package-xyz.deb > > ... which is the standard way to install Debian packages. > > --- > > But maybe I am the only one who wants to deploy a Gambas program as > Debian package without installing the distribution's Gambas at a special > machine at all. If that's the case, don't mind. I am packaging most of > my Gambas programs with Make. > > > Alles Gute > > Christof Thalhofer > i didn't know. Is it the standard way of specifying dependencies of programs needing an interpreter? -- Beno?t Minisini From t.lee.davidson at gmail.com Fri Feb 14 16:02:18 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Fri, 14 Feb 2020 10:02:18 -0500 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> Message-ID: On 2/14/20 4:31 AM, Christof Thalhofer wrote: > For me this is always a pain in the ass if there is a self-compiled > version of Gambas on the machine, because the package manager doesn't > recognize that and will install the version of the distribution over it > which likely will crash the whole Gambas installation on that system. Couldn't this problem be resolved by making a package from the self-compiled version of Gambas and installing that (as opposed to `make install`)? This way the package manager would recognize that Gambas is already installed. It doesn't make sense to me to tag an interpreter as recommended when it is a dependency. -- Lee From chrisml at deganius.de Fri Feb 14 16:38:30 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 14 Feb 2020 16:38:30 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> <3e894129-e03f-0975-5a04-e8685e010e2b@gmail.com> Message-ID: Am 14.02.20 um 15:52 schrieb Beno?t Minisini: > i didn't know. Is it the standard way of specifying dependencies of > programs needing an interpreter? No. The standard way is always Depends. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Fri Feb 14 17:06:15 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 14 Feb 2020 17:06:15 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> Message-ID: Am 14.02.20 um 16:02 schrieb T Lee Davidson: > Couldn't this problem be resolved by making a package from the > self-compiled version of Gambas and installing that (as opposed to > `make install`)? This way the package manager would recognize that > Gambas is already installed. Not always, see below. > It doesn't make sense to me to tag an interpreter as recommended when > it is a dependency. Yes. I think you are right. I thought the usage of "Recommends:" theoretically would not harm in any way. To explain the background: I package a couple of programs for Debian/Ubuntu machines, some of them as components in the normal way to package things with the Gambas IDE. If I would like to try out a new Gambas development version, maybe to test, if it breaks any of my programs or something else, I cannot remove the distributions Gambas whithout removing these programs and I cannot install one of these without installing Gambas from the distribution. But anyway: I just read the admin handbook of Debian: > https://debian-handbook.info/browse/stable/sect.package-meta-information.html They are clear in their advice: "The ?recommended? dependencies, the most important, considerably improve the functionality offered by the package but are not indispensable to its operation." So my idea is against the Debian way. Please forget it. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From t.lee.davidson at gmail.com Sat Feb 15 00:31:38 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Fri, 14 Feb 2020 18:31:38 -0500 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> Message-ID: <6588f088-c19b-467e-dde7-c15d362d3fba@gmail.com> On 2/14/20 11:06 AM, Christof Thalhofer wrote: > I package a couple of programs for Debian/Ubuntu machines, some of them > as components in the normal way to package things with the Gambas IDE. > > If I would like to try out a new Gambas development version, maybe to > test, if it breaks any of my programs or something else, I cannot remove > the distributions Gambas whithout removing these programs and I cannot > install one of these without installing Gambas from the distribution. It sounds as though it might be useful to be able to have packaged and self-compiled versions of Gambas coexist on the same machine. As far as I know, that's not possible at present. I don't know about Aptitude, but RPM has a '--nodeps' option (don't verify package dependencies). -- Lee From adamnt42 at gmail.com Sat Feb 15 02:04:04 2020 From: adamnt42 at gmail.com (Bruce) Date: Sat, 15 Feb 2020 11:34:04 +1030 Subject: [Gambas-user] gb.args - Probably a dumb question but ... In-Reply-To: References: <9e5ec734-ed7a-7e2d-4f2a-73750b32bee6@gmail.com> <1331797c-7980-8bd0-0353-2168db65987d@cogier.com> Message-ID: Thanks guys. Me=dumb, looking at the wrong symptom of the problem I was having. b From g4mba5 at gmail.com Sat Feb 15 13:16:42 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Sat, 15 Feb 2020 13:16:42 +0100 Subject: [Gambas-user] Immutable strings and c functions returning allocated blocks, mmaped strings/objects In-Reply-To: <460582286.6940.1581753081354.JavaMail.zimbra@westwoodsvcs.com> References: <460582286.6940.1581753081354.JavaMail.zimbra@westwoodsvcs.com> Message-ID: Le 15/02/2020 ? 08:51, Brian G a ?crit?: > I am having an interesting time with functions that return allocated > blocks that represent zero terminated strings > > such as gnu readline(prompt as string) as string. This function provided > and editable line on the terminal, it returns the input as a string > buffer allocated from the heap. I do this from some c functions as well, > but into the shared memory buffers used by task to transfer information. > The Returned pointer is freed after use, but bad pointers are left. > > It appears that You have implemented string as an immutable value, even > mid simply return a pointer in the original string and manages a length > internally without changing the string or making any copy, which is fast. > > no matter what you do, the string is immutable, so a = b, just creates a > copy of a pointer to the original string, its immutable right. > so adding it to a collection, or string array, or anything else leaves a > bad pointer when its freed later. Strange and unpredictable results. How > does the garbage collector handle the pointers if the value is not freed > and the variable goes out of scope. It appears to sometimes cause a > crash, could just be my bad code. > > The same issue arises with shared memory segment, that contains string > information. Instead this time the pointers are all into the area not > managed by the Gambas gc. When the variables assigned for example with s > = string@(pSharedMem) ?goes out of scope > what happens? Does that change if a global points to the same string in > shared memory as well?... umm Boom segfault, if the unmap is done before > the variable goes out of scope. > > How is it handled, should I be making copies of strings, is there a way > to tell the gc not to collect pointers for certain variables when they > go out of scope. > This is a little complex, but I am running into some of these issues, > there seems to be only one way of getting a copy right now, that's x = > string(1,string@(pointer)) maybe there is a faster way. Is the gc smart > enough to know that a pointer is used in a higher level scope. > > Does the new index on a string take into account the immutable nature ? > eg, a = "asdasdadsad": b = mid(a,2,4) : a[3] = 34 or does it > create a new copy on changing a value? > > If you can help me understand this so I can find a fast work around or > solution.. > > Thank You > Brian G > The Gambas strings belong to the interpreter. So don't send a pointer on a Gambas string to a C function, unless the argument is 'const char *'. String@() returns a lazy copy of the pointed string (i.e. a constant string that is transformed into an immutable copy of the string when needed). It requires that the pointer does not disappear of course behind the scene, so you have to use a trick to ensure a copy is done immediately (like the one you did for example). This is one of the reason why I try to never use shared memory, and use serialization through a pipe instead. The other one being synchronization problems. Regards, -- Beno?t Minisini From taboege at gmail.com Sat Feb 15 15:41:02 2020 From: taboege at gmail.com (Tobias Boege) Date: Sat, 15 Feb 2020 15:41:02 +0100 Subject: [Gambas-user] Immutable strings and c functions returning allocated blocks, mmaped strings/objects In-Reply-To: References: <460582286.6940.1581753081354.JavaMail.zimbra@westwoodsvcs.com> Message-ID: <20200215144102.GH990035@highrise.localdomain> On Sat, 15 Feb 2020, Beno?t Minisini wrote: > Le 15/02/2020 ? 08:51, Brian G a ?crit?: > > I am having an interesting time with functions that return allocated > > blocks that represent zero terminated strings > > > > such as gnu readline(prompt as string) as string. This function provided > > and editable line on the terminal, it returns the input as a string > > buffer allocated from the heap. I do this from some c functions as well, > > but into the shared memory buffers used by task to transfer information. > > The Returned pointer is freed after use, but bad pointers are left. > > > > It appears that You have implemented string as an immutable value, even > > mid simply return a pointer in the original string and manages a length > > internally without changing the string or making any copy, which is > > fast. > > > > no matter what you do, the string is immutable, so a = b, just creates a > > copy of a pointer to the original string, its immutable right. > > so adding it to a collection, or string array, or anything else leaves a > > bad pointer when its freed later. Strange and unpredictable results. How > > does the garbage collector handle the pointers if the value is not freed > > and the variable goes out of scope. It appears to sometimes cause a > > crash, could just be my bad code. > > > > The same issue arises with shared memory segment, that contains string > > information. Instead this time the pointers are all into the area not > > managed by the Gambas gc. When the variables assigned for example with s > > = string@(pSharedMem) ?goes out of scope > > what happens? Does that change if a global points to the same string in > > shared memory as well?... umm Boom segfault, if the unmap is done before > > the variable goes out of scope. > > > > How is it handled, should I be making copies of strings, is there a way > > to tell the gc not to collect pointers for certain variables when they > > go out of scope. > > This is a little complex, but I am running into some of these issues, > > there seems to be only one way of getting a copy right now, that's x = > > string(1,string@(pointer)) maybe there is a faster way. Is the gc smart > > enough to know that a pointer is used in a higher level scope. To give you a more concrete idea of what's happening: the "garbage collector" in Gambas is just plain old reference counting. So no, the garbage collector is not smart enough for just about any lifetime analysis. All of it happens at runtime. If you use a value, you borrow a ref, if you don't need it any- more, you release the ref. This is done automatically if you write in Gambas and semi-automatically if you use the interpreter C API. Note that the very act of keeping the reference count requires you to import any data into the Gambas interpreter's structs, most robustly by copying it, so that Gambas can manage its copy normally. As long as a value is referenced somewhere, it survives. Do not think about it in terms of scope. A variable (in scope) referencing a value keeps its ref count above zero, but the value itself exists independently of the variable that holds a reference to it. If you assign the same value into a Collection or an Array or a property of an object, that's another reference to the value. If the original variable goes out of scope, the value's ref count is reduced but the value is not destroyed, because the Collection or whatever now keeps the ref count positive. It is not possible (barring incorrectness of Gambas' memory management) that a dangling pointer to a Gambas-owned value exists in some Gambas container because it sitting in there keeps the value from being destroyed. If you can make the interpreter crash because of double frees, then either you do something forbidden or the interpreter's ref counting mechanism has a bug. Please show a minimal example of such a crash. Another way to make Gambas crash is to smuggle a string pointer into its system which does not sit inside a proper Gambas STRING struct (which seems to be what you're after, but I doubt that this is possible from a Gambas program). If you want to keep a value around indefinitely, simply increase its ref count without the intention of decreasing it, but this would be called a memory leak. I do not think that manipulating ref counts is exposed to Gambas programs anyway. I don't know what you're trying to do, but if you want to add shared memory utilities to Gambas, I bet you would be happier with the C API, i.e. writing a native component. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk From brian at westwoodsvcs.com Sat Feb 15 23:23:17 2020 From: brian at westwoodsvcs.com (Brian G) Date: Sat, 15 Feb 2020 14:23:17 -0800 (PST) Subject: [Gambas-user] Immutable strings and c functions returning allocated blocks, mmaped strings/objects In-Reply-To: <20200215144102.GH990035@highrise.localdomain> References: <460582286.6940.1581753081354.JavaMail.zimbra@westwoodsvcs.com> <20200215144102.GH990035@highrise.localdomain> Message-ID: <407602624.7055.1581805397681.JavaMail.zimbra@westwoodsvcs.com> I have attached a project which uses GNU readline(Prompt as string) as pointer This c function allocates a block of memory from the heap to return as the read buffer. The function provided as editable input line, and history etc. The returned string must be released back to the heap after use. When that happens it leaves a few hanging pointers, from this example and the program stops working... sometimes. This is just one example... I happened to want to use in a project. I can avoid this, write my own. but is it possible to have Gambas just drop the reference if its outside its heap, not free it. With some compile time flag. To Allow Gambas to work with memory references. It adds a tremendous amount of flexibility to the external library interface. The Shared Memory Component should Copy the buffer from application to application, not a real issue, or between tasks in Gambas. Allowing somewhat multi threaded like application development. With less OS overhead, that other transfer methods allow. I guess what I am really asking is for some way that a component could prevent or control the release of memory for objects and string etc. Thanks for your detailed and informative reply. I appreciate you taking the time. If you could have a look at the project provided as an example of what I am talking about as ?far as pointer go. I have to say that as a programming and development platform Gambas is excellent and I have used it for a number of projects and number of years. I really appreciate the work that has been put into this language and environment. The web interface builder is just amazing. Thank you for all the hard work. Thank You Brian G ----- Original Message ----- From: "Tobias Boege" To: "Gambas mailing list" Sent: Saturday, February 15, 2020 6:41:02 AM Subject: Re: [Gambas-user] Immutable strings and c functions returning allocated blocks, mmaped strings/objects On Sat, 15 Feb 2020, Beno?t Minisini wrote: > Le 15/02/2020 ? 08:51, Brian G a ?crit?: > > I am having an interesting time with functions that return allocated > > blocks that represent zero terminated strings > > > > such as gnu readline(prompt as string) as string. This function provided > > and editable line on the terminal, it returns the input as a string > > buffer allocated from the heap. I do this from some c functions as well, > > but into the shared memory buffers used by task to transfer information. > > The Returned pointer is freed after use, but bad pointers are left. > > > > It appears that You have implemented string as an immutable value, even > > mid simply return a pointer in the original string and manages a length > > internally without changing the string or making any copy, which is > > fast. > > > > no matter what you do, the string is immutable, so a = b, just creates a > > copy of a pointer to the original string, its immutable right. > > so adding it to a collection, or string array, or anything else leaves a > > bad pointer when its freed later. Strange and unpredictable results. How > > does the garbage collector handle the pointers if the value is not freed > > and the variable goes out of scope. It appears to sometimes cause a > > crash, could just be my bad code. > > > > The same issue arises with shared memory segment, that contains string > > information. Instead this time the pointers are all into the area not > > managed by the Gambas gc. When the variables assigned for example with s > > = string@(pSharedMem) ?goes out of scope > > what happens? Does that change if a global points to the same string in > > shared memory as well?... umm Boom segfault, if the unmap is done before > > the variable goes out of scope. > > > > How is it handled, should I be making copies of strings, is there a way > > to tell the gc not to collect pointers for certain variables when they > > go out of scope. > > This is a little complex, but I am running into some of these issues, > > there seems to be only one way of getting a copy right now, that's x = > > string(1,string@(pointer)) maybe there is a faster way. Is the gc smart > > enough to know that a pointer is used in a higher level scope. To give you a more concrete idea of what's happening: the "garbage collector" in Gambas is just plain old reference counting. So no, the garbage collector is not smart enough for just about any lifetime analysis. All of it happens at runtime. If you use a value, you borrow a ref, if you don't need it any- more, you release the ref. This is done automatically if you write in Gambas and semi-automatically if you use the interpreter C API. Note that the very act of keeping the reference count requires you to import any data into the Gambas interpreter's structs, most robustly by copying it, so that Gambas can manage its copy normally. As long as a value is referenced somewhere, it survives. Do not think about it in terms of scope. A variable (in scope) referencing a value keeps its ref count above zero, but the value itself exists independently of the variable that holds a reference to it. If you assign the same value into a Collection or an Array or a property of an object, that's another reference to the value. If the original variable goes out of scope, the value's ref count is reduced but the value is not destroyed, because the Collection or whatever now keeps the ref count positive. It is not possible (barring incorrectness of Gambas' memory management) that a dangling pointer to a Gambas-owned value exists in some Gambas container because it sitting in there keeps the value from being destroyed. If you can make the interpreter crash because of double frees, then either you do something forbidden or the interpreter's ref counting mechanism has a bug. Please show a minimal example of such a crash. Another way to make Gambas crash is to smuggle a string pointer into its system which does not sit inside a proper Gambas STRING struct (which seems to be what you're after, but I doubt that this is possible from a Gambas program). If you want to keep a value around indefinitely, simply increase its ref count without the intention of decreasing it, but this would be called a memory leak. I do not think that manipulating ref counts is exposed to Gambas programs anyway. I don't know what you're trying to do, but if you want to add shared memory utilities to Gambas, I bet you would be happier with the C API, i.e. writing a native component. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- A non-text attachment was scrubbed... Name: testpointers-0.0.1.tar.gz Type: application/x-compressed-tar Size: 11826 bytes Desc: not available URL: From gambas at cd-bahia.com Tue Feb 18 19:52:42 2020 From: gambas at cd-bahia.com (Dag Jarle Nerland Johansen - Gambas) Date: Tue, 18 Feb 2020 19:52:42 +0100 Subject: [Gambas-user] No event on Button click Message-ID: <6cf76bf7-b232-2df2-925b-211dde4365f5@cd-bahia.com> Hi, I have a strange behaviour on a button click. The button is placed on a panel. I get events from the other objects, f.ex. got focus on a text field reacts immediately. When I click on the button, I hear a signal, but it does not execute the code. Control_Click does not react, Control_MouseDown does. Does anyone have an idea? Thanks in advance, Dag From chrisml at deganius.de Tue Feb 18 21:51:16 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 18 Feb 2020 21:51:16 +0100 Subject: [Gambas-user] 2 questions about making an Installation Packet In-Reply-To: <6588f088-c19b-467e-dde7-c15d362d3fba@gmail.com> References: <145adb86-3297-d8ba-42dc-02dc2fd43d4e@osnanet.de> <5873e20c-a593-602e-314c-0c781d22bb88@deganius.de> <6588f088-c19b-467e-dde7-c15d362d3fba@gmail.com> Message-ID: <2f79c931-35b2-cd88-add5-15974eaf1566@deganius.de> Am 15.02.20 um 00:31 schrieb T Lee Davidson: > I don't know about Aptitude, but RPM has a '--nodeps' option (don't > verify package dependencies). Thank you for the hint. As I now read Debian's dpkg can be used to install packages and it can be used with the option --no-force-depends or --refuse-depends or --ignore-depends=xyz. Didn't try it out but it seems to do the same. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Tue Feb 18 22:11:06 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 18 Feb 2020 22:11:06 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> Message-ID: Hello Beno?t, gb.test is still alpha. In my opinion the interfaces are stable, so I would like to make it a beta version. Do you have any objections? The only thing I would like to change is to rename UnitTest.Main() to UnitTest.Run() Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From bagonergi at gmail.com Tue Feb 18 22:54:50 2020 From: bagonergi at gmail.com (Gianluigi) Date: Tue, 18 Feb 2020 22:54:50 +0100 Subject: [Gambas-user] No event on Button click In-Reply-To: <6cf76bf7-b232-2df2-925b-211dde4365f5@cd-bahia.com> References: <6cf76bf7-b232-2df2-925b-211dde4365f5@cd-bahia.com> Message-ID: Il giorno mar 18 feb 2020 alle ore 19:59 Dag Jarle Nerland Johansen - Gambas ha scritto: > Hi, > I have a strange behaviour on a button click. > The button is placed on a panel. > ... > When I click on the button, ... > Control_Click does not react,... > Hi Dag, It doesn't happen to me, I think you should attach a test where you show what you write. Regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From pebauer68 at gmail.com Wed Feb 19 00:10:42 2020 From: pebauer68 at gmail.com (Peter Bauer) Date: Wed, 19 Feb 2020 00:10:42 +0100 Subject: [Gambas-user] Why 100% CPU load on file OPEN with WATCH if data comes from a pipe ? Message-ID: Hello, Gambas 3.14, When piping like this: (program listing is on the end !) >echo ABC | ./input_reader.gambas /* pipe just 3 chars I see permanent 100% CPU load(with top) on Ubuntu 18.04.01. When using from terminal like this, there is no high CPU load: >$./input_reader.gambas >ABC /* type some text on the terminal So for the moment it does not make sense to use the File_Read() event handler with piped input. Could it be a problem with WATCH ? To reproduce please build with "make executable" and then run from the terminal. I do not see the problem when running from the Gambas IDE. Is there a workaround ? BR, Peter Listing ./input_reader.gambas: ' Gambas class file Static Public hFile1 As Stream Static Public sline As String Public Sub Form_Open() hFile1 = Open "/dev/stdin" For Input Watch hFile1.Blocking = False End Public Sub Form_Close() hFile1.close End Public Sub File_Read() ' File Read event handler While Not Eof(hFile1) Line Input #hFile1, sLine TextArea1.Insert(sLine & gb.NewLine) Wend End Public Sub Timer1_Timer() 'with 100 ms TextArea1.EnsureVisible() TextArea1.Refresh End -------------- next part -------------- An HTML attachment was scrubbed... URL: From g4mba5 at gmail.com Wed Feb 19 00:17:22 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Wed, 19 Feb 2020 00:17:22 +0100 Subject: [Gambas-user] Why 100% CPU load on file OPEN with WATCH if data comes from a pipe ? In-Reply-To: References: Message-ID: <6ecddb12-a18c-d8a4-a17c-e7d240c39485@gmail.com> Le 19/02/2020 ? 00:10, Peter Bauer a ?crit?: > Hello, > Gambas 3.14, When piping like this: (program listing is on the end !) > >echo ABC | ./input_reader.gambas? ? ?/* pipe just 3 chars > I see permanent 100% CPU load(with top) on Ubuntu 18.04.01. > When using from terminal like this, there is no high CPU load: > >$./input_reader.gambas > >ABC? ? /* type some text on the terminal > > So for the moment it does not make sense to use the File_Read() event > handler with piped input. Could it be a problem with WATCH ? To > reproduce please build with "make executable"?and then run from the > terminal. I do not see the problem when running from the Gambas IDE. Is > there a workaround ? > > BR, > Peter > > Listing ./input_reader.gambas: > ' Gambas class file > > Static Public hFile1 As Stream > Static Public sline As String > > Public Sub Form_Open() > hFile1 = Open "/dev/stdin" For Input Watch > hFile1.Blocking = False > End > > Public Sub Form_Close() > ? hFile1.close > End > > Public Sub File_Read() ? ? ? ? ? ? ? ? ? ? ? ? ?' File Read event handler > ? ? ?While Not Eof(hFile1) > ? ? ? ? ?Line Input #hFile1, sLine > ? ? ? ? ?TextArea1.Insert(sLine & gb.NewLine) > ? ? ? ? ?Wend > End > > Public Sub Timer1_Timer()? ? ? ?'with 100 ms > ? ?TextArea1.EnsureVisible() > ? ? ?TextArea1.Refresh > End > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Please send your full project. Regards, -- Beno?t Minisini From t.lee.davidson at gmail.com Wed Feb 19 01:46:55 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Tue, 18 Feb 2020 19:46:55 -0500 Subject: [Gambas-user] No event on Button click In-Reply-To: References: <6cf76bf7-b232-2df2-925b-211dde4365f5@cd-bahia.com> Message-ID: <557934f4-1f5b-91eb-e01c-395a2987ea01@gmail.com> On 2/18/20 4:54 PM, Gianluigi wrote: > > > Il giorno mar 18 feb 2020 alle ore 19:59 Dag Jarle Nerland Johansen - Gambas > > ha scritto: > > Hi, > I have a strange behaviour on a button click. > The button is placed on a panel. > ... > When I click on the button, ... > Control_Click does not react,... > > > Hi Dag, > It doesn't happen to me, I think you should attach a test where you show what you write. > > Regards > Gianluigi > I second that. It is difficult to guess how the code is written. And, an indication that something's amiss is the fact that Control does not have a Click event. Are you perhaps creating the button dynamically and giving it a custom event name? [http://gambaswiki.org/wiki/comp/gb.qt4/button/_new] -- Lee From t.lee.davidson at gmail.com Wed Feb 19 02:04:03 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Tue, 18 Feb 2020 20:04:03 -0500 Subject: [Gambas-user] Why 100% CPU load on file OPEN with WATCH if data comes from a pipe ? In-Reply-To: References: Message-ID: <093d0ffd-f8fe-52e3-90c3-32001ae0f5f0@gmail.com> On 2/18/20 6:10 PM, Peter Bauer wrote: > Gambas 3.14, When piping like this: (program listing is on the end !) > >echo ABC | ./input_reader.gambas? ? ?/* pipe just 3 chars > I see permanent 100% CPU load(with top) on Ubuntu 18.04.01. > When using from terminal like this, there is no high CPU load: > >$./input_reader.gambas > >ABC? ? /* type some text on the terminal I get consistently less than 1% CPU on openSUSE Leap 15.1. -- Lee From pebauer68 at gmail.com Wed Feb 19 07:34:23 2020 From: pebauer68 at gmail.com (Peter Bauer) Date: Wed, 19 Feb 2020 07:34:23 +0100 Subject: [Gambas-user] Fwd: Why 100% CPU load on file OPEN with WATCH if data comes from a pipe ? In-Reply-To: References: Message-ID: Von: Peter Bauer Date: Mi., 19. Feb. 2020 um 00:10 Uhr Subject: RE: Why 100% CPU load on file OPEN with WATCH if data comes from a pipe ? To: Please find the project attached. Hello, Gambas 3.14, When piping like this: (program listing is on the end !) >echo ABC | ./input_reader.gambas /* pipe just 3 chars I see permanent 100% CPU load(with top) on Ubuntu 18.04.01. When using from terminal like this, there is no high CPU load: >$./input_reader.gambas >ABC /* type some text on the terminal So for the moment it does not make sense to use the File_Read() event handler with piped input. Could it be a problem with WATCH ? To reproduce please build with "make executable" and then run from the terminal. I do not see the problem when running from the Gambas IDE. Is there a workaround ? BR, Peter Listing ./input_reader.gambas: ' Gambas class file Static Public hFile1 As Stream Static Public sline As String Public Sub Form_Open() hFile1 = Open "/dev/stdin" For Input Watch hFile1.Blocking = False End Public Sub Form_Close() hFile1.close End Public Sub File_Read() ' File Read event handler While Not Eof(hFile1) Line Input #hFile1, sLine TextArea1.Insert(sLine & gb.NewLine) Wend End Public Sub Timer1_Timer() 'with 100 ms TextArea1.EnsureVisible() TextArea1.Refresh End -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: input_reader.tar.gz Type: application/gzip Size: 13242 bytes Desc: not available URL: From bagonergi at gmail.com Wed Feb 19 16:54:38 2020 From: bagonergi at gmail.com (Gianluigi) Date: Wed, 19 Feb 2020 16:54:38 +0100 Subject: [Gambas-user] Gambas wiki don't work Message-ID: Hello to all, can you access gambaswiki? Regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From g4mba5 at gmail.com Wed Feb 19 17:02:25 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Wed, 19 Feb 2020 17:02:25 +0100 Subject: [Gambas-user] Gambas wiki don't work In-Reply-To: References: Message-ID: <44f89514-c3ed-a58e-5385-20e5d8963ac5@gmail.com> Le 19/02/2020 ? 16:54, Gianluigi a ?crit?: > Hello to all, > can you access gambaswiki? > > Regards > Gianluigi > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Nope, the server seems to be down. Can't access it with ssh. -- Beno?t Minisini From bagonergi at gmail.com Wed Feb 19 17:08:37 2020 From: bagonergi at gmail.com (Gianluigi) Date: Wed, 19 Feb 2020 17:08:37 +0100 Subject: [Gambas-user] Gambas wiki don't work In-Reply-To: <44f89514-c3ed-a58e-5385-20e5d8963ac5@gmail.com> References: <44f89514-c3ed-a58e-5385-20e5d8963ac5@gmail.com> Message-ID: Il giorno mer 19 feb 2020 alle ore 17:03 Beno?t Minisini ha scritto: > Le 19/02/2020 ? 16:54, Gianluigi a ?crit : > > Hello to all, > > can you access gambaswiki? > > > > Regards > > Gianluigi > > > > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > > > > Nope, the server seems to be down. Can't access it with ssh. > > -- > Beno?t Minisini > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Ok, thank you Regards Gianluigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlie at cogier.com Wed Feb 19 17:03:27 2020 From: charlie at cogier.com (Charlie Ogier) Date: Wed, 19 Feb 2020 16:03:27 +0000 Subject: [Gambas-user] Gambas wiki don't work In-Reply-To: References: Message-ID: <0a1fac84-5826-b681-121f-cb923e771301@cogier.com> I can't...... On 19/02/2020 15:54, Gianluigi wrote: > Hello to all, > can you access gambaswiki? > > Regards > Gianluigi > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From bagonergi at gmail.com Wed Feb 19 17:59:39 2020 From: bagonergi at gmail.com (Gianluigi) Date: Wed, 19 Feb 2020 17:59:39 +0100 Subject: [Gambas-user] Gambas wiki don't work In-Reply-To: <0a1fac84-5826-b681-121f-cb923e771301@cogier.com> References: <0a1fac84-5826-b681-121f-cb923e771301@cogier.com> Message-ID: Hi Charlie, unfortunately I receive your answers late, thank you. Now it works (without ssh) Regards Gianluigi Il giorno mer 19 feb 2020 alle ore 17:27 Charlie Ogier ha scritto: > I can't...... > > > On 19/02/2020 15:54, Gianluigi wrote: > > Hello to all, > can you access gambaswiki? > > Regards > Gianluigi > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.lee.davidson at gmail.com Wed Feb 19 18:16:58 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Wed, 19 Feb 2020 12:16:58 -0500 Subject: [Gambas-user] Fwd: Why 100% CPU load on file OPEN with WATCH if data comes from a pipe ? In-Reply-To: References: Message-ID: <40ee5742-7f17-ca01-5c8d-7eacbe81c732@gmail.com> On 2/19/20 1:34 AM, Peter Bauer wrote: > Hello, > Gambas 3.14, When piping like this: (program listing is on the end !) > >echo ABC | ./input_reader.gambas? ? ?/* pipe just 3 chars > I see permanent 100% CPU load(with top) on Ubuntu 18.04.01. > When using from terminal like this, there is no high CPU load: > >$./input_reader.gambas > >ABC? ? /* type some text on the terminal It is GTK that is causing that. The program works fine with Qt5. -- Lee From brian at westwoodsvcs.com Thu Feb 20 07:32:03 2020 From: brian at westwoodsvcs.com (Brian G) Date: Wed, 19 Feb 2020 22:32:03 -0800 (PST) Subject: [Gambas-user] Just tried to do a merge request for scripter Message-ID: <63084216.8641.1582180323839.JavaMail.zimbra@westwoodsvcs.com> Just tried to do a merge request for scripter, not sure its all there should be two file but I only saw one. Can someone help me get this right! Added a warning flag -w or --warn two files updated the module and the description file Thank You Brian G -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlie at cogier.com Fri Feb 21 17:43:44 2020 From: charlie at cogier.com (Charlie Ogier) Date: Fri, 21 Feb 2020 16:43:44 +0000 Subject: [Gambas-user] Minor IDE issues Message-ID: Hi All, I note that there is a 'Group' property for a Form. You can't use it but it is there. Should it be? If you put a Breakpoint or 'Stop' in your program, run the program until it stops. You should not be able to change the code but if you use the very useful [Alt]+[Up Arrow] (or Down) the text can be moved. I've not tested this to find if it breaks anything but.... Charlie From chrisml at deganius.de Fri Feb 21 18:39:05 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 21 Feb 2020 18:39:05 +0100 Subject: [Gambas-user] Minor IDE issues In-Reply-To: References: Message-ID: Am 21.02.20 um 17:43 schrieb Charlie Ogier: > very useful [Alt]+[Up Arrow] (or Down) the text can be moved. Hah, ultracool! I never realized it exists! :-) Alles Gute Christof Thalhofer -- [x] nail here for new monitor From brian at westwoodsvcs.com Sat Feb 22 01:06:58 2020 From: brian at westwoodsvcs.com (Brian G) Date: Fri, 21 Feb 2020 16:06:58 -0800 (PST) Subject: [Gambas-user] Updated Scripter to allow Lib to be included Message-ID: <507136961.9116.1582330018707.JavaMail.zimbra@westwoodsvcs.com> Fabien I attach a copy of Scripter which allows the inclusion of Libraries into the compiled application. This is done with the use of the Lib directive eg. lib "company.diadic" After investigation about compiler, It will allow a full path name for libraries. so I have changed it to to search .local/gambas&version/lib/name&".gambas" and /usr/lib/gambas&version/lib/name&".gambas", as well as just use the provided name&".gambas" This seems to work and execute correctly. Would you be able to review this fits with your original design and if so I will submit this change for merge. I am worried about dependencies although it seems to work in my testing so far. Thank You Brian G -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gbs3-3.14.90.tar.gz Type: application/x-compressed-tar Size: 27995 bytes Desc: not available URL: From g4mba5 at gmail.com Sat Feb 22 14:00:06 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Sat, 22 Feb 2020 14:00:06 +0100 Subject: [Gambas-user] Updated Scripter to allow Lib to be included In-Reply-To: <507136961.9116.1582330018707.JavaMail.zimbra@westwoodsvcs.com> References: <507136961.9116.1582330018707.JavaMail.zimbra@westwoodsvcs.com> Message-ID: Le 22/02/2020 ? 01:06, Brian G a ?crit?: > Fabien > > I attach a copy of Scripter which allows the inclusion of Libraries into > the compiled application. > > This is done with the use of the Lib directive eg. lib "company.diadic" > > After investigation about compiler, It will allow a full path name for > libraries. so I have changed it to to search > .local/gambas&version/lib/name&".gambas" and > /usr/lib/gambas&version/lib/name&".gambas", as well as just use the > provided name&".gambas" > > This seems to work and execute correctly. > > Would you be able to review this fits with your original design and if > so I will submit this change for merge. > > I am worried about dependencies although it seems to work in my testing > so far. > > Thank You > Brian G > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Hi Brian, 1) Why did you make three merge requests? What should I do with them? 2) Why do you introduce a new keyword "LIB"? (That is not actually a new keyword until the compiler supports it). Why don't you use the "USE" keyword instead? 3) Why did you replace ? Exec ["md5sum", $sPath] To $sMd5 ? by ? Shell "md5sum " & $sPath To $sMd5 ? ? Which is by the way false as you don't quote the '$sPath' argument. 4) If you want to concatenate path elements, you have to use the '&/' operator. 5) Why did you call the option "--warn" and not "--warnings" as in the compiler? Regards, -- Beno?t Minisini From g4mba5 at gmail.com Sat Feb 22 14:42:01 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Sat, 22 Feb 2020 14:42:01 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> Message-ID: <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> Le 18/02/2020 ? 22:11, Christof Thalhofer a ?crit?: > Hello Beno?t, > > gb.test is still alpha. In my opinion the interfaces are stable, so I > would like to make it a beta version. Do you have any objections? > > The only thing I would like to change is to rename > UnitTest.Main() to UnitTest.Run() > > Alles Gute > > Christof Thalhofer > > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > If I add support for test modules in the IDE, would you use it first? The idea is that every source file with 'test' extension is a module, except that the compiler will generate a list of these modules in a file, so that the interpreter and/or the 'gb.test' component automatically get all test classes. Of course, it means that a test module cannot have the same name as any other source file. -- Beno?t Minisini From g4mba5 at gmail.com Sat Feb 22 16:04:19 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Sat, 22 Feb 2020 16:04:19 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> Message-ID: Le 22/02/2020 ? 14:42, Beno?t Minisini a ?crit?: > > If I add support for test modules in the IDE, would you use it first? > > The idea is that every source file with 'test' extension is a module, > except that the compiler will generate a list of these modules in a > file, so that the interpreter and/or the 'gb.test' component > automatically get all test classes. > > Of course, it means that a test module cannot have the same name as any > other source file. > OK, support for test modules has been added in the compiler, the archiver and the development environment in the last commit. Now we should link that to how gb.test works (if there is something to do), and add an option to the interpreter that tells him to run the tests (some of them, all of them...). That option can just be a string that is sent to an hardcoded 'gb.test' method that will interpret it and do the job. Is it possible to add to the IDE a button that run the tests and display the result in a nice GUI, provided that the text returned by the test is in a standard format? (I think then that the test output cannot be sent to the standard output or the error output of the process). Regards, -- Beno?t Minisini From brian at westwoodsvcs.com Sat Feb 22 19:53:00 2020 From: brian at westwoodsvcs.com (Brian G) Date: Sat, 22 Feb 2020 18:53:00 +0000 (UTC) Subject: [Gambas-user] Updated Scripter to allow Lib to be included In-Reply-To: References: <507136961.9116.1582330018707.JavaMail.zimbra@westwoodsvcs.com> Message-ID: <605B1DED34848F44.e2c3c41b-5b1e-4ff5-abe1-5b85c5a8bbcf@mail.outlook.com> 1 I made the other merge requests by accident, I was learning how to do that. They can all be deleted or closed thank you brian On Sat, Feb 22, 2020 at 5:01 AM -0800, "Beno?t Minisini" wrote: Le 22/02/2020 ? 01:06, Brian G a ?crit?: > Fabien > > I attach a copy of Scripter which allows the inclusion of Libraries into > the compiled application. > > This is done with the use of the Lib directive eg. lib "company.diadic" > > After investigation about compiler, It will allow a full path name for > libraries. so I have changed it to to search > .local/gambas&version/lib/name&".gambas" and > /usr/lib/gambas&version/lib/name&".gambas", as well as just use the > provided name&".gambas" > > This seems to work and execute correctly. > > Would you be able to review this fits with your original design and if > so I will submit this change for merge. > > I am worried about dependencies although it seems to work in my testing > so far. > > Thank You > Brian G > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Hi Brian, 1) Why did you make three merge requests? What should I do with them? 2) Why do you introduce a new keyword "LIB"? (That is not actually a new keyword until the compiler supports it). Why don't you use the "USE" keyword instead? 3) Why did you replace ? Exec ["md5sum", $sPath] To $sMd5 ? by ? Shell "md5sum " & $sPath To $sMd5 ? ? Which is by the way false as you don't quote the '$sPath' argument. 4) If you want to concatenate path elements, you have to use the '&/' operator. 5) Why did you call the option "--warn" and not "--warnings" as in the compiler? Regards, -- Beno?t Minisini ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at westwoodsvcs.com Sat Feb 22 20:07:40 2020 From: brian at westwoodsvcs.com (Brian G) Date: Sat, 22 Feb 2020 19:07:40 +0000 (UTC) Subject: [Gambas-user] Updated Scripter to allow Lib to be included In-Reply-To: <605B1DED34848F44.e2c3c41b-5b1e-4ff5-abe1-5b85c5a8bbcf@mail.outlook.com> References: <507136961.9116.1582330018707.JavaMail.zimbra@westwoodsvcs.com> <605B1DED34848F44.e2c3c41b-5b1e-4ff5-abe1-5b85c5a8bbcf@mail.outlook.com> Message-ID: <605B1DED34848F44.395c7d94-d5d9-4f7e-8c1f-328671b0cb01@mail.outlook.com> 2 the lib keyword is only used by the scripter, it passes the library key in the project file, does not require any changes to the compiler at all. The library uses a different path than the components. So I used that as a way of denoting the difference. I can change to use the full word library... Would that be acceptable. 3 this version was not final and the exec sometimes during testing did not stop and wait in the debugger, I was trying to figure that out. Exec works correctly at runtime without the debugger. I think I just commented it out for testing. 4 I will change that to use /& 5 I can change that to warnings. The version I sent out was a first pass, I have a lot to learn about this process. Sorry I did decide to add the lib support after doing the support for warnings. I will make the changes and send it out again. I appreciate the feedback, I hope to do a little better next time My biggest concern in this version was library dependencies and how they are resolved. thank you brian On Sat, Feb 22, 2020 at 11:04 AM -0800, "Brian G" wrote: 1 I made the other merge requests by accident, I was learning how to do that. They can all be deleted or closed thank you brian On Sat, Feb 22, 2020 at 5:01 AM -0800, "Beno?t Minisini" wrote: Le 22/02/2020 ? 01:06, Brian G a ?crit?: > Fabien > > I attach a copy of Scripter which allows the inclusion of Libraries into > the compiled application. > > This is done with the use of the Lib directive eg. lib "company.diadic" > > After investigation about compiler, It will allow a full path name for > libraries. so I have changed it to to search > .local/gambas&version/lib/name&".gambas" and > /usr/lib/gambas&version/lib/name&".gambas", as well as just use the > provided name&".gambas" > > This seems to work and execute correctly. > > Would you be able to review this fits with your original design and if > so I will submit this change for merge. > > I am worried about dependencies although it seems to work in my testing > so far. > > Thank You > Brian G > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Hi Brian, 1) Why did you make three merge requests? What should I do with them? 2) Why do you introduce a new keyword "LIB"? (That is not actually a new keyword until the compiler supports it). Why don't you use the "USE" keyword instead? 3) Why did you replace ? Exec ["md5sum", $sPath] To $sMd5 ? by ? Shell "md5sum " & $sPath To $sMd5 ? ? Which is by the way false as you don't quote the '$sPath' argument. 4) If you want to concatenate path elements, you have to use the '&/' operator. 5) Why did you call the option "--warn" and not "--warnings" as in the compiler? Regards, -- Beno?t Minisini ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisml at deganius.de Sat Feb 22 21:28:32 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sat, 22 Feb 2020 21:28:32 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> Message-ID: Am 22.02.20 um 16:04 schrieb Beno?t Minisini: >> If I add support for test modules in the IDE, would you use it first? Sure! >> The idea is that every source file with 'test' extension is a module, >> except that the compiler will generate a list of these modules in a >> file, so that the interpreter and/or the 'gb.test' component >> automatically get all test classes. >> >> Of course, it means that a test module cannot have the same name as any >> other source file. > > OK, support for test modules has been added in the compiler, the > archiver and the development environment in the last commit. Ok very cool!! > Now we should link that to how gb.test works (if there is something to > do), and add an option to the interpreter that tells him to run the > tests (some of them, all of them...). > > That option can just be a string that is sent to an hardcoded 'gb.test' > method that will interpret it and do the job. Ok, I'll look at it soon! > Is it possible to add to the IDE a button that run the tests Concerning the IDE I think it would be necessary to use a F-Key primarily (I would prefer F4) because if you do test driven programming you will hit it instead of F5 and as often as F5. A button would be optional (and only used by notorious mousejockeys). > and display > the result in a nice GUI, provided that the text returned by the test is > in a standard format? The output of gb.test is a standard format. It is TAP. http://testanything.org/ *gb.test is a TAP producer* We later can be member of this illustrious list of producers: http://testanything.org/producers.html For GUI we have to write a so called *TAP consumer* which is able to parse and display the output. But theoretically every other TAP consumer could be used. Even if it is written in another language. > (I think then that the test output cannot be sent > to the standard output or the error output of the process). Sorry, but IMO this is a must! Think of automatic testing: Think of testing, compiling, deployment of Gambas programs in Continuous Integration (CI) environments later where no person sits there and grabs the mouse to click a test button or hit F4 or have a look at the GUI. Think of this scenario: If you would like to push the new version of your Gambas program to the website with a shell script, maybe you would like to do this as a Git hook. If you push the code to Git master the shell script is invoked, which tests (imagine gbt3), compiles (gbc3), packes (gba3) and then rsyncs the program to the website. This procedure is stopped if a test failed, and you are notified by a mail which contains the failure text. This can only be done if a "gbt3 projectxyz" produces TAP as standard output. I am not sure how this can be realized, but meanwhile I think we should create gbt3 which could contain the execution part of gb.test which is Unittest.Main() and some necessary classes. The IDE could (after hit F4) compile the project, then invoke gbt3, grab the TAP output, parse and display it. But gbt3 could be used independently of the IDE, as gbc3, gba3 and so on. What do you think about it? Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sat Feb 22 22:06:25 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sat, 22 Feb 2020 22:06:25 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> Message-ID: Am 22.02.20 um 16:04 schrieb Beno?t Minisini: > OK, support for test modules has been added in the compiler, the > archiver and the development environment in the last commit. If I create a minimal project with a startmodule/procedure and a testmodule test1.test and then hit F5 the IDE says "file not found" and then "fault (core dumped) in Segmentation". Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From g4mba5 at gmail.com Sat Feb 22 22:15:06 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Sat, 22 Feb 2020 22:15:06 +0100 Subject: [Gambas-user] Updated Scripter to allow Lib to be included In-Reply-To: <605B1DED34848F44.395c7d94-d5d9-4f7e-8c1f-328671b0cb01@mail.outlook.com> References: <507136961.9116.1582330018707.JavaMail.zimbra@westwoodsvcs.com> <605B1DED34848F44.e2c3c41b-5b1e-4ff5-abe1-5b85c5a8bbcf@mail.outlook.com> <605B1DED34848F44.395c7d94-d5d9-4f7e-8c1f-328671b0cb01@mail.outlook.com> Message-ID: <3e0634f7-3966-d1a0-4871-0f1c97bb235e@gmail.com> Le 22/02/2020 ? 20:07, Brian G a ?crit?: > 2 the lib keyword is only used by the scripter, it passes the library > key in the project file, does not require any changes to the compiler at > all. The library uses a different path than the components. So I used > that as a way of denoting the difference. I can change to use the full > word library... Would that be acceptable. The problem is that it is one more keyword, and I think we can get rid of it. See below. > 3 this version was not final and the exec sometimes during testing did > not stop and wait in the debugger, I was trying to figure that out. Exec > works correctly at runtime without the debugger. I think I just > commented it out for testing. Strange... > 4 I will change that to use /& > 5 I can change that to warnings. > The version I sent out was a first pass, I have a lot to learn about > this process. Sorry > I did decide to add the lib support after doing the support for warnings. > I will make the changes and send it out again. > I appreciate the feedback, I hope to do a little better next time > My biggest concern in this version was library dependencies and how they > are resolved. > > thank you > brian > About the "USE" keyword and libraries: For the interpreter, there is no real difference between a component or a library. For it, everything is a component that can have a part in a binary shared library and another part in a Gambas executable. It's the syntax of the string given in the project file that makes the difference. If that string begins with a '/' or a ':', then we have a library, otherwise whe have a component. For a component, the string is the component name ('gb.xxxx'), and the component files are searched in the Gambas system component directory (usually '/usr/lib/gambas3/'). If the string begins with ':', then it must have the form ':/:'. '' gives you the name of the library, and the library path is '~/.local/share/gambas3/lib//:.gambas'. If the string begins with '/', then it is the absolute path of the library file, and the name of the library is the name of the file without the extension. The IDE does not allow to specify a library with an absolute path (hopefully). It's something implemented to load a library at runtime with the Component.Load() method. As the syntax ':/:" is hidden, and was done that way to be fast to parse for the interpreter, I think we can choose another syntax, that still can be used with the "USE" keyword. For example: USE "gb.xxxx" -> component USE ".:" -> library 'gbs3' can check the provided names when compiling the script. -- Beno?t Minisini From g4mba5 at gmail.com Sat Feb 22 22:20:01 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Sat, 22 Feb 2020 22:20:01 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> Message-ID: <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> Le 22/02/2020 ? 22:06, Christof Thalhofer a ?crit?: > Am 22.02.20 um 16:04 schrieb Beno?t Minisini: > >> OK, support for test modules has been added in the compiler, the >> archiver and the development environment in the last commit. > > If I create a minimal project with a startmodule/procedure and a > testmodule test1.test and then hit F5 the IDE says "file not found" and > then "fault (core dumped) in Segmentation". > > Alles Gute > > Christof Thalhofer > Please send me your small project. -- Beno?t Minisini From g4mba5 at gmail.com Sat Feb 22 22:43:54 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Sat, 22 Feb 2020 22:43:54 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> Message-ID: Le 22/02/2020 ? 22:20, Beno?t Minisini a ?crit?: > Le 22/02/2020 ? 22:06, Christof Thalhofer a ?crit?: >> Am 22.02.20 um 16:04 schrieb Beno?t Minisini: >> >>> OK, support for test modules has been added in the compiler, the >>> archiver and the development environment in the last commit. >> >> If I create a minimal project with a startmodule/procedure and a >> testmodule test1.test and then hit F5 the IDE says "file not found" and >> then "fault (core dumped) in Segmentation". >> >> Alles Gute >> >> Christof Thalhofer >> > > Please send me your small project. > It should not crash anymore with the last commit. Regards, -- Beno?t Minisini From chrisml at deganius.de Sat Feb 22 22:45:13 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sat, 22 Feb 2020 22:45:13 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> Message-ID: Am 22.02.20 um 22:20 schrieb Beno?t Minisini: > Please send me your small project. I attached it. Let's pray that Google let it go through ;-) Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: test-0.0.1.tar.gz Type: application/gzip Size: 11536 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sat Feb 22 23:19:05 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sat, 22 Feb 2020 23:19:05 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> Message-ID: Am 22.02.20 um 22:43 schrieb Beno?t Minisini: > It should not crash anymore with the last commit. Yes, it's ok now. Ah, ok, and now there is the file .test which lists testmodules. I can load its content with File.Load("./.test") Ok, cool ... I'm gonna play a bit ... tomorrow. In Germany it's late in the evening! Thank you! :-) Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sun Feb 23 11:23:22 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 23 Feb 2020 11:23:22 +0100 Subject: [Gambas-user] Silly question: How to call a modules method by name? Message-ID: <71393e08-ccab-c4f1-fe18-62ea51bc6174@deganius.de> Hello, I want to call an expression like: $sModulename & "." & sMethodname & "()" This is possible by: Eval($sModulename & "." & sMethodname & "()") But then it has to return a Value and won't stop at breakpoints. A class can be called with Object.Call(ClassObject, sMethodname) Is there something similar for a module? Thanks! Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sun Feb 23 11:41:39 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 23 Feb 2020 11:41:39 +0100 Subject: [Gambas-user] Silly question: How to call a modules method by name? In-Reply-To: <71393e08-ccab-c4f1-fe18-62ea51bc6174@deganius.de> References: <71393e08-ccab-c4f1-fe18-62ea51bc6174@deganius.de> Message-ID: <6c7361ed-0a3c-8ee4-566d-834852309097@deganius.de> Ahhm, found it: > A class can be called with > Object.Call(ClassObject, sMethodname) The same can be done with a module. Sorry! Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sun Feb 23 12:44:01 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 23 Feb 2020 12:44:01 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> Message-ID: Next step. Comitted e4f06f6674. gb.test can test itself with test modules. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sun Feb 23 12:57:22 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 23 Feb 2020 12:57:22 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <0630f88a-fe25-29ee-0a20-323a46ae26e8@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> Message-ID: <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> Am 23.02.20 um 12:44 schrieb Christof Thalhofer: > Next step. Comitted e4f06f6674. > gb.test can test itself with test modules. Next step. Committed f3413f153382. Example unittesthelloworld works with test modules. But here is the same problem: Test modules have to be exported in a project to be executed by Unittest. @Beno?t: Can test modules be exported by default? Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sun Feb 23 13:55:52 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 23 Feb 2020 13:55:52 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> References: <420ccdbf-e66e-d657-314a-de2d7a029ffd@deganius.de> <7ff1767a-1ab9-8b7e-7613-e8d73b1cfa4e@deganius.de> <70a0bde8-70f6-8815-d9d7-571182cf36c2@gmail.com> <23e2831f-b9af-9888-9950-59de89f8bdd6@deganius.de> <7fdbe3ed-dd0b-fc7f-c0e0-b5f8a46872e5@gmail.com> <748d4c92-e116-3b0d-51eb-22a78a382215@deganius.de> <03efbbdc-798b-de47-9755-0aee268440cf@deganius.de> <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> Message-ID: <5a04f1b7-64ea-92d6-5def-b3090d9b7017@deganius.de> As next step I try to write gbt3, which will be able to compile and test a project and send the result as TAP to stdout. The result can be used by a TAP consumer which also has to be written. I think Tobi already did something like that which is stored in gb.test.tap But still there is no GUI. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From taboege at gmail.com Sun Feb 23 14:35:34 2020 From: taboege at gmail.com (Tobias Boege) Date: Sun, 23 Feb 2020 14:35:34 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <5a04f1b7-64ea-92d6-5def-b3090d9b7017@deganius.de> References: <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> <5a04f1b7-64ea-92d6-5def-b3090d9b7017@deganius.de> Message-ID: <20200223133534.GN990035@highrise.localdomain> Hallo Christof, On Sun, 23 Feb 2020, Christof Thalhofer wrote: > As next step I try to write gbt3, which will be able to compile and test > a project and send the result as TAP to stdout. > > The result can be used by a TAP consumer which also has to be written. I > think Tobi already did something like that which is stored in > > gb.test.tap > > But still there is no GUI. > I'm not sure if this component already exists publicly somewhere and I am also out of the loop on Gambas testing, but what you two shared here the last few days sounds great! As chance would have it, I'm on vacation right now and wrote a TAP producer in C++ a short while ago [1], so I'm familiar with the matter. I remember there were definitely-almost-finished TAP producer and consumer in my old gb.test fork, but I'm not sure if gb.test.tap exists yet. Did you find it somewhere? If not, I can get to work immediately. Regards, Tobias [1] https://github.com/taboege/tappp-header -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From chrisml at deganius.de Sun Feb 23 16:16:07 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 23 Feb 2020 16:16:07 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <20200223133534.GN990035@highrise.localdomain> References: <95a3b121-9e5e-cfde-af69-908a5a3c3920@gmail.com> <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> <5a04f1b7-64ea-92d6-5def-b3090d9b7017@deganius.de> <20200223133534.GN990035@highrise.localdomain> Message-ID: Hi Tobi! Am 23.02.20 um 14:35 schrieb Tobias Boege: > I'm not sure if this component already exists publicly somewhere and > I am also out of the loop on Gambas testing, but what you two shared > here the last few days sounds great! Yes it looks like we're gonna get this thingi done now. > As chance would have it, I'm on vacation right now and wrote a TAP > producer in C++ a short while ago [1], so I'm familiar with the matter. > I remember there were definitely-almost-finished TAP producer and > consumer in my old gb.test fork, but I'm not sure if gb.test.tap > exists yet. Did you find it somewhere? If not, I can get to work > immediately. This is strange, I have here gb.test.tap in one workdir under comp/src but it not in master at Gitlab and if I want to push it, it is ignored by Git but I cannot see, why! Ahh, now I can see the reason. The sources are deleted (???), but there are backupfiles with a trailing "~". I attach it as a Zip file. Let us all pray Google let it go through ... ;-) There was also an old branch, look here: https://gitlab.com/gambas/gambas/-/tree/gb.test --------------------------------------------------------------- If you want to join ? my idea was like that: In the IDE one is able to define whether all tests should run or just one testmodule with even just one testmethod will be used for testing (this is important for test driven programming). (If you need it, Unittest can deliver the arrays with the names for that, there is code already written which creates these) The user hits F4 and the code runs the same way as if F5 was hit, but startup is altered to a (hidden?) module which calls Unittest.Main(Optional TestModule, Optional TestMethod). Breakpoints can be set so debugging can happen as usual. After the test the original startup is restored. If the test succeeded, there is a small green LED which lights up. If the user clicks on it, the detailed results are shown (but normally while programming this is not very interesting). The LED turns grey as soon as code is altered. If the test fails the LED lights up red and the test results are displayed by the IDE in any way but can be closed or hidden fast with the Esc key. --------------------------------------------------------------- I myself currently try to write gbt3.gambas in app/src/gbt3, which will be able to test a project at the commandline, prints out TAP and can be used for automatic testing on deployment. The idea here is that it injects a random named startmodule which let all or some tests run and afterwards restores the original startclass. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: gb.test.tap.zip Type: application/zip Size: 47160 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From taboege at gmail.com Sun Feb 23 17:16:24 2020 From: taboege at gmail.com (Tobias Boege) Date: Sun, 23 Feb 2020 17:16:24 +0100 Subject: [Gambas-user] gb.test In-Reply-To: References: <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> <5a04f1b7-64ea-92d6-5def-b3090d9b7017@deganius.de> <20200223133534.GN990035@highrise.localdomain> Message-ID: <20200223161624.GO990035@highrise.localdomain> On Sun, 23 Feb 2020, Christof Thalhofer wrote: > If you want to join ? my idea was like that: [...] > > --------------------------------------------------------------- > > I myself currently try to write gbt3.gambas in app/src/gbt3, which will > be able to test a project at the commandline, prints out TAP and can be > used for automatic testing on deployment. > The only thing I can do is to fix up and commit my gb.test.tap component, which provides you with TAP printing and parsing classes. There is nothing in there for organizing and running tests, it just deals with the TAP text format and protocol. With it you can factor out TAP printing from the tests and the parsing from your gbt3 harness or a potential future IDE harness which does green/gray/red LED toggling. In any case, it is just an implementation of both parties of a protocol in a reusable component, independent of the act of testing Gambas projects (which is gb.test's goal). Looking at your code, the Assert.module is part of gb.test.tap, as it converts runtime assertions into TAP, and your Track.module is part of the TAP producer / consumer state as well (it seems to serve both parties in gb.test). It would also affect every place in the code where you Print some TAP inline, for example in UnitTest.class. So using the gb.test.tap component would involve some refactoring of gb.test, which really just consists of deleting code. I haven't grokked yet how you implement fixtures and cherry-picking tests to run, but I have a feeling that the common "subtests" extension, which is implemented in gb.test.tap already, provides a way to model this nicely with TAP -- namely by making each *test method* into its own subtest. The test planner, which selects fixtures and test methods, can then even print the correct "plan" line at the very beginning. Those are the two things that have been on my mind about this. But first things first. I'll put up a merge request for gb.test.tap as soon as the last TODOs are eliminated, then we'll take it from there. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From chrisml at deganius.de Sun Feb 23 18:51:39 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sun, 23 Feb 2020 18:51:39 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <20200223161624.GO990035@highrise.localdomain> References: <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> <5a04f1b7-64ea-92d6-5def-b3090d9b7017@deganius.de> <20200223133534.GN990035@highrise.localdomain> <20200223161624.GO990035@highrise.localdomain> Message-ID: Am 23.02.20 um 17:16 schrieb Tobias Boege: > On Sun, 23 Feb 2020, Christof Thalhofer wrote: >> If you want to join ? my idea was like that: [...] >> >> --------------------------------------------------------------- >> >> I myself currently try to write gbt3.gambas in app/src/gbt3, which will >> be able to test a project at the commandline, prints out TAP and can be >> used for automatic testing on deployment. >> > > The only thing I can do is to fix up and commit my gb.test.tap component, > which provides you with TAP printing and parsing classes. There is nothing > in there for organizing and running tests, it just deals with the TAP text > format and protocol. With it you can factor out TAP printing from the > tests and the parsing from your gbt3 harness or a potential future IDE > harness which does green/gray/red LED toggling. In any case, it is just > an implementation of both parties of a protocol in a reusable component, > independent of the act of testing Gambas projects (which is gb.test's > goal). > > Looking at your code, the Assert.module is part of gb.test.tap, as it > converts runtime assertions into TAP, and your Track.module is part of > the TAP producer / consumer state as well (it seems to serve both parties > in gb.test). It would also affect every place in the code where you Print > some TAP inline, for example in UnitTest.class. So using the gb.test.tap > component would involve some refactoring of gb.test, which really just > consists of deleting code. > > I haven't grokked yet how you implement fixtures and cherry-picking tests > to run, but I have a feeling that the common "subtests" extension, which > is implemented in gb.test.tap already, provides a way to model this nicely > with TAP -- namely by making each *test method* into its own subtest. > The test planner, which selects fixtures and test methods, can then even > print the correct "plan" line at the very beginning. > > Those are the two things that have been on my mind about this. But first > things first. I'll put up a merge request for gb.test.tap as soon as the > last TODOs are eliminated, then we'll take it from there. Testing, cherry-picking, fixture and TAP printing is already done in gb.test (maybe it can be done better). What is needed now is the parser and integration into the IDE. If you would like to refactor gb.test and integrate your own code to make it better, feel free to do that, but please create a separate branch for that, so that we can compare afterwards. And please don't break things. gb.test tests itself, these tests are developed for more than two years now and cover most of it's behavior. There are a lot of things which were quite difficult, especially how it handles and reports errors, crashes and so on. In the meantime I have learned that neither of us invests much energy in the efforts to read and analyze the code of the other. ;-) This brought us earlier into the situation that code in gb.test.tap fulfilled the same tasks as code in gb.test (which already existed before), only different, but incompatible and difficult to combine. At least that was my feeling. We have clashed on this issue before, so I would very much like to avoid that in the future. I hope you think the same. Please don't get me wrong, I find some code you write incredibly elegant, other is difficult for me to understand and I don't always have time to bust in. I think we all feel that way. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From brian at westwoodsvcs.com Sun Feb 23 21:34:51 2020 From: brian at westwoodsvcs.com (Brian G) Date: Sun, 23 Feb 2020 12:34:51 -0800 (PST) Subject: [Gambas-user] Updated Scripter to allow Lib to be included In-Reply-To: <3e0634f7-3966-d1a0-4871-0f1c97bb235e@gmail.com> References: <507136961.9116.1582330018707.JavaMail.zimbra@westwoodsvcs.com> <605B1DED34848F44.e2c3c41b-5b1e-4ff5-abe1-5b85c5a8bbcf@mail.outlook.com> <605B1DED34848F44.395c7d94-d5d9-4f7e-8c1f-328671b0cb01@mail.outlook.com> <3e0634f7-3966-d1a0-4871-0f1c97bb235e@gmail.com> Message-ID: <2067065406.9715.1582490091784.JavaMail.zimbra@westwoodsvcs.com> OK I have attached and updated copy of Scripter for review Added --warnings Added ignore all lines except the last returned by compiler, so warning do not stop script from running Added Library support as outlined ?- looks for a : in the name to identify libraries ?- allows / at beginning to identify full paths ?- searched ~/.local/share/gambasV/lib/vendor/library:x.x ? ? - first ?- searches /usr/lib/gambasV/vendor/library:x.x ? ? ? ? ? ? ? ? ? ?- second note V = version number Added support for default minor versions ?- ? ?vendor.library:major.minor ?- ? ?vendor.library:major ? ? - this will pick up the latest minor version of the library Added always includes full path name in the Library= in the .project file Note: ?? ?The make installation package keeps the file name upper/lower case, this should probably be changed so that ?? ?user does not have to remember what case the library name contained. I think components already do this. ?? ?Maybe it would be possible to store the fast/compiled version in the library as well? ?? ?An install package also deletes any older version.This may be an issue if older apps are depending on an interface in production. ?? ?Perhaps not deleting older lib version would be a good idea? Hope this is a little better If this is ok, I will try to do a merge correctly! LOL Brian G ----- Original Message ----- From: "Beno?t Minisini" To: "Gambas mailing list" Sent: Saturday, February 22, 2020 1:15:06 PM Subject: Re: [Gambas-user] Updated Scripter to allow Lib to be included Le 22/02/2020 ? 20:07, Brian G a ?crit?: > 2 the lib keyword is only used by the scripter, it passes the library > key in the project file, does not require any changes to the compiler at > all. The library uses a different path than the components. So I used > that as a way of denoting the difference. I can change to use the full > word library... Would that be acceptable. The problem is that it is one more keyword, and I think we can get rid of it. See below. > 3 this version was not final and the exec sometimes during testing did > not stop and wait in the debugger, I was trying to figure that out. Exec > works correctly at runtime without the debugger. I think I just > commented it out for testing. Strange... > 4 I will change that to use /& > 5 I can change that to warnings. > The version I sent out was a first pass, I have a lot to learn about > this process. Sorry > I did decide to add the lib support after doing the support for warnings. > I will make the changes and send it out again. > I appreciate the feedback, I hope to do a little better next time > My biggest concern in this version was library dependencies and how they > are resolved. > > thank you > brian > About the "USE" keyword and libraries: For the interpreter, there is no real difference between a component or a library. For it, everything is a component that can have a part in a binary shared library and another part in a Gambas executable. It's the syntax of the string given in the project file that makes the difference. If that string begins with a '/' or a ':', then we have a library, otherwise whe have a component. For a component, the string is the component name ('gb.xxxx'), and the component files are searched in the Gambas system component directory (usually '/usr/lib/gambas3/'). If the string begins with ':', then it must have the form ':/:'. '' gives you the name of the library, and the library path is '~/.local/share/gambas3/lib//:.gambas'. If the string begins with '/', then it is the absolute path of the library file, and the name of the library is the name of the file without the extension. The IDE does not allow to specify a library with an absolute path (hopefully). It's something implemented to load a library at runtime with the Component.Load() method. As the syntax ':/:" is hidden, and was done that way to be fast to parse for the interpreter, I think we can choose another syntax, that still can be used with the "USE" keyword. For example: USE "gb.xxxx" -> component USE ".:" -> library 'gbs3' can check the provided names when compiling the script. -- Beno?t Minisini ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- A non-text attachment was scrubbed... Name: gbs3-3.14.90.tar.gz Type: application/x-compressed-tar Size: 28475 bytes Desc: not available URL: From chrisml at deganius.de Mon Feb 24 12:07:25 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Mon, 24 Feb 2020 12:07:25 +0100 Subject: [Gambas-user] gb.test In-Reply-To: <20200223161624.GO990035@highrise.localdomain> References: <484ad668-596e-359e-8677-30cbe3a10a75@gmail.com> <64bafd88-7979-92d6-4696-2dd7e594ca7b@deganius.de> <5a04f1b7-64ea-92d6-5def-b3090d9b7017@deganius.de> <20200223133534.GN990035@highrise.localdomain> <20200223161624.GO990035@highrise.localdomain> Message-ID: <6a02e399-32fa-6dc1-3fe6-1e1fca485b80@deganius.de> Am 23.02.20 um 17:16 schrieb Tobias Boege: > I haven't grokked yet how you implement fixtures and cherry-picking tests > to run, but I have a feeling that the common "subtests" extension, which > is implemented in gb.test.tap already, provides a way to model this nicely > with TAP -- namely by making each *test method* into its own subtest. How should the TAP output look like in this case? Maybe it is quite easy to implemented it in the current gb.test. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From g4mba5 at gmail.com Mon Feb 24 19:21:57 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Mon, 24 Feb 2020 19:21:57 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap Message-ID: Hi, This mail in mainly for Christof and Tobias... What is the difference between gb.test and gb.test.tap? I mean: for me gb.test should run the test modules and generate output in the TAP format, but what does gb.test.tap do? Otherwise, as for running the tests from 'gb.test': As Christof said, the problem is that 'gb.test' cannot see the test modules if they are not exported. Which is somewhat logical. But I don't want the test modules to be exported, they will pollute the global symbol table. So I bring the following suggestions: 1) Adding a running test option to the interpreter. (Eventually use '-t' and find another name for the tracing option). 2) The running test option will have an argument that specifies which test modules to run (everything by default). 3) The interpreter in running test mode will not run the startup class, but will load every test module, and will run a global public method in an hardcoded global public class that must be implemented by the 'gb.test' component. For example "Test.Main". It will receive the class objects in argument. This is how it will be able to access non-exported test modules and run them. 4) The '.test' file created by the compiler is still needed. It will be used by the interpreter to find the test modules. 5) That way anyone can implement another test system, provided that it implements Test.Main(). 6) I guess the test modules should have common public methods to be used by 'gb.test'. Can it be made standard? If not, it's not a big deal, as a different test system will have different assertion methods. What do you think? -- Beno?t Minisini From chrisml at deganius.de Mon Feb 24 19:48:12 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Mon, 24 Feb 2020 19:48:12 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: Message-ID: <211d9293-a397-8e0f-9251-47bdcb3cc870@deganius.de> Am 24.02.20 um 19:21 schrieb Beno?t Minisini: > This mail in mainly for Christof and Tobias... > > What is the difference between gb.test and gb.test.tap? gb.test.tap has different assertions and prints TAP more elaborated. Tobi has more experience with TAP than I and did this job much better and more elegant, as I can see. We clashed, as we discussed it a year ago where I could not see a way to integrate Tobi's wishes into gb.test. But now Tobi made a branch gb.test.tap where he married the two components and integrated gb.test.tap to gb.test. I looked at it just now and it looks beautiful. :-) > I mean: for me gb.test should run the test modules and generate output > in the TAP format, but what does gb.test.tap do? Maybe we can merge the two components into one now, maybe we let them exist in parallel (for instance if we later would want so support an alternative system to TAP). We will phone tomorrow and talk about it. For your other questions ...please let me think about it a while. But for now I am very positive and think we are on a good way to create a professional testing system for Gambas. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Mon Feb 24 22:16:42 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Mon, 24 Feb 2020 22:16:42 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <211d9293-a397-8e0f-9251-47bdcb3cc870@deganius.de> References: <211d9293-a397-8e0f-9251-47bdcb3cc870@deganius.de> Message-ID: <63038852-3779-ba83-53e7-39c3c403d22c@deganius.de> > Am 24.02.20 um 19:21 schrieb Beno?t Minisini: > >> What is the difference between gb.test and gb.test.tap? > > gb.test.tap has different assertions and prints TAP more elaborated. > Tobi has more experience with TAP than I and did this job much better > and more elegant, as I can see. Ah, forgotten: gb.test.tap lacks the ability to arrange a couple of testmodules in a "TestSuite" and let them run one after the other. This is was Unittest.Main() does in gb.test. So these two things combined do the job pretty well now. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From taboege at gmail.com Mon Feb 24 23:20:58 2020 From: taboege at gmail.com (Tobias Boege) Date: Mon, 24 Feb 2020 23:20:58 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: Message-ID: <20200224222058.GA2318325@highrise.localdomain> On Mon, 24 Feb 2020, Beno?t Minisini wrote: > Hi, > > This mail in mainly for Christof and Tobias... > > What is the difference between gb.test and gb.test.tap? > Thanks for asking this before I had a chance to post a long essay about something nobody asked for :-) > I mean: for me gb.test should run the test modules and generate output in > the TAP format, but what does gb.test.tap do? > My take is that gb.test is for running tests in Gambas projects. gb.test.tap is a reusable component for reading and writing TAP. Now let me say a few things in order to explain a few problems I have with the current gb.test and why I wrote gb.test.tap -- which is not intended as an alternative test framework but as a dependency for gb.test, to make a part of it reusable and enforce proper encapsulation. TAP is a two-party protocol. A "test" is a process which loads and uses the "system under test" (think a test module inside the project), makes assertions about function return values, errors happening or not happening, etc. Whether the assertions at runtime turn out to be true or not is reflected by "ok" / "not ok" lines printed on stdout of the test process, together with other control or diagnostic messages that may be helpful to the other side. The "test harness" is another process (think gbt3 or the IDE) which plans a series of tests, by picking test modules and methods, then runs each test, collects its TAP output and analyzes if the test was successful. gb.test currently mixes these two concerns. It does output TAP, but instead of having the other party parse it, it prints a "self-summary" in the end, for inspection by I don't know who. *Typically*, in my experience, the test process is only concerned with outputting honest TAP and then terminates, meanwhile the harness reads that TAP and rehashes it for the user. gb.test does not follow this separation and at the moment I cannot do that because it does not include a general TAP parser. TAP being a language-agnostic specification, there is a universal test harness called "prove", you probably have it installed on your system. I have a couple of tests here of which I can select three to run: $ prove -e '' t/readme.t t/like.t t/except.t t/readme.t .. ok t/like.t .... ok t/except.t .. ok All tests successful. Files=3, Tests=24, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) Result: PASS It ran the three executables (ELF binary, so no interpreter -e '' needed), read all their TAP outputs containing 24 assertions in total and summarized them briefly -- apparently everything is fine. If I had wanted the entire TAP output, I could have asked for --verbose. gb.test tries to do all of that in one process at the moment and this is a lack of separation that facilitates it doing "impure" things. Concretely I mean this https://gitlab.com/gambas/gambas/-/blob/3752088d37/comp/src/gb.test/.src/TestSuite/TestCase.class#L48 Try Object.Call($MyTestModule, Me.name) If Error Then Inc Track.Counter Track.NOKs.Add(Track.Counter) Print "not ok " & Track.Counter & " " & Track.TestModuleName & ":" & Track.TestName & " Raised error: " & Error.Text Error.Clear Endif If a *test method* raises an uncaught error, then a *test harness*-like piece of code catches it and spoofs a test failure in the TAP stream. Arguably that is not correct, semantically. If an error is raised and not caught, then the *test code* is buggy, not the *tested* code. Furthermore, this trick isn't always helpful: it only inserts one test failure when the entire test method aborted due to an error at any point, what if the test method had a couple more tests planned? Then the TAP stream will be subsequently shifted and parts will be missing but it continues to run. In the architecture I outlined above this should not be possible, as tester and testee are two separate processes, the harness can't catch Gambas errors of the test code. And the TAP protocol is designed so that tests crashing because of uncaught exceptions or even segfaults are ordinary, detectable error scenarios, which can be handled gracefully -- but of course only if the one analyzing the test does so from another process, which didn't just crash. In summary, my qualms with current gb.test is lack of separation that I know from other TAP systems. I encapsulated the TAP printing and parsing into gb.test.tap (because TAP printing was also scattered over different parts of gb.test in an ad-hoc fashion -- a "not ok" here and a few "bail out"s there). Test code should only use Assert to print TAP, harness code should use TestHarness to parse TAP. I see gb.test as a sort of trojan horse component that gets loaded by the project and, up to the current limitations, can find test modules and invoke their test methods, which in turn are part of the project, so they can test even the project's internals as thoroughly as desired. But IMO this testing should be directed from a separate process like in this flowchart (start on the top left): User selects Results are aggregated and test modules <----------- reported to the user with and methods appropriate detail (IDE or gbt3) | ^ | | | Test harness casts | `---> magic at gbx3 to run ---+ selected tests | (IDE or gbt3) | | | | | | Many instances of gbx3 set up `--> and run the specified tests, print their TAP and exit (gb.test w/ test modules) > Otherwise, as for running the tests from 'gb.test': As Christof said, the > problem is that 'gb.test' cannot see the test modules if they are not > exported. Which is somewhat logical. > > But I don't want the test modules to be exported, they will pollute the > global symbol table. > D'accord on the second point. > So I bring the following suggestions: > > 1) Adding a running test option to the interpreter. (Eventually use '-t' and > find another name for the tracing option). > > 2) The running test option will have an argument that specifies which test > modules to run (everything by default). > > 3) The interpreter in running test mode will not run the startup class, but > will load every test module, and will run a global public method in an > hardcoded global public class that must be implemented by the 'gb.test' > component. For example "Test.Main". It will receive the class objects in > argument. This is how it will be able to access non-exported test modules > and run them. > > 4) The '.test' file created by the compiler is still needed. It will be used > by the interpreter to find the test modules. > > 5) That way anyone can implement another test system, provided that it > implements Test.Main(). > > 6) I guess the test modules should have common public methods to be used by > 'gb.test'. Can it be made standard? If not, it's not a big deal, as a > different test system will have different assertion methods. > > What do you think? > Yes, this is exactly the system I had in mind, give or take a few implementation details. Special treatment in the interpreter had to come into play at some point. Keeping it open to alternative test frameworks is definitely a bonus -- though making one is not my intention at the moment. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk From g4mba5 at gmail.com Mon Feb 24 23:47:45 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Mon, 24 Feb 2020 23:47:45 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <20200224222058.GA2318325@highrise.localdomain> References: <20200224222058.GA2318325@highrise.localdomain> Message-ID: Le 24/02/2020 ? 23:20, Tobias Boege a ?crit : > > My take is that gb.test is for running tests in Gambas projects. > gb.test.tap is a reusable component for reading and writing TAP. > > Now let me say a few things in order to explain a few problems I have > with the current gb.test and why I wrote gb.test.tap -- which is not > intended as an alternative test framework but as a dependency for > gb.test, to make a part of it reusable and enforce proper > encapsulation. > > TAP is a two-party protocol. A "test" is a process which loads and > uses the "system under test" (think a test module inside the > project), makes assertions about function return values, errors > happening or not happening, etc. Whether the assertions at runtime > turn out to be true or not is reflected by "ok" / "not ok" lines > printed on stdout of the test process, together with other control or > diagnostic messages that may be helpful to the other side. > > The "test harness" is another process (think gbt3 or the IDE) which > plans a series of tests, by picking test modules and methods, then > runs each test, collects its TAP output and analyzes if the test was > successful. > > gb.test currently mixes these two concerns. It does output TAP, but > instead of having the other party parse it, it prints a > "self-summary" in the end, for inspection by I don't know who. > *Typically*, in my experience, the test process is only concerned > with outputting honest TAP and then terminates, meanwhile the harness > reads that TAP and rehashes it for the user. gb.test does not follow > this separation and at the moment I cannot do that because it does > not include a general TAP parser. I agree. If there is a public protocol, it's because we want two different processes collaborating through that protocol. I think too that 'gb.test' must output TAP only, and the IDE (or another process) parses the output to display the result, using a 'gb.test.tap' component or not (the TAP output seems not very difficult to parse directly). > [...] > > If a *test method* raises an uncaught error, then a *test > harness*-like piece of code catches it and spoofs a test failure in > the TAP stream. Arguably that is not correct, semantically. If an > error is raised and not caught, then the *test code* is buggy, not > the *tested* code. I agree. -- Beno?t Minisini From chrisml at deganius.de Tue Feb 25 01:02:53 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 25 Feb 2020 01:02:53 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <20200224222058.GA2318325@highrise.localdomain> References: <20200224222058.GA2318325@highrise.localdomain> Message-ID: <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> Am 24.02.20 um 23:20 schrieb Tobias Boege: > gb.test tries to do all of that in one process at the moment and this is > a lack of separation that facilitates it doing "impure" things. Concretely > I mean this > > https://gitlab.com/gambas/gambas/-/blob/3752088d37/comp/src/gb.test/.src/TestSuite/TestCase.class#L48 > > Try Object.Call($MyTestModule, Me.name) > If Error Then > Inc Track.Counter > Track.NOKs.Add(Track.Counter) > Print "not ok " & Track.Counter & " " & > Track.TestModuleName & ":" & Track.TestName & " Raised error: " & Error.Text > Error.Clear > Endif > > If a *test method* raises an uncaught error, then a *test harness*-like > piece of code catches it and spoofs a test failure in the TAP stream. > Arguably that is not correct, semantically. If an error is raised and not > caught, then the *test code* is buggy, not the *tested* code. Furthermore, > this trick isn't always helpful: it only inserts one test failure when > the entire test method aborted due to an error at any point, what if the > test method had a couple more tests planned? Then the TAP stream will be > subsequently shifted and parts will be missing but it continues to run. I like your criticism very much! It is wonderful if someone takes a close look at the code and the decisions in it. Regarding this case: I think that is not really of interest (that the testmodule failed in an early state, and subsequent testmethods in it may have reported Oks later ...). At this point I also could have done a BailOut and stop the entire testing process instead of just report that an error happened in the testmodule. Earlier I think there was a BailOut and that was a bit better. But gb.test reports here, where the error happened, in "Track.TestModuleName & ":" & Track.TestName" and that's all the programmer has to know about. I don't give a damn what happens after that! If there is one error/crash the program is buggy and this is, what I want to see as a programmer. For sure, the testcode could also be buggy, but who cares? The programmer has to fix! Either the testee or the tester. That's all. That's the only thing that interests me as a programmer. The real reason I did that in that way you don't like, was: With the current gb.test I can step through the test code and the tested code with the debugger *because the processes are not separated*! This is very convenient for daily work as a programmer! You step through and see: "Oh, my testcode was buggy" or "Oh, my tested code does a silly thing". Its the matter of how to work fluently with testing and programming. The current gb.test supports my way to program best and it's not because I like spaghetti. If the testing was done according to your ideas, I could only see that something is broken, but I couldn't step through. I would really miss that. You complain about that other test systems you know also do not follow your idea of "pureness" and "semantically correct" separation. I bet, their programmers faced the same problem and also came to the same decision as I did here. Btw, this is something we discussed a year ago and our positions have not changed. :-) Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From g4mba5 at gmail.com Tue Feb 25 02:01:31 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 25 Feb 2020 02:01:31 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> Message-ID: <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> Le 25/02/2020 ? 01:02, Christof Thalhofer a ?crit?: > Am 24.02.20 um 23:20 schrieb Tobias Boege: > >> gb.test tries to do all of that in one process at the moment and this is >> a lack of separation that facilitates it doing "impure" things. Concretely >> I mean this >> >> https://gitlab.com/gambas/gambas/-/blob/3752088d37/comp/src/gb.test/.src/TestSuite/TestCase.class#L48 >> >> Try Object.Call($MyTestModule, Me.name) >> If Error Then >> Inc Track.Counter >> Track.NOKs.Add(Track.Counter) >> Print "not ok " & Track.Counter & " " & >> Track.TestModuleName & ":" & Track.TestName & " Raised error: " & Error.Text >> Error.Clear >> Endif >> >> If a *test method* raises an uncaught error, then a *test harness*-like >> piece of code catches it and spoofs a test failure in the TAP stream. >> Arguably that is not correct, semantically. If an error is raised and not >> caught, then the *test code* is buggy, not the *tested* code. Furthermore, >> this trick isn't always helpful: it only inserts one test failure when >> the entire test method aborted due to an error at any point, what if the >> test method had a couple more tests planned? Then the TAP stream will be >> subsequently shifted and parts will be missing but it continues to run. > > I like your criticism very much! It is wonderful if someone takes a > close look at the code and the decisions in it. > > Regarding this case: > > I think that is not really of interest (that the testmodule failed in an > early state, and subsequent testmethods in it may have reported Oks > later ...). > > At this point I also could have done a BailOut and stop the entire > testing process instead of just report that an error happened in the > testmodule. Earlier I think there was a BailOut and that was a bit > better. But gb.test reports here, where the error happened, in > "Track.TestModuleName & ":" & Track.TestName" and that's all the > programmer has to know about. I don't give a damn what happens after that! > > If there is one error/crash the program is buggy and this is, what I > want to see as a programmer. For sure, the testcode could also be buggy, > but who cares? The programmer has to fix! > Either the testee or the tester. That's all. That's the only thing that > interests me as a programmer. > > The real reason I did that in that way you don't like, was: > > With the current gb.test I can step through the test code and the tested > code with the debugger *because the processes are not separated*! This > is very convenient for daily work as a programmer! You step through and > see: "Oh, my testcode was buggy" or "Oh, my tested code does a silly thing". > > Its the matter of how to work fluently with testing and programming. The > current gb.test supports my way to program best and it's not because I > like spaghetti. > > If the testing was done according to your ideas, I could only see that > something is broken, but I couldn't step through. I would really miss that. > > You complain about that other test systems you know also do not follow > your idea of "pureness" and "semantically correct" separation. > > I bet, their programmers faced the same problem and also came to the > same decision as I did here. > > Btw, this is something we discussed a year ago and our positions have > not changed. > > :-) > > Alles Gute > > Christof Thalhofer > I don't see the point. Imagine the IDE with a "test" toggle button. Once the toggle is on, either you run the project with F5, and then you run the full project in test mode just to get the full result, either you run it in the debugger, and then you can debug your test code and find why it crashes. So 'gb.test' does not have to catch test code errors. The TAP syntax is done so that a test can just crash, and it will be detected by the TAP analyzer. Or did I miss something? -- Beno?t Minisini From brian at westwoodsvcs.com Tue Feb 25 02:07:00 2020 From: brian at westwoodsvcs.com (Brian G) Date: Mon, 24 Feb 2020 17:07:00 -0800 (PST) Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts Message-ID: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> Since with Gambas shared libraries we can not use the dh_mkshlib as it also changes system paths etc I would like to add the following code to generate preinst and postinst scripts for preserving older versions of shared libraries This change is from the package.module in the ide , there could be some imposed rules for these script regarding how they process the shared libraries. This would be done to preserve applications that use older versions of the libraries. Linux shared libraries do allow this and usually create a link to the most current as a default version. This is from the Debian build, But can be added for the others as well. I am including a testexec library which contains the created scripts as examples Case Project.TYPE_LIBRARY Dim PrePostFiles As File PrePostFiles = Open sPackagePath &/ "debian/preinst" For Create Print #PrePostFiles, "#!/usr/bin/gbs" & System.version Print #PrePostFiles, "print \"Gambas Running Pre Install Shared Library Process\"" Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "\") then quit 0" ' never installed before Print #PrePostFiles, "print \"Gambas Running Pre Install Shared Library Process Checking for .lib\"" Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\") then mkdir \"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\"" Print #PrePostFiles, "print \"Gambas Running Pre Install Shared Library Process Checking each file LIKE:" & $sName & "*\"" Print #PrePostFiles, "For each i as string in dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "\",\"" & $sName & "*\",gb.file)" Print #PrePostFiles, "Print \"Gambas Pre Install Moving : \" ; i" Print #PrePostFiles, "Move \"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "\" &/ i To \"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\" &/ i" Print #PrePostFiles, "Next" Print #PrePostFiles, "print \"Gambas Ending Pre Install Shared Library Process\"" Close #PrePostFiles Chmod sPackagePath &/ "debian/preinst" To "rwxr-xr-x" PrePostFiles = Open sPackagePath &/ "debian/postinst" For Create Print #PrePostFiles, "#!/usr/bin/gbs" & System.version Print #PrePostFiles, "print \"Gambas Running Post Install Shared Library Process\"" Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\") then quit 0" ' never installed before Print #PrePostFiles, "For Each i As String In Dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\")" Print #PrePostFiles, "Print \"Gambas Post Install Chking Lib: \";i" Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "\" &/ i) Then" Print #PrePostFiles, "Print \"Gambas Post Install Making Available Lib: \";i" Print #PrePostFiles, " Move \"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\" &/ i To \"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "/\" &/ i" Print #PrePostFiles, "Else" Print #PrePostFiles, " Kill \"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\" &/ i" Print #PrePostFiles, " Print\"Gambas Post Install :\"; i ; \" - Newer version same level installed\"" Print #PrePostFiles, "Endif" Print #PrePostFiles, "next" Close #PrePostFiles Chmod sPackagePath &/ "debian/postinst" To "rwxr-xr-x" Print #hFile, "src/"; $sName; "/"; $sLibraryName; ".gambas usr/lib/gambas" & System.Version; "/"; LCase($sVendor) Case Project.TYPE_NORMAL ......... Thank You Brian G -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: westwood-testexec_4.14.7-0ubuntu1_all.deb Type: application/x-deb Size: 2664 bytes Desc: not available URL: From g4mba5 at gmail.com Tue Feb 25 02:55:41 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 25 Feb 2020 02:55:41 +0100 Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> Message-ID: <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> Le 25/02/2020 ? 02:07, Brian G a ?crit?: > Since with Gambas shared libraries we can not use the dh_mkshlib as it > also changes system paths etc > > I would like to add the following code to generate preinst and postinst > scripts for preserving older versions of shared libraries > > This change is from the package.module in the ide , there could be some > imposed rules for these script regarding how they process the shared > libraries. > > This would be done to preserve applications that use older versions of > the libraries. Linux shared libraries do allow this and usually create > a? link to? the most current as a default version. > > This is from the Debian build, But can be added for the others as well. > > I am including a testexec library which contains the created scripts as > examples > > Case Project.TYPE_LIBRARY > ? ? ? Dim PrePostFiles As File > ? ? ? PrePostFiles = Open sPackagePath &/ "debian/preinst" For Create > ? ? ? Print #PrePostFiles, "#!/usr/bin/gbs" & System.version > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process\"" > ? ? ? Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "\") then quit 0"? ?' never > installed before > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process Checking for .lib\"" > ? ? ? Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) &/ ".lib\") then mkdir > \"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\"" > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process Checking each file LIKE:" & $sName & "*\"" > ? ? ? Print #PrePostFiles, "For each i as string in > dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "\",\"" & > $sName & "*\",gb.file)" > ? ? ? Print #PrePostFiles, "Print \"Gambas Pre Install Moving : \" ; i" > ? ? ? Print #PrePostFiles, "Move \"/usr/lib/gambas" & System.version &/ > LCase($sVendor) & "\" &/ i To \"/usr/lib/gambas" & System.version &/ > LCase($sVendor) &/ ".lib\" &/ i" > ? ? ? Print #PrePostFiles, "Next" > ? ? ? Print #PrePostFiles, "print \"Gambas Ending Pre Install Shared > Library Process\"" > ? ? ? Close #PrePostFiles > ? ? ? Chmod sPackagePath &/ "debian/preinst" To "rwxr-xr-x" > ? ? ? PrePostFiles = Open sPackagePath &/ "debian/postinst" For Create > ? ? ? Print #PrePostFiles, "#!/usr/bin/gbs" & System.version > ? ? ? Print #PrePostFiles, "print \"Gambas Running Post Install Shared > Library Process\"" > ? ? ? Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) &/ ".lib\") then quit 0"? ?' never > installed before > ? ? ? Print #PrePostFiles, "For Each i As String In > Dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\")" > ? ? ? Print #PrePostFiles, "Print \"Gambas Post Install Chking Lib: \";i" > ? ? ? Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "\" &/? i) Then" > ? ? ? Print #PrePostFiles, "Print \"Gambas Post Install Making > Available Lib: \";i" > ? ? ? Print #PrePostFiles, " Move \"/usr/lib/gambas" & System.version > &/ LCase($sVendor) &/ ".lib\" &/ i To \"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "/\" &/ i" > ? ? ? Print #PrePostFiles, "Else" > ? ? ? Print #PrePostFiles, " Kill \"/usr/lib/gambas" & System.version > &/ LCase($sVendor) &/ ".lib\" &/ i" > ? ? ? Print #PrePostFiles, " Print\"Gambas Post Install :\"; i ; \"? - > Newer version same level installed\"" > ? ? ? Print #PrePostFiles, "Endif" > ? ? ? Print #PrePostFiles, "next" > ? ? ? Close #PrePostFiles > ? ? ? Chmod sPackagePath &/ "debian/postinst" To "rwxr-xr-x" > ? ? ? Print #hFile, "src/"; $sName; "/"; $sLibraryName; ".gambas > usr/lib/gambas" & System.Version; "/"; LCase($sVendor) > ? ? Case Project.TYPE_NORMAL > ? ?......... > > Thank You > Brian G > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Why, when installing a library package, do you want to save a possible already installed library of the same name ? The library already has its major and minor version in its name. So you can already install different versions of the same library. And doing that breaks the packager, by moving files installed from another package. Moreover, you must not use gbs inside a package script. What the hell is that !? -- Beno?t Minisini From brian at westwoodsvcs.com Tue Feb 25 03:39:54 2020 From: brian at westwoodsvcs.com (Brian G) Date: Tue, 25 Feb 2020 02:39:54 +0000 (UTC) Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> Message-ID: <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> I only want to save major releases i.e. 4.0 to 5.0 as a production applications may use different version of the library. Right now every level is removed by an install package only the last one remains. The system shared libraries keep multiple versions for that reason. That's not true about the users ~ lib it keeps all the versions. But not the .Deb file installs. I am not moving the files only preventing them from being deleted. I am using gbs3 from inside the ide, so it should already be installed. At least I thought so. Oh well. thank you brian On Mon, Feb 24, 2020 at 5:56 PM -0800, "Beno?t Minisini" wrote: Le 25/02/2020 ? 02:07, Brian G a ?crit?: > Since with Gambas shared libraries we can not use the dh_mkshlib as it > also changes system paths etc > > I would like to add the following code to generate preinst and postinst > scripts for preserving older versions of shared libraries > > This change is from the package.module in the ide , there could be some > imposed rules for these script regarding how they process the shared > libraries. > > This would be done to preserve applications that use older versions of > the libraries. Linux shared libraries do allow this and usually create > a? link to? the most current as a default version. > > This is from the Debian build, But can be added for the others as well. > > I am including a testexec library which contains the created scripts as > examples > > Case Project.TYPE_LIBRARY > ? ? ? Dim PrePostFiles As File > ? ? ? PrePostFiles = Open sPackagePath &/ "debian/preinst" For Create > ? ? ? Print #PrePostFiles, "#!/usr/bin/gbs" & System.version > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process\"" > ? ? ? Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "\") then quit 0"? ?' never > installed before > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process Checking for .lib\"" > ? ? ? Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) &/ ".lib\") then mkdir > \"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\"" > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process Checking each file LIKE:" & $sName & "*\"" > ? ? ? Print #PrePostFiles, "For each i as string in > dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "\",\"" & > $sName & "*\",gb.file)" > ? ? ? Print #PrePostFiles, "Print \"Gambas Pre Install Moving : \" ; i" > ? ? ? Print #PrePostFiles, "Move \"/usr/lib/gambas" & System.version &/ > LCase($sVendor) & "\" &/ i To \"/usr/lib/gambas" & System.version &/ > LCase($sVendor) &/ ".lib\" &/ i" > ? ? ? Print #PrePostFiles, "Next" > ? ? ? Print #PrePostFiles, "print \"Gambas Ending Pre Install Shared > Library Process\"" > ? ? ? Close #PrePostFiles > ? ? ? Chmod sPackagePath &/ "debian/preinst" To "rwxr-xr-x" > ? ? ? PrePostFiles = Open sPackagePath &/ "debian/postinst" For Create > ? ? ? Print #PrePostFiles, "#!/usr/bin/gbs" & System.version > ? ? ? Print #PrePostFiles, "print \"Gambas Running Post Install Shared > Library Process\"" > ? ? ? Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) &/ ".lib\") then quit 0"? ?' never > installed before > ? ? ? Print #PrePostFiles, "For Each i As String In > Dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\")" > ? ? ? Print #PrePostFiles, "Print \"Gambas Post Install Chking Lib: \";i" > ? ? ? Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "\" &/? i) Then" > ? ? ? Print #PrePostFiles, "Print \"Gambas Post Install Making > Available Lib: \";i" > ? ? ? Print #PrePostFiles, " Move \"/usr/lib/gambas" & System.version > &/ LCase($sVendor) &/ ".lib\" &/ i To \"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "/\" &/ i" > ? ? ? Print #PrePostFiles, "Else" > ? ? ? Print #PrePostFiles, " Kill \"/usr/lib/gambas" & System.version > &/ LCase($sVendor) &/ ".lib\" &/ i" > ? ? ? Print #PrePostFiles, " Print\"Gambas Post Install :\"; i ; \"? - > Newer version same level installed\"" > ? ? ? Print #PrePostFiles, "Endif" > ? ? ? Print #PrePostFiles, "next" > ? ? ? Close #PrePostFiles > ? ? ? Chmod sPackagePath &/ "debian/postinst" To "rwxr-xr-x" > ? ? ? Print #hFile, "src/"; $sName; "/"; $sLibraryName; ".gambas > usr/lib/gambas" & System.Version; "/"; LCase($sVendor) > ? ? Case Project.TYPE_NORMAL > ? ?......... > > Thank You > Brian G > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Why, when installing a library package, do you want to save a possible already installed library of the same name ? The library already has its major and minor version in its name. So you can already install different versions of the same library. And doing that breaks the packager, by moving files installed from another package. Moreover, you must not use gbs inside a package script. What the hell is that !? -- Beno?t Minisini ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisml at deganius.de Tue Feb 25 08:30:53 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 25 Feb 2020 08:30:53 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> Message-ID: Am 25.02.20 um 02:01 schrieb Beno?t Minisini: > I don't see the point. > > Imagine the IDE with a "test" toggle button. > > Once the toggle is on, either you run the project with F5, and then you > run the full project in test mode just to get the full result, either > you run it in the debugger, and then you can debug your test code and > find why it crashes. I do not want to run the "full project in test mode" while I am programming. I have projects that need two minutes to test. So I just want to test one single testmethod while I work. At the end I need "full project in test mode" before deployment to ensure that I did not destroy sth by accident. > So 'gb.test' does not have to catch test code errors. The TAP syntax is > done so that a test can just crash, and it will be detected by the TAP > analyzer. > > Or did I miss something? Ah, maybe I am wrong. I am not sure if I answered to things I fear and not things that are imagined by Tobi. Let's prove. We have Git and a large playground. As long as I can test one single testmethod and step through test code and tested code I am quite satisfied. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From g4mba5 at gmail.com Tue Feb 25 10:10:31 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 25 Feb 2020 10:10:31 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> Message-ID: Le 25/02/2020 ? 08:30, Christof Thalhofer a ?crit?: > Am 25.02.20 um 02:01 schrieb Beno?t Minisini: > >> I don't see the point. >> >> Imagine the IDE with a "test" toggle button. >> >> Once the toggle is on, either you run the project with F5, and then you >> run the full project in test mode just to get the full result, either >> you run it in the debugger, and then you can debug your test code and >> find why it crashes. > > I do not want to run the "full project in test mode" while I am > programming. I have projects that need two minutes to test. So I just > want to test one single testmethod while I work. So, in test mode, the IDE must provide an interface to choose which test we want to run. Can we assume that a "test" is a full module, or do we have to be able to choose one method in the test module? Could we use help commentaries in the test modules to define the display name of the tests? -- Beno?t Minisini From chrisml at deganius.de Tue Feb 25 11:57:17 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 25 Feb 2020 11:57:17 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> Message-ID: <42702e06-28f3-722c-8c8a-c5b5d145f212@deganius.de> Am 25.02.20 um 10:10 schrieb Beno?t Minisini: >> I do not want to run the "full project in test mode" while I am >> programming. I have projects that need two minutes to test. So I just >> want to test one single testmethod while I work. > > So, in test mode, the IDE must provide an interface to choose which test > we want to run. > > Can we assume that a "test" is a full module, or do we have to be able > to choose one method in the test module? A single test is one method inside a test module. > Could we use help commentaries in the test modules to define the display > name of the tests? I'd want to avoid that at all costs. It not only makes just more work but also provides the additional chance of human failures. gb.test:Unittest, which you can imagine as the "test orchestrator", with its arguments in the current state provides that (cherrypicking of one module with or without one method). I even wanted to extend it's optional arguments with a variable that can take a JSON string that defines a certain test plan to extend the possibilities of cherry-picking. Imagine this szenario: You have a few tests, which should run now, while you are in a programming process. These tests should also run later when it goes to production. Then you have a couple of tests, which should only run when a certain db connection is available. Then you have a lot of tests that are mandatory to succeed if the program goes to production but the db tests should not be done, because the CI (continuous integration) system has no db connection. ----------------------- Please have a look at the code of gbt3. It creates a startmodule, injects it into the project to be tested, compiles it, runs the tests and then deletes the startmodule afterwards and compiles the project again. It produces TAP on stdout. For me that could be a solution. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From taboege at gmail.com Tue Feb 25 12:04:39 2020 From: taboege at gmail.com (Tobias Boege) Date: Tue, 25 Feb 2020 12:04:39 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> Message-ID: <20200225110439.GB2346311@highrise.localdomain> On Tue, 25 Feb 2020, Christof Thalhofer wrote: > The real reason I did that in that way you don't like, was: > > With the current gb.test I can step through the test code and the tested > code with the debugger *because the processes are not separated*! This > is very convenient for daily work as a programmer! You step through and > see: "Oh, my testcode was buggy" or "Oh, my tested code does a silly thing". > Thanks for explaining. I'll address it below. > You complain about that other test systems you know also do not follow > your idea of "pureness" and "semantically correct" separation. > > I bet, their programmers faced the same problem and also came to the > same decision as I did here. I don't think I complained about other test systems. I use the `prove` system pretty much daily in one language or another, even for verifying SQL databases, and it works as in the flowchart. On Tue, 25 Feb 2020, Beno?t Minisini wrote: > Le 25/02/2020 ? 08:30, Christof Thalhofer a ?crit?: > > I do not want to run the "full project in test mode" while I am > > programming. I have projects that need two minutes to test. So I just > > want to test one single testmethod while I work. > > So, in test mode, the IDE must provide an interface to choose which test we > want to run. > > Can we assume that a "test" is a full module, or do we have to be able to > choose one method in the test module? > The latter, and gb.test currently does this if you give it the right arguments. You can select a test module and a test method and it will Object.Call() just this method. It seems like a valuable feature to me. But separating tester and testee into two processes does not prevent running, and hence debugging, only isolated test methods! Here is how it goes: - The IDE determines the "test set" to run, a collection of test modules with test methods inside, by some "last used" setting or from a topical grouping of tests derived from tags in their help comments, or... let your imagination run free. This may be as few as one test method in one test module. - It starts gbx3 in test mode and passes the test set. - gb.test's Test.Main() takes over, receives the test modules and methods and does its thing. The result is TAP printed on stdout. - Oops, a test fails or the program crashes. The IDE sees this in the TAP stream. Pinpointing the test method and test module where the crash happened is currently not but can be implemented by a diagnostic message when starting a test method. (In fact, it sort of already is in my branch because I start a subtest for each test method and give it a description containing test module and method.) - The IDE starts gbx3 in debug mode and test mode. The Gambas debugger is a two-party protocol as well and requires the separate process anyway. The only difference is that the program being debugged starts inside gb.test's Test.Main() which dispatches to the chosen test methods. TAP is still printed, but while you debug. You see: as long as the test modules and the tested code are inside the project, you can step through the process even as it runs tests. Debugging code and running test methods are independent of each other, so can be freely mixed. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk From chrisml at deganius.de Tue Feb 25 12:46:47 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 25 Feb 2020 12:46:47 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <20200225110439.GB2346311@highrise.localdomain> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> Message-ID: <7fe57b70-98a7-6b4d-9ef7-f7ea0ba0bc93@deganius.de> Am 25.02.20 um 12:04 schrieb Tobias Boege: > You see: as long as the test modules and the tested code are inside the > project, you can step through the process even as it runs tests. Debugging > code and running test methods are independent of each other, so can be > freely mixed. Ok, cool. If this > - It starts gbx3 in test mode and passes the test set. is is not problem for Beno?t. The alternative would be gbt3 as it works now. And at the end (if it goes to production) all testmodules can be thrown away and "Component=gb.test" can be deleted in the .project file before compilation and we are clean. Alles Gute Christof Thalhofer -- [x] nail here for new monitor From karl.reinl at fen-net.de Tue Feb 25 14:54:49 2020 From: karl.reinl at fen-net.de (Karl Reinl) Date: Tue, 25 Feb 2020 14:54:49 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <7fe57b70-98a7-6b4d-9ef7-f7ea0ba0bc93@deganius.de> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <7fe57b70-98a7-6b4d-9ef7-f7ea0ba0bc93@deganius.de> Message-ID: Am Dienstag, den 25.02.2020, 12:46 +0100 schrieb Christof Thalhofer: > > And at the end (if it goes to production) all testmodules can be > thrown > away and > > "Component=gb.test" > > can be deleted in the .project file before compilation and we are > clean. > > Alles Gute > > Christof Thalhofer > Salut, 'if it goes to production' this is rarely the end of development. I think it would be better to have an option/switch that turns off the test code, which also turns off the gb.test component -- Amicalement Charlie From brian at westwoodsvcs.com Tue Feb 25 17:01:41 2020 From: brian at westwoodsvcs.com (Brian G) Date: Tue, 25 Feb 2020 08:01:41 -0800 (PST) Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> Message-ID: <1174772483.10272.1582646501930.JavaMail.zimbra@westwoodsvcs.com> Will try to find another way of doing this. When the dependency for gambas is created for the install, does that imply that the scripter will be available? Brian G From: "Brian" To: "Gambas mailing list" Sent: Monday, February 24, 2020 6:39:54 PM Subject: Re: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts I only want to save major releases i.e. 4.0 to 5.0 as a production applications may use different version of the library. Right now every level is removed by an install package only the last one remains. The system shared libraries keep multiple versions for that reason. That's not true about the users ~ lib it keeps all the versions. But not the .Deb file installs. I am not moving the files only preventing them from being deleted. I am using gbs3 from inside the ide, so it should already be installed. At least I thought so. Oh well. thank you brian On Mon, Feb 24, 2020 at 5:56 PM -0800, "Beno?t Minisini" < [ mailto:g4mba5 at gmail.com | g4mba5 at gmail.com ] > wrote: Le 25/02/2020 ? 02:07, Brian G a ?crit?: > Since with Gambas shared libraries we can not use the dh_mkshlib as it > also changes system paths etc > > I would like to add the following code to generate preinst and postinst > scripts for preserving older versions of shared libraries > > This change is from the package.module in the ide , there could be some > imposed rules for these script regarding how they process the shared > libraries. > > This would be done to preserve applications that use older versions of > the libraries. Linux shared libraries do allow this and usually create > a? link to? the most current as a default version. > > This is from the Debian build, But can be added for the others as well. > > I am including a testexec library which contains the created scripts as > examples > > Case Project.TYPE_LIBRARY > ? ? ? Dim PrePostFiles As File > ? ? ? PrePostFiles = Open sPackagePath &/ "debian/preinst" For Create > ? ? ? Print #PrePostFiles, "#!/usr/bin/gbs" & System.version > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process\"" > ? ? ? Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "\") then quit 0"? ?' never > installed before > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process Checking for .lib\"" > ? ? ? Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) &/ ".lib\") then mkdir > \"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\"" > ? ? ? Print #PrePostFiles, "print \"Gambas Running Pre Install Shared > Library Process Checking each file LIKE:" & $sName & "*\"" > ? ? ? Print #PrePostFiles, "For each i as string in > dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) & "\",\"" & > $sName & "*\",gb.file)" > ? ? ? Print #PrePostFiles, "Print \"Gambas Pre Install Moving : \" ; i" > ? ? ? Print #PrePostFiles, "Move \"/usr/lib/gambas" & System.version &/ > LCase($sVendor) & "\" &/ i To \"/usr/lib/gambas" & System.version &/ > LCase($sVendor) &/ ".lib\" &/ i" > ? ? ? Print #PrePostFiles, "Next" > ? ? ? Print #PrePostFiles, "print \"Gambas Ending Pre Install Shared > Library Process\"" > ? ? ? Close #PrePostFiles > ? ? ? Chmod sPackagePath &/ "debian/preinst" To "rwxr-xr-x" > ? ? ? PrePostFiles = Open sPackagePath &/ "debian/postinst" For Create > ? ? ? Print #PrePostFiles, "#!/usr/bin/gbs" & System.version > ? ? ? Print #PrePostFiles, "print \"Gambas Running Post Install Shared > Library Process\"" > ? ? ? Print #PrePostFiles, "if not exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) &/ ".lib\") then quit 0"? ?' never > installed before > ? ? ? Print #PrePostFiles, "For Each i As String In > Dir(\"/usr/lib/gambas" & System.version &/ LCase($sVendor) &/ ".lib\")" > ? ? ? Print #PrePostFiles, "Print \"Gambas Post Install Chking Lib: \";i" > ? ? ? Print #PrePostFiles, "If Not Exist(\"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "\" &/? i) Then" > ? ? ? Print #PrePostFiles, "Print \"Gambas Post Install Making > Available Lib: \";i" > ? ? ? Print #PrePostFiles, " Move \"/usr/lib/gambas" & System.version > &/ LCase($sVendor) &/ ".lib\" &/ i To \"/usr/lib/gambas" & > System.version &/ LCase($sVendor) & "/\" &/ i" > ? ? ? Print #PrePostFiles, "Else" > ? ? ? Print #PrePostFiles, " Kill \"/usr/lib/gambas" & System.version > &/ LCase($sVendor) &/ ".lib\" &/ i" > ? ? ? Print #PrePostFiles, " Print\"Gambas Post Install :\"; i ; \"? - > Newer version same level installed\"" > ? ? ? Print #PrePostFiles, "Endif" > ? ? ? Print #PrePostFiles, "next" > ? ? ? Close #PrePostFiles > ? ? ? Chmod sPackagePath &/ "debian/postinst" To "rwxr-xr-x" > ? ? ? Print #hFile, "src/"; $sName; "/"; $sLibraryName; ".gambas > usr/lib/gambas" & System.Version; "/"; LCase($sVendor) > ? ? Case Project.TYPE_NORMAL > ? ?......... > > Thank You > Brian G > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- > Why, when installing a library package, do you want to save a possible already installed library of the same name ? The library already has its major and minor version in its name. So you can already install different versions of the same library. And doing that breaks the packager, by moving files installed from another package. Moreover, you must not use gbs inside a package script. What the hell is that !? -- Beno?t Minisini ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From g4mba5 at gmail.com Tue Feb 25 17:30:22 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 25 Feb 2020 17:30:22 +0100 Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <1174772483.10272.1582646501930.JavaMail.zimbra@westwoodsvcs.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> <1174772483.10272.1582646501930.JavaMail.zimbra@westwoodsvcs.com> Message-ID: <6578572c-1741-4138-f053-d97c1bbe85a1@gmail.com> Le 25/02/2020 ? 17:01, Brian G a ?crit?: > Will try to find another way of doing this. > > When the dependency for gambas? is created for the install, does that > imply that the scripter will be available? > > > Brian G I don't really understand your problem. When you create a package of a library, then the library version is put in the package name. So normally, for two versions of the same library, you get two packages with different names, and these packages should be able to be both installed at the same time. Provided that the release number (the third number in the version) is different, as the Gambas executable only includes the major and the minor. As for gbs, I want it to be fully optional. Nothing should require it in Gambas. REgards, -- Beno?t Minisini From g4mba5 at gmail.com Tue Feb 25 18:02:08 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Tue, 25 Feb 2020 18:02:08 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: Message-ID: <628f3d03-0167-f728-a01a-cdded5f77c33@gmail.com> Le 24/02/2020 ? 19:21, Beno?t Minisini a ?crit?: > Hi, > > This mail in mainly for Christof and Tobias... > Another point: test modules will be available for any project, and gb.test may be hidden. At the moment, you have to check the component to be able to create test modules. When the interpreter will be run in test mode, it will load the 'gb.test' component automatically. And I plan to add to the archiver an option that removes the test modules from the executable. So there will be no overhead when running a project with test modules normally, and you will be able to create an executable with no test inside. I'm thinking: is it useful to be able to create executables with test modules inside? -- Beno?t Minisini From brian at westwoodsvcs.com Tue Feb 25 17:59:29 2020 From: brian at westwoodsvcs.com (Brian G) Date: Tue, 25 Feb 2020 08:59:29 -0800 (PST) Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <6578572c-1741-4138-f053-d97c1bbe85a1@gmail.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> <1174772483.10272.1582646501930.JavaMail.zimbra@westwoodsvcs.com> <6578572c-1741-4138-f053-d97c1bbe85a1@gmail.com> Message-ID: <2121380019.10360.1582649969213.JavaMail.zimbra@westwoodsvcs.com> The problem is that the name of the package changes like this westwood-testexec_7.14.9-0ubuntu1_all.deb westwood-testexec_7.14.8-0ubuntu1_all.deb westwood-testexec_4.14.7-0ubuntu1_all.deb etc The package name is only considered to the first _ and the rest is versioning So no mater what major(also considered interface version for shared libraries), minor, release number Debian deletes all older versions and replaces it with the newer version. Applications depending on the older version of the interface will now fail. If you try to install the older version, it will tell you that the newest is already installed. I would like to propose that the major version number become part of a library name as this westwood-testexec4_4.14.7-0ubuntu1_all.deb This allows the Major/Inteface number to control the package name for libraries and therefore allow the development and implementation in a production environment of newer versions of the interface. and the slow adoption for older applications to the new interface. This change for Libraries to the naming sPackageName = FormatDebPackageName($sUnsafePackageName) If Project.type = Project.TYPE_LIBRARY Then sPackageName &= Split($sVersion, ".", "", True)[0] Endif Will allow the major version or Interface version to manage the way shared libraries are updated This would be very helpful for developers Brian G ----- Original Message ----- From: "Beno?t Minisini" To: "Gambas mailing list" Sent: Tuesday, February 25, 2020 8:30:22 AM Subject: Re: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts Le 25/02/2020 ? 17:01, Brian G a ?crit?: > Will try to find another way of doing this. > > When the dependency for gambas? is created for the install, does that > imply that the scripter will be available? > > > Brian G I don't really understand your problem. When you create a package of a library, then the library version is put in the package name. So normally, for two versions of the same library, you get two packages with different names, and these packages should be able to be both installed at the same time. Provided that the release number (the third number in the version) is different, as the Gambas executable only includes the major and the minor. As for gbs, I want it to be fully optional. Nothing should require it in Gambas. REgards, -- Beno?t Minisini ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- From chrisml at deganius.de Tue Feb 25 18:43:14 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Tue, 25 Feb 2020 18:43:14 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <628f3d03-0167-f728-a01a-cdded5f77c33@gmail.com> References: <628f3d03-0167-f728-a01a-cdded5f77c33@gmail.com> Message-ID: <3c66b099-4684-ac3c-71c5-70c6d1ef0dfd@deganius.de> Am 25.02.20 um 18:02 schrieb Beno?t Minisini: > Another point: test modules will be available for any project, and > gb.test may be hidden. At the moment, you have to check the component to > be able to create test modules. > > When the interpreter will be run in test mode, it will load the > 'gb.test' component automatically. > > And I plan to add to the archiver an option that removes the test > modules from the executable. > > So there will be no overhead when running a project with test modules > normally, and you will be able to create an executable with no test inside. > > I'm thinking: is it useful to be able to create executables with test > modules inside? I am unsure. Maybe yes ... for gbt3? And thinking further ... why not? The testing framework is there. It could be a solution for sth that nobody thought of, for instance checking a machines state from the distance, like monitoring ... TAP output could be suitable for this. I'm a bit tired. Tobi and I talked for about three hours. We are clear now, we analyzed your suggestions in the first mail of this thread. I think Tobi will write our conclusions when he has hung his laundry. ;) Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From taboege at gmail.com Tue Feb 25 23:22:26 2020 From: taboege at gmail.com (Tobias Boege) Date: Tue, 25 Feb 2020 23:22:26 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: Message-ID: <20200225222226.GB2558983@highrise.localdomain> On Mon, 24 Feb 2020, Beno?t Minisini wrote: > So I bring the following suggestions: > > 1) Adding a running test option to the interpreter. (Eventually use '-t' and > find another name for the tracing option). > > 2) The running test option will have an argument that specifies which test > modules to run (everything by default). > > 3) The interpreter in running test mode will not run the startup class, but > will load every test module, and will run a global public method in an > hardcoded global public class that must be implemented by the 'gb.test' > component. For example "Test.Main". It will receive the class objects in > argument. This is how it will be able to access non-exported test modules > and run them. > > 4) The '.test' file created by the compiler is still needed. It will be used > by the interpreter to find the test modules. > Talking to Christof today and thinking about this, the suggestions are pretty much what we need. The interpreter flag and that it calls a pre- defined startup class is quite a nice and uniform solution. We were thinking about ways to pass a very fine-grained selection of test modules and test methods to run to gb.test and one possibility is passing a JSON object with a to mapping. The interpreter would NOT have to read this JSON string, it would just normally pass this string on to the application as part of Args, i.e. like this gbx3 -t $PROJECT -- $JSON_GIBBERISH # or -T if -t is taken The JSON format and its handling then is an implementation detail of gb.test. Consequently the interpreter would have to pass ALL test module Class objects to gb.test's Main and the test framework does the actual selection. What do you think about that? There should probably be simpler fallback formats for when you want to run all methods in one named module... You should not be required to write JSON unless you need maximal flexibility. But that can all be delegated to command-line arguments handled by gb.test's Main. The class objects can either be passed as a Class[] or as a Collection, we need lookup by name and both structures allow this. If you want to keep the signature of Test.Main() (or UnitTest.Main() as it's called right now in gb.test) clean, I could also imagine offering this as an Application.Tests property. I didn't take notes during the phone call with Christof and then got distracted for a while, but I think this is all. Or at the very least it is the next step. On Tue, 25 Feb 2020, Beno?t Minisini wrote: > Another point: test modules will be available for any project, and gb.test > may be hidden. At the moment, you have to check the component to be able to > create test modules. > > When the interpreter will be run in test mode, it will load the 'gb.test' > component automatically. > There is certainly a precedent for making components hidden and auto- matically loaded and I think this would fit here. Given the tighter integration of testing into the interpreter, gb.test could be considered a "system component". And it should usually not appear in the .project file, but only be loaded automatically in test mode, I think. > And I plan to add to the archiver an option that removes the test modules > from the executable. > > So there will be no overhead when running a project with test modules > normally, and you will be able to create an executable with no test inside. > > I'm thinking: is it useful to be able to create executables with test > modules inside? > I could imagine packing an installation package for a distribution, which will just contain the .gambas file and an install script which automatically runs tests on the host to verify it's working... Note sure if that is common practice though. I guess normally the packager does the testing and supposes the target system is similar enough. And finally, thanks for your suggestions. They're on point and I think we're on a good track together. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk From t.lee.davidson at gmail.com Tue Feb 25 23:28:45 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Tue, 25 Feb 2020 17:28:45 -0500 Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <2121380019.10360.1582649969213.JavaMail.zimbra@westwoodsvcs.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> <1174772483.10272.1582646501930.JavaMail.zimbra@westwoodsvcs.com> <6578572c-1741-4138-f053-d97c1bbe85a1@gmail.com> <2121380019.10360.1582649969213.JavaMail.zimbra@westwoodsvcs.com> Message-ID: <180f88c8-b1f2-16bc-7519-464200a0035e@gmail.com> On 2/25/20 11:59 AM, Brian G wrote: > Debian deletes all older versions and replaces it with the newer version. Applications depending on the older version of the interface will now fail. Not necessarily. The applications might fail if the newer version is not backwards compatible. With Semantic Versioning, the Minor and Patch versions should maintain backwards compatibility. If an upgrade is not backwards compatible, then the Major version number should bump. And, that would change the name of the file. -- Lee From g4mba5 at gmail.com Wed Feb 26 00:20:14 2020 From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=) Date: Wed, 26 Feb 2020 00:20:14 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <20200225222226.GB2558983@highrise.localdomain> References: <20200225222226.GB2558983@highrise.localdomain> Message-ID: <46f83088-e5f8-b3e6-b54c-7e06033e3f51@gmail.com> Le 25/02/2020 ? 23:22, Tobias Boege a ?crit?: > On Mon, 24 Feb 2020, Beno?t Minisini wrote: >> So I bring the following suggestions: >> >> 1) Adding a running test option to the interpreter. (Eventually use '-t' and >> find another name for the tracing option). >> >> 2) The running test option will have an argument that specifies which test >> modules to run (everything by default). >> >> 3) The interpreter in running test mode will not run the startup class, but >> will load every test module, and will run a global public method in an >> hardcoded global public class that must be implemented by the 'gb.test' >> component. For example "Test.Main". It will receive the class objects in >> argument. This is how it will be able to access non-exported test modules >> and run them. >> >> 4) The '.test' file created by the compiler is still needed. It will be used >> by the interpreter to find the test modules. >> > > Talking to Christof today and thinking about this, the suggestions are > pretty much what we need. The interpreter flag and that it calls a pre- > defined startup class is quite a nice and uniform solution. > > We were thinking about ways to pass a very fine-grained selection of > test modules and test methods to run to gb.test and one possibility is > passing a JSON object with a to > mapping. The interpreter would NOT have to read this JSON string, > it would just normally pass this string on to the application as part > of Args, i.e. like this > > gbx3 -t $PROJECT -- $JSON_GIBBERISH # or -T if -t is taken > > The JSON format and its handling then is an implementation detail of > gb.test. Consequently the interpreter would have to pass ALL test > module Class objects to gb.test's Main and the test framework does > the actual selection. What do you think about that? The problem is that only the interpreter can load the test modules. 'gb.test' can't, as they are not exported. So I was thinking that -t will receive the list of tests, and that the interpreter will load the needed test modules and pass them to 'gb.test' startup method. On the other hand, it is of course more flexible to let 'gb.test' handle the test argument. But either the interpreter loads the needed modules for it, either it gives 'gb.test' a callback to load them by name. > > There should probably be simpler fallback formats for when you want > to run all methods in one named module... You should not be required > to write JSON unless you need maximal flexibility. But that can all > be delegated to command-line arguments handled by gb.test's Main. > I prefer a basic text format instead of JSON. For example, a list of "Class.Method" with "*" meaning everything. Regards, -- Beno?t Minisini From brian at westwoodsvcs.com Wed Feb 26 00:20:21 2020 From: brian at westwoodsvcs.com (Brian G) Date: Tue, 25 Feb 2020 23:20:21 +0000 (UTC) Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <180f88c8-b1f2-16bc-7519-464200a0035e@gmail.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> <1174772483.10272.1582646501930.JavaMail.zimbra@westwoodsvcs.com> <6578572c-1741-4138-f053-d97c1bbe85a1@gmail.com> <2121380019.10360.1582649969213.JavaMail.zimbra@westwoodsvcs.com> <180f88c8-b1f2-16bc-7519-464200a0035e@gmail.com> Message-ID: <605B1DED34848F44.75f254a8-cb06-44ce-b484-070df41ac4c0@mail.outlook.com> Yes that is what I am suggesting thank you brian On Tue, Feb 25, 2020 at 2:29 PM -0800, "T Lee Davidson" wrote: On 2/25/20 11:59 AM, Brian G wrote: > Debian deletes all older versions and replaces it with the newer version. Applications depending on the older version of the interface will now fail. Not necessarily. The applications might fail if the newer version is not backwards compatible. With Semantic Versioning, the Minor and Patch versions should maintain backwards compatibility. If an upgrade is not backwards compatible, then the Major version number should bump. And, that would change the name of the file. -- Lee ----[ http://gambaswiki.org/wiki/doc/netiquette ]---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From taboege at gmail.com Wed Feb 26 02:03:49 2020 From: taboege at gmail.com (Tobias Boege) Date: Wed, 26 Feb 2020 02:03:49 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <46f83088-e5f8-b3e6-b54c-7e06033e3f51@gmail.com> References: <20200225222226.GB2558983@highrise.localdomain> <46f83088-e5f8-b3e6-b54c-7e06033e3f51@gmail.com> Message-ID: <20200226010349.GC2558983@highrise.localdomain> On Wed, 26 Feb 2020, Beno?t Minisini wrote: > > Talking to Christof today and thinking about this, the suggestions are > > pretty much what we need. The interpreter flag and that it calls a pre- > > defined startup class is quite a nice and uniform solution. > > > > We were thinking about ways to pass a very fine-grained selection of > > test modules and test methods to run to gb.test and one possibility is > > passing a JSON object with a to > > mapping. The interpreter would NOT have to read this JSON string, > > it would just normally pass this string on to the application as part > > of Args, i.e. like this > > > > gbx3 -t $PROJECT -- $JSON_GIBBERISH # or -T if -t is taken > > > > The JSON format and its handling then is an implementation detail of > > gb.test. Consequently the interpreter would have to pass ALL test > > module Class objects to gb.test's Main and the test framework does > > the actual selection. What do you think about that? > > The problem is that only the interpreter can load the test modules. > 'gb.test' can't, as they are not exported. > > So I was thinking that -t will receive the list of tests, and that the > interpreter will load the needed test modules and pass them to 'gb.test' > startup method. > > On the other hand, it is of course more flexible to let 'gb.test' handle the > test argument. But either the interpreter loads the needed modules for it, > either it gives 'gb.test' a callback to load them by name. > Would it be so bad if the interpreter loaded all test modules upfront and passed them all? Certainly that's a waste if only one module was needed, but does it matter? I have no idea how costly loading a class normally is. Or yes, you could provide this Application.Tests property as a virtual collection which fetches test modules on demand... > > > > There should probably be simpler fallback formats for when you want > > to run all methods in one named module... You should not be required > > to write JSON unless you need maximal flexibility. But that can all > > be delegated to command-line arguments handled by gb.test's Main. > > > > I prefer a basic text format instead of JSON. For example, a list of > "Class.Method" with "*" meaning everything. > That's just as good with me. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk From t.lee.davidson at gmail.com Wed Feb 26 04:32:43 2020 From: t.lee.davidson at gmail.com (T Lee Davidson) Date: Tue, 25 Feb 2020 22:32:43 -0500 Subject: [Gambas-user] Update ide Package module for shared libraries, Make installation packages to have preinst and postinst scripts In-Reply-To: <605B1DED34848F44.75f254a8-cb06-44ce-b484-070df41ac4c0@mail.outlook.com> References: <1692603755.10145.1582592820857.JavaMail.zimbra@westwoodsvcs.com> <1afce22a-234f-eb41-d7ff-80d7a619c434@gmail.com> <605B1DED34848F44.02f576bf-210c-426a-a189-11971398daa8@mail.outlook.com> <1174772483.10272.1582646501930.JavaMail.zimbra@westwoodsvcs.com> <6578572c-1741-4138-f053-d97c1bbe85a1@gmail.com> <2121380019.10360.1582649969213.JavaMail.zimbra@westwoodsvcs.com> <180f88c8-b1f2-16bc-7519-464200a0035e@gmail.com> <605B1DED34848F44.75f254a8-cb06-44ce-b484-070df41ac4c0@mail.outlook.com> Message-ID: On 2/25/20 6:20 PM, Brian G wrote: > Yes that is what I am suggesting > > thank you > brian > I was speaking of Semantic Versioning independently of what you are suggesting. In my reading of your previous message, I did not realize the underscore character was not merely your way of formatting the message. "The package name is only considered to the first '_' and the rest is versioning," would have been more clear to my feeble mind. Now I understand how what you are suggesting might be helpful. -------- [ http://gambaswiki.org/wiki/doc/netiquette ] --------- -- Lee > > On Tue, Feb 25, 2020 at 2:29 PM -0800, "T Lee Davidson" > wrote: > > On 2/25/20 11:59 AM, Brian G wrote: > > Debian deletes all older versions and replaces it with the newer version. Applications depending on the older version of the interface will now fail. > > Not necessarily. The applications might fail if the newer version is not backwards compatible. > > With Semantic Versioning, the Minor and Patch versions should maintain backwards compatibility. If an upgrade is not backwards > compatible, then the Major version number should bump. And, that would change the name of the file. > From chrisml at deganius.de Wed Feb 26 10:28:41 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Wed, 26 Feb 2020 10:28:41 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <46f83088-e5f8-b3e6-b54c-7e06033e3f51@gmail.com> References: <20200225222226.GB2558983@highrise.localdomain> <46f83088-e5f8-b3e6-b54c-7e06033e3f51@gmail.com> Message-ID: <9e063417-f393-6e8f-1831-2300c14c9c37@deganius.de> Am 26.02.20 um 00:20 schrieb Beno?t Minisini: > The problem is that only the interpreter can load the test modules. > 'gb.test' can't, as they are not exported. > > So I was thinking that -t will receive the list of tests, and that the > interpreter will load the needed test modules and pass them to 'gb.test' > startup method. gb.test already has the ability to iterate through all classes and is able to orchestrate it by itself. So if it could have access to an array with all classes in it that would be fine. I can alter it so that it's main method call is: 1) Unittest(Tests as String) if there exists a (hidden?) global variable which contains all loaded testclasses. Could this variable be like a readonly property which loads it's content only if it is read? 2) I would like to keep gb.test's main method's name "Unittest", because Test is a handy name if one wants to test other things inside the project. Is that ok? 3) If we would hide the Unittest main method, would it prevent the author from calling it from inside the project? I do not like the idea very much because while programming I often use Unittest in a start method and simply hit F5. So that in future I could call sth like: Unittest("testmodule1.testmethod3") > I prefer a basic text format instead of JSON. For example, a list of > "Class.Method" with "*" meaning everything. I understand, so we keep the dependencies small. I'm fine with that. The teststring could be like so: "List:testmodule1,testmodule17.testmethodBlah,testmodule99" For all: "*" "List:" is just a description of the format, maybe we want later handover something other, like "Csv:..." or even "Json:..." Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From adamnt42 at gmail.com Wed Feb 26 11:42:01 2020 From: adamnt42 at gmail.com (Bruce) Date: Wed, 26 Feb 2020 21:12:01 +1030 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <9e063417-f393-6e8f-1831-2300c14c9c37@deganius.de> References: <20200225222226.GB2558983@highrise.localdomain> <46f83088-e5f8-b3e6-b54c-7e06033e3f51@gmail.com> <9e063417-f393-6e8f-1831-2300c14c9c37@deganius.de> Message-ID: <1a1cd4d5-8811-1c67-4a71-6940d67e32a5@gmail.com> (scuse - butting in) On 2/26/20 7:58 PM, Christof Thalhofer wrote: > 1) Unittest(Tests as String) if there exists a (hidden?) global variable > which contains all loaded testclasses. Could this variable be like a > readonly property which loads it's content only if it is read? research a pattern called "lazyload" regards b From chrisml at deganius.de Wed Feb 26 19:43:42 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Wed, 26 Feb 2020 19:43:42 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <20200225110439.GB2346311@highrise.localdomain> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> Message-ID: <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> Hello Tobias, in your branch gb.test.tab: Could you restore the three BailOuts with Quit in the gb.test component as we spoke and comment them with "Emergency Stop"? If gb.test there prints out pure TAP without summary by default we could merge it into master. Am I right with this conclusion? Then I could continue working on gb.test in master and we could marry it with the interpreter. After that we can concentrate on the GUI. Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From taboege at gmail.com Thu Feb 27 11:58:45 2020 From: taboege at gmail.com (Tobias Boege) Date: Thu, 27 Feb 2020 11:58:45 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> Message-ID: <20200227105845.GF2558983@highrise.localdomain> On Wed, 26 Feb 2020, Christof Thalhofer wrote: > Hello Tobias, > > in your branch gb.test.tab: > > Could you restore the three BailOuts with Quit in the gb.test component > as we spoke and comment them with "Emergency Stop"? > > If gb.test there prints out pure TAP without summary by default we could > merge it into master. Am I right with this conclusion? > > Then I could continue working on gb.test in master and we could marry it > with the interpreter. After that we can concentrate on the GUI. > I will have to finish this on the train and push later today. But here is what I'll do: I'll restore BailOuts and Quits and rebase on current master. There will be a slight inconvenience you will notice when you run the self- tests of gb.test: for the self-tests I connected the Assert module to a string stream which is read by the TestHarness to produce UnitTest.PrintSummary() afterwards. But it is *not* read in realtime and it is not echoed to the console. Since everything is in one process, all the tests first have to be run, their results buffered (in a string, not the console) and then the TAP can be summarized and echoed. Unfortunately, when an error happens, as in TestFailures.test, the process is Quit before that routine gets to run and until that routine runs, you see nothing! But this is just a temporary issue. I add a flag which disables the string stream stuff (also disables PrintSummary) and prints TAP directly to console as it is Assert'ed. You can use that to verify that TestFailures still works. And an observation: do we still need the inheritance hierarchy of ITest and ITestCase now that tests are identified by the .test extension? Their names are kind of funky and they are almost empty. Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From chrisml at deganius.de Thu Feb 27 18:34:18 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Thu, 27 Feb 2020 18:34:18 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <20200227105845.GF2558983@highrise.localdomain> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> <20200227105845.GF2558983@highrise.localdomain> Message-ID: Am 27.02.20 um 11:58 schrieb Tobias Boege: > I will have to finish this on the train and push later today. But here is > what I'll do: I'll restore BailOuts and Quits and rebase on current master. Ok. Depending on where you are, you might have more time. Here in Bavaria they stop the trains because of storm warnings ... have a nice journey! :-) > There will be a slight inconvenience you will notice when you run the self- > tests of gb.test: for the self-tests I connected the Assert module to a > string stream which is read by the TestHarness to produce UnitTest.PrintSummary() > afterwards. But it is *not* read in realtime and it is not echoed to the > console. Since everything is in one process, all the tests first have to > be run, their results buffered (in a string, not the console) and then the > TAP can be summarized and echoed. I think that you are aware of the fact that this behavior is not what we want. Each assertion has to be printed out as soon as it happened so that a crash of the whole system ... ah yes, you are ...: > Unfortunately, when an error happens, as in TestFailures.test, the process > is Quit before that routine gets to run and until that routine runs, you see > nothing! But this is just a temporary issue. I add a flag which disables > the string stream stuff (also disables PrintSummary) and prints TAP directly > to console as it is Assert'ed. You can use that to verify that TestFailures > still works. The last one is what we always expect from gb.test running inside the project to be tested, so I think this should be the default. It has to print out pure TAP. Parsing, analyzing etc. has to be done "from outside" by the process which tests the project and here gb.test.tap can unfold its full beauty. > And an observation: do we still need the inheritance hierarchy of ITest > and ITestCase now that tests are identified by the .test extension? > Their names are kind of funky and they are almost empty. I also thought of better getting rid of them. They are leftovers of the software archaeology thing I did in earlier days. Their main purpose is that each dependent has a method Run(). Naturally this can be done easier but as soon as you comment out "Inherits iTest" anywhere the whole house of cards collapses. I was just too lazy to search for the reason. If your train ride is really boring, maybe you can find the energy to do it. Funky was ferrry nice back in the eighties ... ... I always think of a test pyjamas suit. ;-) Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Fri Feb 28 10:33:25 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 28 Feb 2020 10:33:25 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> <20200227105845.GF2558983@highrise.localdomain> Message-ID: <14c01df6-4be1-828a-a3fa-e3d3107a08b0@deganius.de> Hi, afaics the work in branch gb.test.tap is finished, it can be rebased or merged into master. Are there any complaints? Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From taboege at gmail.com Fri Feb 28 16:57:44 2020 From: taboege at gmail.com (Tobias Boege) Date: Fri, 28 Feb 2020 16:57:44 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <14c01df6-4be1-828a-a3fa-e3d3107a08b0@deganius.de> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> <20200227105845.GF2558983@highrise.localdomain> <14c01df6-4be1-828a-a3fa-e3d3107a08b0@deganius.de> Message-ID: <20200228155744.GA1434@highrise.localdomain> On Fri, 28 Feb 2020, Christof Thalhofer wrote: > Hi, > > afaics the work in branch gb.test.tap is finished, it can be rebased or > merged into master. Are there any complaints? > I have one more commit in the works that: - fixes one or two bugs in gb.test.tap, - takes harness-related code from gb.test and puts it into gbt3, removing related string stream clutter I put into gb.test, - adds one or two improvements to gbt3. All of these are entangled. Afterwards, the concept of self-tests in gb.test is gone. It will test the "current project" according to what is inside of the .../.test file. If you run gb.test's startup class, it will just print out TAP in realtime, no buffering but also no summary. To run tests (with the help of gb.test), capture, parse and summarize their TAP output, gbt3 will have to be used. This is based on the current tip of gb.test.tap of course, but it seems like a good idea to make another branch for it, so that it can be reviewed separately, in case any change is contentious. Regards, Tobias -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From chrisml at deganius.de Fri Feb 28 18:01:09 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 28 Feb 2020 18:01:09 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <14c01df6-4be1-828a-a3fa-e3d3107a08b0@deganius.de> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> <20200227105845.GF2558983@highrise.localdomain> <14c01df6-4be1-828a-a3fa-e3d3107a08b0@deganius.de> Message-ID: <8c0e0087-d771-0fe1-853b-b778ea1434ec@deganius.de> Am 28.02.20 um 10:33 schrieb Christof Thalhofer: > afaics the work in branch gb.test.tap is finished, it can be rebased or > merged into master. Are there any complaints? Oh-kay! Now I see sth: The behavior before was: The module TestFailures should run until end and report errors and failures as not ok. Instead it bailouts at "Assert.Equals(oOne, oTwo)" in "TestEqualsFailure()" with "Bail out! Unittest stopped with error "Type mismatch: wanted String, got Object instead" caused by TestFailures.TestEqualsFailure." *This is definitely wrong!* There are two different objects involved, not a string ... But! This can only be seen if "TestDoACrash" is renamed to "TestZDoACrash" because this bailouts also, but earlier. The last one could be a meaningful decision. But my decision before was: ---------------------------------------------------------- Failures and errors in testmethods or tested code are reported as "not ok" and get a diagnosis note. It cannot be distinguished between test code and tested code. Both is written by the programmer, both can contain failures. This happens in TestSuite.Run() and in TestCase.Run() by encapsulating Object.Call() with Try and investigating errors or crashes afterwards. But a crash, or error in gb.test itself leads to a BailOut. Or ? if the programmer wants to Bailout this can be done with Assert.Bailout(). A BailOut (in my opinion) is a situation, where there is no answer possible any more. An Error instead is a defined response of the system. Maybe one doesn't like it, but it is a defined answer. But now an error in a testmethod or a tested method always leads to a BailOut. I do not like this decision. If I want to see "not ok" on errors I cannot do this any more ... but it was possible before! For example: I never would have found out that Assert.Equals(oOne, oTwo) with two objects says something wrong about having detected a string ... because the system bailed out before. I am aware that I am now saying something different than in a previous mail. I can only say that I did not have a complete overview of this before. Only when something is suddenly missing, which you did a year ago, you understand why you did it. ---------------------------------------------------------- As I said in an earlier mail: I have finetuned the testing over a long time in different situations, while working with it. Especially the behavior how it handles errors and crashes. Now a meaningful behavior has disappeared. I definetely do not like this! ---------------------------------------------------------- To restore the (better) behavior of the system before (and also satisfy aesthetics): Every "Object.Call" in TestCase and TestSuite must have a leading Try and if an error happened it has to be printed out by Assert in gb.test.tap. Would you do this, Tobi, or should I? Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Fri Feb 28 19:08:25 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Fri, 28 Feb 2020 19:08:25 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <20200228155744.GA1434@highrise.localdomain> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> <20200227105845.GF2558983@highrise.localdomain> <14c01df6-4be1-828a-a3fa-e3d3107a08b0@deganius.de> <20200228155744.GA1434@highrise.localdomain> Message-ID: <1fcaf21d-0d15-7191-02f1-6958944f094b@deganius.de> Am 28.02.20 um 16:57 schrieb Tobias Boege: > I have one more commit in the works that: Ah ok, so there is still some work to be done, including what we just discussed on the phone. No rush, have a nice weekend! Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From chrisml at deganius.de Sat Feb 29 07:13:52 2020 From: chrisml at deganius.de (Christof Thalhofer) Date: Sat, 29 Feb 2020 07:13:52 +0100 Subject: [Gambas-user] Questions about gb.test and gb.test.tap In-Reply-To: <1fcaf21d-0d15-7191-02f1-6958944f094b@deganius.de> References: <20200224222058.GA2318325@highrise.localdomain> <47c4a9fe-0d7c-0ef5-5ca6-931b7f02ee6e@deganius.de> <7647e708-2c81-5183-6cf3-cc873b1f567d@gmail.com> <20200225110439.GB2346311@highrise.localdomain> <52675360-6ab2-9c81-da6d-13e74df0499b@deganius.de> <20200227105845.GF2558983@highrise.localdomain> <14c01df6-4be1-828a-a3fa-e3d3107a08b0@deganius.de> <20200228155744.GA1434@highrise.localdomain> <1fcaf21d-0d15-7191-02f1-6958944f094b@deganius.de> Message-ID: Dear Tobias, now I just had an idea about architecture. What about putting the assertions in gb.test, but print and parse in gb.test.tap and the GUI afterwards in a gb.test.tap.gui. Then the TAP-printer could actually be exchanged for a (now) fictive log-printer without ever having to change the test code because the assertions already are in gb.test. The assertions would also only have to be kept once, otherwise they would have to be duplicated ... Alles Gute Christof Thalhofer -- Dies ist keine Signatur -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: