[Top][All Lists]

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

Question on TESTS_ENVIRONMENT use in serial-test

From: Arthur Schwarz
Subject: Question on TESTS_ENVIRONMENT use in serial-test
Date: Mon, 4 May 2015 14:33:21 -0700

In 15.2.2 Older (and discouraged) serial test harness there is an example

   TESTS_ENVIRONMENT = $(PERL) -Mstrict -w
   TESTS =

I haven't written a little to test some conjectures (a pedantic
'guess). The example seems to indicate that the (undefined) $(PERL) compiles
all the programs in TESTS and these programs can only be perl programs. But
since perl requires a shebang (#!/usr/bin/perl) as the first executable
line, the execution might as well be from calling the program from bash. How
do I determine that program execution is from using the TESTS_ENVIRONMENT
variable and not from a direct call to bash?

The appearance is that when TESTS_ENVIRONMENT is used then the only tests
allowed in TESTS are perl programs. Since shell script and perl programs
both have the first line as the shebang, how can I verify that when TESTS
contains a mixed bag of test programs that the TESTS_ENVIRONMENT perl
compiler is called? Or is the assumption that the example requires that when
TESTS_ENVIRONMENT is used that the TESTS variable only reference test
programs which can be compiled by the TESTS_ENVIRONMENT compiler incorrect?

I have tried both with TESTS = perl_program and TESTS = perl_program
bash_script with the same result. 

The basic question is how is the association between the compiler in
TESTS_ENVIRONMENT and the test program in TESTS made. In parallel processing
this association is made explicit using TEST_EXTENSIONS and the various
ext_SOMETHING. There is no clear rule here other than an example which
leaves as many questions as it answers.


=================== ===================

## Process this file with automake to produce

# select testing format
AUTOMAKE_OPTIONS = serial-tests 

# set compiler for perl program
TESTS_ENVIRONMENT = /usr/bin/perl 

# Testing 
check_SCRIPTS      =
TESTS              = $(check_SCRIPTS)
        echo '#!/bin/bash'       >
        echo "echo 'PASS: 0'"   >>
        echo "exit 0"           >>
        chmod +x
        echo "#!/usr/bin/perl"           >
        echo "use warnings; "           >>
        echo 'print "Hello, World!\n";' >>
        echo "exit 0;"                  >>
        chmod +x

CLEANFILES         = $(test_SOURCES)

reply via email to

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