Changeset f7d3215


Ignore:
Timestamp:
Aug 20, 2018, 2:29:35 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
72b3605
Parents:
69efc321
Message:

Hopefully more robust fix for relative vs absolutepaths in tests

Location:
tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r69efc321 rf7d3215  
    3838CC = @CFACC@
    3939
     40PRETTY_PATH=cd ${srcdir} &&
     41
    4042.PHONY: list .validate
    4143.INTERMEDIATE: .validate .validate.c
     
    7173# implicit rule so not all test require a rule
    7274% : %.c $(CC)
    73         $(COMPILE) $(abspath ${<}) -o ${@}
     75        $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    7476
    7577declarationSpecifier: declarationSpecifier.c $(CC)
    76         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     78        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    7779
    7880gccExtensions : gccExtensions.c $(CC)
    79         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     81        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8082
    8183extension : extension.c $(CC)
    82         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     84        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8385
    8486attributes : attributes.c $(CC)
    85         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     87        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8688
    8789functions: functions.c $(CC)
    88         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     90        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8991
    9092KRfunctions : KRfunctions.c $(CC)
    91         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     93        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    9294
    9395sched-ext-parse : sched-ext-parse.c $(CC)
    94         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     96        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    9597
    9698gmp : gmp.c $(CC)
    97         $(COMPILE) -lgmp $(abspath ${<}) -o ${@}
     99        $(PRETTY_PATH) $(COMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    98100
     101#builtins
     102builtins/sync: builtins/sync.c $(CC)
     103        $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     104
     105#------------------------------------------------------------------------------
     106#To make errors path independent we need to cd into the correct directories
    99107completeTypeError : completeTypeError.c $(CC)
    100         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     108        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    101109
    102110typedefRedef-ERR1: typedefRedef.c $(CC)
    103         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     111        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    104112
    105113alloc-ERROR: alloc.c $(CC)
    106         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     114        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    107115
    108116fallthrough-ERROR: fallthrough.c $(CC)
    109         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     117        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    110118
    111119nested-types-ERR1: nested-types.c $(CC)
    112         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     120        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    113121
    114122nested-types-ERR2: nested-types.c $(CC)
    115         $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
     123        $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    116124
    117125# Constructor/destructor tests
    118126raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CC)
    119         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     127        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    120128
    121129raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CC)
    122         $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
     130        $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    123131
    124132raii/memberCtors-ERR1: raii/memberCtors.c $(CC)
    125         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     133        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    126134
    127135raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CC)
    128         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     136        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    129137
    130138# Warnings
    131139warnings/self-assignment: warnings/self-assignment.c $(CC)
    132         $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
    133 
    134 #builtins
    135 builtins/sync: builtins/sync.c $(CC)
    136         $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
     140        $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
  • tests/Makefile.in

    r69efc321 rf7d3215  
    307307        -quiet @CFA_FLAGS@ -DIN_DIR="${srcdir}/.in/" ${DEBUG_FLAGS} \
    308308        ${INSTALL_FLAGS} ${ARCH_FLAGS}
     309PRETTY_PATH = cd ${srcdir} &&
    309310fstream_test_SOURCES = fstream_test.c
    310311avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
     
    638639# implicit rule so not all test require a rule
    639640% : %.c $(CC)
    640         $(COMPILE) $(abspath ${<}) -o ${@}
     641        $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    641642
    642643declarationSpecifier: declarationSpecifier.c $(CC)
    643         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     644        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    644645
    645646gccExtensions : gccExtensions.c $(CC)
    646         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     647        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    647648
    648649extension : extension.c $(CC)
    649         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     650        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    650651
    651652attributes : attributes.c $(CC)
    652         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     653        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    653654
    654655functions: functions.c $(CC)
    655         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     656        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    656657
    657658KRfunctions : KRfunctions.c $(CC)
    658         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     659        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    659660
    660661sched-ext-parse : sched-ext-parse.c $(CC)
    661         $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
     662        $(PRETTY_PATH) $(COMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    662663
    663664gmp : gmp.c $(CC)
    664         $(COMPILE) -lgmp $(abspath ${<}) -o ${@}
    665 
     665        $(PRETTY_PATH) $(COMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     666
     667#builtins
     668builtins/sync: builtins/sync.c $(CC)
     669        $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     670
     671#------------------------------------------------------------------------------
     672#To make errors path independent we need to cd into the correct directories
    666673completeTypeError : completeTypeError.c $(CC)
    667         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     674        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    668675
    669676typedefRedef-ERR1: typedefRedef.c $(CC)
    670         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     677        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    671678
    672679alloc-ERROR: alloc.c $(CC)
    673         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     680        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    674681
    675682fallthrough-ERROR: fallthrough.c $(CC)
    676         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     683        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    677684
    678685nested-types-ERR1: nested-types.c $(CC)
    679         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     686        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    680687
    681688nested-types-ERR2: nested-types.c $(CC)
    682         $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
     689        $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    683690
    684691# Constructor/destructor tests
    685692raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CC)
    686         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     693        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    687694
    688695raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CC)
    689         $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
     696        $(PRETTY_PATH) $(COMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    690697
    691698raii/memberCtors-ERR1: raii/memberCtors.c $(CC)
    692         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     699        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    693700
    694701raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CC)
    695         $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
     702        $(PRETTY_PATH) $(COMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    696703
    697704# Warnings
    698705warnings/self-assignment: warnings/self-assignment.c $(CC)
    699         $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
    700 
    701 #builtins
    702 builtins/sync: builtins/sync.c $(CC)
    703         $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
     706        $(PRETTY_PATH) $(COMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
    704707
    705708# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • tests/test.py

    r69efc321 rf7d3215  
    174174
    175175        if retcode == 0:
    176                 fixoutput(out_file)
     176                # fixoutput(out_file)
    177177                if settings.generating :
    178178                        # if we are ounly generating the output we still need to check that the test actually exists
Note: See TracChangeset for help on using the changeset viewer.