automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to run TESTS automatically on each source code change?


From: Pippijn van Steenhoven
Subject: Re: How to run TESTS automatically on each source code change?
Date: Thu, 31 Jul 2014 12:37:29 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jul 24, 2014 at 4:48 PM, Steffen Dettmer <address@hidden> wrote:
> Hi,
>
> I have a test that generates a log file, which I can manually run via
> "make check". Is there a simple way to automate that? For the moment I
> just created a pragmatic target "autotest", but I think it is ugly
> (and too specific).

Hi,

You may want to look into inotify-tools, in particular inotifywait. You
can use it to monitor a list of files or optionally recursive directories
for changes and do something like:

  while true; do inotifywait <file> ...; make check; done

If the list of files is very large, the set-up can take a long time
(several seconds for tens of thousands of files). In that case, you may
want to write a smarter script with "inotifywatch" that has the set-up
cost only once, and then you just monitor inotifywatch's standard output.
If your list of files is extremely large, then you may run out of kernel
memory or the user limit on inotify watches. In the latter case, you can
increase the limit in /etc/sysctl.conf (the relevant variable is
fs.inotify.max_user_watches). In the former case, you really have a very
large file list and you may want to restrict it to your current working
set.

I hope this helps.

Pippijn

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]