Changeset 2b10f95


Ignore:
Timestamp:
Mar 27, 2019, 11:09:15 AM (6 years ago)
Author:
tdelisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
86fb8f2
Parents:
1bb2488
Message:

Improved printing, added support for cpp tests and fix byte string concatenation error

Location:
tests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile.am

    r1bb2488 r2b10f95  
    4848
    4949avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
    50 # automake doesn't know we still need C rules so pretend like we have a C program
    51 _dummy_hack_SOURCES = .dummy_hack.c
     50# automake doesn't know we still need C/CPP rules so pretend like we have a C program
     51_dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
    5252
    5353#----------------------------------------------------------------------------------------------------------------
     
    7474        @echo "int main() { return 0; }" > ${@}
    7575
     76.dummy_hackxx.cpp:
     77        @echo "int bar() { return 0; }" > ${@}
     78
    7679concurrency :
    7780        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
     
    8285% : %.cfa $(CFACC)
    8386        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     87
     88% : %.cpp
     89        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    8490
    8591declarationSpecifier: declarationSpecifier.cfa $(CFACC)
  • tests/Makefile.in

    r1bb2488 r2b10f95  
    107107CONFIG_CLEAN_FILES = config.py
    108108CONFIG_CLEAN_VPATH_FILES = test.py
    109 am__dummy_hack_OBJECTS = .dummy_hack.$(OBJEXT)
     109am__dummy_hack_OBJECTS = .dummy_hack.$(OBJEXT) .dummy_hackxx.$(OBJEXT)
    110110_dummy_hack_OBJECTS = $(am__dummy_hack_OBJECTS)
    111111_dummy_hack_LDADD = $(LDADD)
     
    155155am__v_CCLD_0 = @echo "  CCLD    " $@;
    156156am__v_CCLD_1 =
     157CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     158        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     159LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
     160        $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
     161        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
     162        $(AM_CXXFLAGS) $(CXXFLAGS)
     163AM_V_CXX = $(am__v_CXX_@AM_V@)
     164am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
     165am__v_CXX_0 = @echo "  CXX     " $@;
     166am__v_CXX_1 =
     167CXXLD = $(CXX)
     168CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
     169        $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
     170        $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
     171AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
     172am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
     173am__v_CXXLD_0 = @echo "  CXXLD   " $@;
     174am__v_CXXLD_1 =
    157175SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES)
    158176DIST_SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES)
     
    368386PRETTY_PATH = cd ${srcdir} &&
    369387avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
    370 # automake doesn't know we still need C rules so pretend like we have a C program
    371 _dummy_hack_SOURCES = .dummy_hack.c
     388# automake doesn't know we still need C/CPP rules so pretend like we have a C program
     389_dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
    372390all: all-am
    373391
    374392.SUFFIXES:
    375 .SUFFIXES: .c .cfa .dummy_hack .lo .o .obj .validate
     393.SUFFIXES: .c .cfa .cpp .dummy_hack .dummy_hackxx .lo .o .obj .validate
    376394$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/src/cfa.make $(am__configure_deps)
    377395        @for dep in $?; do \
     
    409427.dummy_hack$(EXEEXT): $(_dummy_hack_OBJECTS) $(_dummy_hack_DEPENDENCIES) $(EXTRA__dummy_hack_DEPENDENCIES)
    410428        @rm -f .dummy_hack$(EXEEXT)
    411         $(AM_V_CCLD)$(LINK) $(_dummy_hack_OBJECTS) $(_dummy_hack_LDADD) $(LIBS)
     429        $(AM_V_CXXLD)$(CXXLINK) $(_dummy_hack_OBJECTS) $(_dummy_hack_LDADD) $(LIBS)
    412430avltree/$(am__dirstamp):
    413431        @$(MKDIR_P) avltree
     
    443461
    444462@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/.dummy_hack.Po@am__quote@
     463@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/.dummy_hackxx.Po@am__quote@
    445464
    446465.c.o:
     
    467486@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    468487@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
     488
     489.cpp.o:
     490@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
     491@am__fastdepCXX_TRUE@   $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     492@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
     493@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     494@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     495@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
     496
     497.cpp.obj:
     498@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
     499@am__fastdepCXX_TRUE@   $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
     500@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
     501@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     502@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     503@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     504
     505.cpp.lo:
     506@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
     507@am__fastdepCXX_TRUE@   $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     508@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
     509@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
     510@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     511@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
    469512
    470513mostlyclean-libtool:
     
    717760        @echo "int main() { return 0; }" > ${@}
    718761
     762.dummy_hackxx.cpp:
     763        @echo "int bar() { return 0; }" > ${@}
     764
    719765concurrency :
    720766        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
     
    726772        $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    727773
     774% : %.cpp
     775        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     776
    728777declarationSpecifier: declarationSpecifier.cfa $(CFACC)
    729778        $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
  • tests/pybin/tools.py

    r1bb2488 r2b10f95  
    3737        # otherwise create a pipe and run the desired command
    3838        else :
    39                 proc = subprocess.run(
    40                         cmd,
    41                         stdout=None if print2stdout else PIPE,
    42                         stderr=STDOUT,
    43                         shell=True,
    44                         timeout=settings.timeout.single if timeout else None
    45                 )
    46                 return proc.returncode, proc.stdout
     39                try:
     40                        proc = subprocess.run(
     41                                cmd,
     42                                stdout=None if print2stdout else PIPE,
     43                                stderr=STDOUT,
     44                                shell=True,
     45                                timeout=settings.timeout.single if timeout else None
     46                        )
     47                        return proc.returncode, proc.stdout.decode("utf-8") if proc.stdout else None
     48                except subprocess.TimeoutExpired:
     49                        return 124, str(None)
    4750
    4851def is_ascii(fname):
  • tests/test.py

    r1bb2488 r2b10f95  
    174174
    175175                ret, info = core_info(exe_file)
    176                 error = error + info
     176                error = error + info if error else info
    177177
    178178
     
    198198                out = sys.stdout
    199199                if error :
    200                         text = text + "\n" + error
     200                        text = text + '\n' + error
    201201                        out = sys.stderr
    202202
     
    288288                settings.update_make_cmd(forceJobs, options.jobs)
    289289
    290                 print('%s (%s:%s) on %i cores' % (
    291                         'Regenerate tests' if settings.generating else 'Running',
     290                print('%s %i tests on %i cores (%s:%s)' % (
     291                        'Regenerating' if settings.generating else 'Running',
     292                        len(tests),
     293                        options.jobs,
    292294                        settings.arch.string,
    293                         settings.debug.string,
    294                         options.jobs
     295                        settings.debug.string
    295296                ))
    296297
Note: See TracChangeset for help on using the changeset viewer.