From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4C41EF4B.300@bouyapop.org> Date: Sat, 17 Jul 2010 19:58:35 +0200 From: Philippe Anel User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: 9fans@9fans.net References: <5932535ca83ee3b6d9d00c691cb1e814@9netics.com> In-Reply-To: <5932535ca83ee3b6d9d00c691cb1e814@9netics.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [9fans] acid question Topicbox-Message-UUID: 40207942-ead6-11e9-9d60-3106f5b1d025 Not needed in my opinion. Acid can also helps. If we decide that function marked for unit testing with a known regexp such as ending by _Test ... defn utest() { sl = symbols; while sl do { s = head sl; if (regexp(".*_Test", s[0])) then { call(s[2]); } sl = tail sl; } } This would call every function whose name is ending with _Test. Phil; On 7/17/2010 7:23 PM, Skip Tavakkolian wrote: > nice. i'll give it a try later. > > thinking outloud here; it seems that one could extend the capability > of ?c for generating acid code to include creating call wrapper > for any function that is marked for unit testing (perhaps another > #pragma?) > >> This one sounds like to work (except it does not save registers) ... >> >> defn call(addr) >> { >> local pco; >> >> // we need stack space, and thus process stopped. >> if status(pid) != "Stopped" then { >> print("Waiting...\n"); >> stop(pid); >> } >> >> // Backup orginal instruction >> pco = fmt(*PC, bpfmt); >> >> // Put a temporary breakpoint >> **PC = bpinst; >> >> // update stack pointer >> *SP = *SP - 4; >> >> // make called function returning to this point >> **SP = *PC; >> >> // set PC to function to call >> *PC = addr; >> >> // do the call >> startstop(pid); >> >> // restore original instruction >> *PC = pco; >> } >> >> Phil; > >