Re: Proposal Accepted for GSoC

2018-04-26 Thread Al Pacifico
Matthias and Vishal-

On Wed, Apr 25, 2018 at 11:43 AM, Mathieu Lirzin  wrote:

> Hello Vishal,
>
> Vishal Gupta  writes:
>
> > My proposal for the project " Parse Makefile.am using abstract syntax
> > tree" has been accepted and I am excited to start working on the same.
>
> Congrats!
>
> > The community bonding period will be till 14th May. As discussed in
> > the proposal, I will be working on improving my perl skills and
> > understanding the Automake's Code. Some queries about that :
> >
> > 1) Good resource for studying Perl and important concepts required for
> > completing the project. A short task of 4-5 days would be great for
> > testing my knowledge of perl and quantify my progress.
>
> Like I said to Matthias, Perl comes with an extensive set of manpages
> which consist of tutorials and reference manuals.  ‘perlintro(1)’ is a
> good entry point.  The “Learning Perl” book by Tom Phoenix and Randal
> Schwartz is a nice introduction to Perl.
>
> You will need to get familiar with perl references which is a somewhat
> advance topic in order to build recursive structure for the AST.
>
> To learn Perl I think it is important to have an interactive environment
> ‘perl -d -e ''’ is useful for that.
>

I'd like to add to what Mathieu wrote regarding becoming familiar with Perl.

I have used Perl off and on extensively over the past 20-odd years and
there are eight Perl books on my bookshelf.  I'm guessing that you will be
using its object-oriented features for this project, and looking over my
second edition of "Learning Perl," it has no coverage of OO features,
although they are mentioned on pages 195-197.

My recollection is that I learned most about Perl's OO features from Damian
Conway's "Object Oriented Perl"

which
is available as a used book very cheaply.  Probably the chapter on OO
features in the hefty O'Reilly title "Programming Perl"

(AKA "the Camel book") would do just as well.  If I were to own one Perl
book, it would be the Camel, but it is pricey.

-Al

>
> > 2) How to go about understanding the Automake code .
>
> The first step is to compile it from the Git repository and report
> unclear points.  I encourage you to get familiar with Automake from a
> user perspective by creating build definitions for some dummy C programs
> and libraries by following the Automake manual which is nicely written.
>
> > 3) Any other task required to be completed during the community bonding
> period.
>
> I think, it is important that you get more familiar with Git usage and
> good practices before the coding period.  There is a lot of resources
> online and particularly a great book freely available:
>
>   https://git-scm.com/book/en/v2
>
> > As discussed in the proposal that I will be having my exams from 8th
> > to 15th May, so I will try to complete the work before that time.
>
> No problem.
>
> If you have any question or difficulty in your discovery, you can ask on
> the #autotools IRC channel on Freenode or directly to me (my pseudo is
> ‘mthl’).  I am not sure about your actual timezone (mine is UTC+2) but
> if you are from India don't expect me to available too soon in the
> morning.  :-)
>
> HTH,
>
> --
> Mathieu Lirzin
> GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37
>
>


-- 
Please forgive typo's, equally likely to have been typed on cell phone and
to have been typed one-handed.


Data files for unit-testing

2007-11-07 Thread Al Pacifico
What is the best way to distribute data files for use with the check target?

I'm building a C library and using the check unit testing framework.
Several functions load data from XML files and are tested with make
check. These files need to be distributed, but not installed.

Directory structure is simple:
.
|-- autom4te.cache
|-- build-aux
|-- src
|-- tests

tests/Makefile.am contains:
TESTS = check_suggest
check_PROGRAMS = check_suggest
check_suggest_SOURCES = check_suggest.c $(top_builddir)/src/suggest.h
check_suggest_CFLAGS = @CHECK_CFLAGS@
check_suggest_LDADD = @CHECK_LIBS@ $(top_builddir)/src/libsuggest.la
check_DATA = sample.xml bogus.xml

When I make check, sample.xml and bogus.xml aren't created... what
should I do differently?
-al
-- 
Al Pacifico
Seattle, WA




Re: Data files for unit-testing

2007-11-08 Thread Al Pacifico
On Nov 7, 2007 10:26 PM, Ralf Wildenhues <[EMAIL PROTECTED]> wrote:
> Hello Al,
>
> * Al Pacifico wrote on Wed, Nov 07, 2007 at 11:27:41PM CET:
> > What is the best way to distribute data files for use with the check target?
> [...]
> > tests/Makefile.am contains:
> > TESTS = check_suggest
> > check_PROGRAMS = check_suggest
> > check_suggest_SOURCES = check_suggest.c $(top_builddir)/src/suggest.h
> > check_suggest_CFLAGS = @CHECK_CFLAGS@
> > check_suggest_LDADD = @CHECK_LIBS@ $(top_builddir)/src/libsuggest.la
> > check_DATA = sample.xml bogus.xml
>
> To just distribute them I'd say try dist_check_DATA.

That doesn't seem to work.

>
> > When I make check, sample.xml and bogus.xml aren't created... what
> > should I do differently?
>
> Well, what are they created from, and how?  It seems you need to specify
> their dependencies and rules to create them.

I am building in a separate directory and when I say they aren't
created, I really mean they are not copied (apologies, I should have
been more precise).

The manual (http://www.gnu.org/software/automake/manual/automake.html#Tests)
says:
"If the variable TESTS is defined, its value is taken to be a list of
programs or scripts to run in order to do the testing. Programs
needing data files should look for them in srcdir (which is both an
environment variable and a make variable) so they work when building
in a separate directory (see Build Directories), and in particular for
the distcheck rule (see Dist)."

On re-reading that, I moved them from the tests subdirectory to src, and added
"dist_check_DATA = sample.xml bogus.xml"
to src/Makefile.am, but that didn't work. I've also tried changing the
line in tests/Makefile.am to "dist_check_DATA = ../src/sample.xml
../src/bogus.xml" (don't like all the hard-coding of paths,
side-question is how to avoid that), but they still aren't copied.

BTW I am using autoconf 2.61 and automake 1.10, in case you're wondering.

There was a "How do a copy a file" thread recently, but the problem
there was choosing a directory to put the data for the tests in...
seemed like having it in src really is the best choice, and since the
manual said that was proper, I've decided to leave it that way.

If I have to do this manually, where should the shell commands go?.

Ideas?
>
> Cheers,
> Ralf
>



-- 
Al Pacifico
Seattle, WA