Ignore:
Timestamp:
May 28, 2013, 11:17:14 AM (11 years ago)
Author:
meunier
Message:

Tried to clean the test_regression directory:

  • Code formatting
  • Supressed warnings
  • Made comprehensible outputs
  • Factorized Makefiles

There's still a lot to do (many tests don't pass for either good or bad reasons)

Location:
sources/test_regression/30032005a
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sources/test_regression/30032005a/Makefile

    r15 r55  
     1
    12include ../env.mk
     3SIGNAL_GRAPH = signal_graph.dot
     4PROCESS_ORDER = process_order.dot
     5MODULE_GRAPH = module_graph.dot
     6PORT_GRAPH = port_graph.dot
     7SIGNAL_ORDER = signal_order.txt
     8ERASE = $(SIGNAL_GRAPH) $(PROCESS_ORDER) $(SIGNAL_ORDER) $(MODULE_GRAPH) $(PORT_GRAPH)
     9include ../Makefile.common
    210
    3 SYSTEM    = system.cpp system2.cpp system3.cpp
    4 EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x)
    5 EXE_SC    = $(SYSTEM:.cpp=_systemc.x)
    6 EXE       = ${EXE_SCASS} ${EXE_SC}
    7 LOG       = $(SYSTEM:.cpp=.log)
    8 OBJECTS   = $(EXE:.x=.o)
    9 LINKS     = $(OBJECTS:.o=.cpp)
     11SIGNAL_GRAPH_REF = signal_graph_ref.dot
     12PROCESS_ORDER_REF = process_order_ref.dot
     13SIGNAL_ORDER_REF = signal_order_ref.txt
     14MODULE_GRAPH_REF = module_graph_ref.dot
    1015
    11 PREFIX = $(SYSTEM:.cpp=)
    12 
    13 #DIFF = $(SYSTEM:.cpp=.diff)
    14 
    15 .SECONDARY:
    16 
    17 #%.diff : %_module_graph_reference.dot %_module_graph.dot
    18 #       diff $*_module_graph_reference.dot $*_module_graph.dot
    19 #       diff $*_signal_graph_reference.dot $*_signal_graph.dot
    20 #       diff $*_module_order_reference.dot $*_module_order.dot
    21 #       diff $*_signal_order_reference.dot $*_signal_order.dot
    22          
    23 #%_signal_graph_reference.dot %_signal_graph.dot \
    24  #        %_module_order_reference.dot %_module_order.dot \
    25   #       %_signal_order_reference.dot %_signal_order.dot
    26 
    27 #%_module_graph.dot : %_systemcass.x
    28 #       $*_systemcass.x --t
    29 #       mv module_graph.dot $*_module_graph.dot
    30 
    31 #%_module_order.dot %_signal_graph.dot %_signal_order.dot : %_systemcass.x
    32 #       $*_systemcass.x --t --p
    33 
    34 main : $(EXE)
    35 
    36 #diff : ${DIFF}
    37 
    38 test : ${EXE}
    39         for i in ${PREFIX} ; do \
    40     echo Testing $$i... ; \
    41     (./$${i}_systemcass.x --t) || eval ${failcom}; \
    42     tail -n +3 module_graph.dot | diff $${i}_module_graph_reference.dot - || eval ${failcom}; \
    43     ./$${i}_systemcass.x --p --t || eval ${failcom}; \
    44     tail -n +3 signal_graph.dot | diff $${i}_signal_graph_reference.dot - \
    45     || tail -n +3 signal_graph.dot | diff $${i}_signal_graph_reference2.dot - \
    46     || eval ${failcom}; \
    47     tail -n +3 process_order.dot | diff $${i}_process_order_reference.dot - || eval ${failcom}; \
    48     diff signal_order.txt $${i}_signal_order_reference.txt \
    49     || diff signal_order.txt $${i}_signal_order_reference2.txt \
    50     || eval ${failcom}; \
    51   done
    52         (./system_systemc.x)  || eval ${failcom}
    53         (./system2_systemc.x) || eval ${failcom}
    54         (./system3_systemc.x) || eval ${failcom}
    55         @echo Test OK.
     16test : $(EXE_SCASS)
     17        @echo -ne "| Testing $$(basename $$(pwd)): " ; \
     18   ./$(EXE_SCASS) --t 2> /dev/null || res=1 ; \
     19        (tail -n +3 $(MODULE_GRAPH) | diff $(MODULE_GRAPH_REF) -) > /dev/null || res=1 ; \
     20   ./$(EXE_SCASS) --p --t 2> /dev/null || res=1 ; \
     21        (tail -n +3 $(SIGNAL_GRAPH) | diff $(SIGNAL_GRAPH_REF) -) > /dev/null || res=1 ; \
     22        (tail -n +3 $(PROCESS_ORDER) | diff $(PROCESS_ORDER_REF) -) > /dev/null || res=1 ; \
     23        diff $(SIGNAL_ORDER_REF) $(SIGNAL_ORDER) > /dev/null || res=1 ; \
     24   if [ x"$$res" = x ] ; then echo "OK" ; else echo "KO" ; fi ;
     25       
    5626
    5727
    58 
    59 %.gif : %.dot
    60         dot -Tgif -o $*.gif $*.dot
    61 
    62 %_systemc.x : %_systemc.o $(SYSTEMC_LIB)
    63         $(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT)
    64 
    65 %_systemcass.x : %_systemcass.o  $(SYSTEMCASS_LIB)
    66         $(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT)
    67 
    68 -include Makefile.deps
    69 
    70 %_systemc.cpp : %.cpp
    71         ln -s $*.cpp $*_systemc.cpp
    72 
    73 %_systemcass.cpp : %.cpp
    74         ln -s $*.cpp $*_systemcass.cpp
    75 
    76 %_systemc.o : %_systemc.cpp
    77         $(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps
    78         $(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o
    79 
    80 %_systemcass.o : %_systemcass.cpp
    81         $(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps
    82         $(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o
    83 
    84 clean :
    85         rm -f Makefile.deps
    86         -rm -f *.o gmon.out
    87         -rm -f *~
    88         -rm -f ${LOG}
    89         -rm -f signal_order.txt module_order.dot signal_graph.dot
    90         -rm -f module_order.gif signal_graph.gif
    91         -rm -f $(EXE) $(OBJECTS)
    92         -for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null
    93         -rm -f core*
    94         -rm -rf generated_by_systemcass
    95         -rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd
    96        
Note: See TracChangeset for help on using the changeset viewer.