Changeset e6cfb4e2


Ignore:
Timestamp:
Sep 28, 2020, 3:03:53 PM (14 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
7ab28b6
Parents:
8a71d8e
Message:

synteax only tests now cp error log into target file.
Small refactoring.
Added comments to test.py

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r8a71d8e re6cfb4e2  
    139139# tests that just validate syntax and compiler output should be compared to stderr
    140140SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment
     141CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@})
    141142$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
    142         $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only 2> $(abspath ${@})
     143        $(CFACOMPILE_SYNTAX)
     144        $(if $(test), cp $(test) $(abspath ${@}), )
    143145
    144146# expected failures
    145 # use custom target since they require a custom define and custom dependencies
     147# use custom target since they require a custom define *and* have a name that doesn't match the file
    146148alloc-ERROR : alloc.cfa $(CFACCBIN)
    147         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     149        $(CFACOMPILE_SYNTAX) -DERR1
     150        -cp $(test) $(abspath ${@})
    148151
    149152typedefRedef-ERR1 : typedefRedef.cfa $(CFACCBIN)
    150         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     153        $(CFACOMPILE_SYNTAX) -DERR1
     154        -cp $(test) $(abspath ${@})
    151155
    152156nested-types-ERR1 : nested-types.cfa $(CFACCBIN)
    153         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     157        $(CFACOMPILE_SYNTAX) -DERR1
     158        -cp $(test) $(abspath ${@})
    154159
    155160nested-types-ERR2 : nested-types.cfa $(CFACCBIN)
    156         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     161        $(CFACOMPILE_SYNTAX) -DERR2
     162        -cp $(test) $(abspath ${@})
    157163
    158164raii/memberCtors-ERR1 : raii/memberCtors.cfa $(CFACCBIN)
    159         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     165        $(CFACOMPILE_SYNTAX) -DERR1
     166        -cp $(test) $(abspath ${@})
    160167
    161168raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa $(CFACCBIN)
    162         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     169        $(CFACOMPILE_SYNTAX) -DERR1
     170        -cp $(test) $(abspath ${@})
    163171
    164172raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa $(CFACCBIN)
    165         $(CFACOMPILETEST) -DERR1 -c -fsyntax-only -o $(abspath ${@})
     173        $(CFACOMPILE_SYNTAX) -DERR1
     174        -cp $(test) $(abspath ${@})
    166175
    167176raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa $(CFACCBIN)
    168         $(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
     177        $(CFACOMPILE_SYNTAX) -DERR2
     178        -cp $(test) $(abspath ${@})
    169179
    170180# Exception Tests
  • tests/test.py

    r8a71d8e re6cfb4e2  
    173173        test.prepare()
    174174
     175        # ----------
     176        # MAKE
     177        # ----------
    175178        # build, skipping to next test on error
    176179        with Timed() as comp_dur:
    177180                make_ret, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file )
    178181
     182        # ----------
     183        # RUN
     184        # ----------
     185        # run everything in a temp directory to make sure core file are handled properly
    179186        run_dur = None
    180         # run everything in a temp directory to make sure core file are handled properly
    181187        with tempdir():
    182188                # if the make command succeeds continue otherwise skip to diff
Note: See TracChangeset for help on using the changeset viewer.