9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Philippe Anel <xigh@bouyapop.org>
To: 9fans@9fans.net
Subject: Re: [9fans] acid question
Date: Sat, 17 Jul 2010 19:58:35 +0200	[thread overview]
Message-ID: <4C41EF4B.300@bouyapop.org> (raw)
In-Reply-To: <5932535ca83ee3b6d9d00c691cb1e814@9netics.com>

  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;
>
>




  reply	other threads:[~2010-07-17 17:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-17  8:33 Skip Tavakkolian
2010-07-17  8:48 ` EBo
2010-07-17  9:19   ` Skip Tavakkolian
2010-07-17 12:15     ` EBo
2010-07-17 15:00 ` Philippe Anel
2010-07-17 15:56   ` Philippe Anel
2010-07-17 16:46     ` cinap_lenrek
2010-07-17 16:48     ` cinap_lenrek
2010-07-17 17:23     ` Skip Tavakkolian
2010-07-17 17:58       ` Philippe Anel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-08  3:36 Tim Newsham
2005-01-08  5:41 ` Rob Pike
2005-01-08  6:34   ` Tim Newsham
2005-01-08 21:46 ` Tim Newsham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C41EF4B.300@bouyapop.org \
    --to=xigh@bouyapop.org \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).