~ubuntu-branches/ubuntu/quantal/astk/quantal

« back to all changes in this revision

Viewing changes to ASTK_SERV/unittest/etude/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Trophime
  • Date: 2010-04-25 16:43:13 UTC
  • Revision ID: james.westby@ubuntu.com-20100425164313-0s0wtsmbiewbdz53
Tags: upstream-1.8.0
ImportĀ upstreamĀ versionĀ 1.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
default: diag
 
2
 
 
3
TEST = etude
 
4
TODELETE = $(TEST).export $(TEST).comm test.py stanley.py pyobj cmdline pystan base_results P1
 
5
 
 
6
include ../Makefile.inc
 
7
 
 
8
$(TEST).comm:
 
9
        @echo 'DEBUT()' > $(TEST).tmp
 
10
        @echo 'P1 = 9999'              >> $(TEST).tmp
 
11
        @echo 'print "PARAMETER=", P1' >> $(TEST).tmp
 
12
        @echo 'open("./REPE_OUT/parameter", "w").write("PARAMETER=%s\\n" % P1)' >> $(TEST).tmp
 
13
        @echo 'FIN()'  >> $(TEST).tmp
 
14
        @mv -f $(TEST).tmp $@
 
15
 
 
16
cmdline: $(TEST).export $(TEST).comm
 
17
        $(as_run) $< > output.1.$@ 2> error.1.$@
 
18
        @grep EXIT_CODE output.1.$@ > $@
 
19
 
 
20
pyobj: $(TEST).export $(TEST).comm test.py
 
21
        $(PYTHONEXECUTABLE) test.py > output.2.$@ 2> error.2.$@
 
22
        @grep EXIT_CODE output.2.$@ > $@
 
23
 
 
24
base_results: pyobj
 
25
 
 
26
pystan: $(TEST).export base_results stanley.py
 
27
        $(PYTHONEXECUTABLE) stanley.py > output.3.$@ 2> error.3.$@
 
28
        @grep EXIT_CODE output.3.$@ > $@
 
29
 
 
30
unittest: cmdline pyobj pystan
 
31
        @echo "EXIT_CODE=0" > exit_code.tmp
 
32
        @if  [ `grep -c EXIT_CODE=0 cmdline`  -ne 1 ] || \
 
33
             [ `grep -c EXIT_CODE=0 pyobj` -ne 1 ] || \
 
34
             [ `grep -c EXIT_CODE=0 pystan` -ne 1 ]; then \
 
35
           echo "EXIT_CODE=104" > exit_code.tmp; \
 
36
        fi
 
37
        @mv -f exit_code.tmp $@
 
38