Changeset 28582b2


Ignore:
Timestamp:
Aug 6, 2018, 2:05:02 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
ff593a3
Parents:
37fe352
Message:

Better handling of missing configurations

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • driver/cfa.cc

    r37fe352 r28582b2  
    355355                libdir = string(CFA_LIBDIR) + arch + config;
    356356                if( !dirExists(libdir) ) {
    357                         cerr << argv[0] << " internal error, cannot find prelude directory." << endl;
    358                         cerr << "Was looking for " << libdir << endl;
     357                        cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
    359358                        libdir = string(CFA_LIBDIR) + arch + "nolib";
    360359                }
  • tests/Makefile.am

    r37fe352 r28582b2  
    3737CC = @CFACC@
    3838
    39 .PHONY : list
     39.PHONY: list .validate
     40.INTERMEDIATE: .validate .validate.c
    4041EXTRA_PROGRAMS = fstream_test avl_test # build but do not install
    4142
     
    5556list :
    5657        @+${TEST_PY} --list ${concurrent}
     58
     59.validate: .validate.c
     60        @$(COMPILE) .validate.c -fsyntax-only
     61
     62.validate.c:
     63        @echo "int main() { return 0; }" > ${@}
    5764
    5865concurrency :
  • tests/Makefile.in

    r37fe352 r28582b2  
    316316
    317317.SUFFIXES:
    318 .SUFFIXES: .c .o .obj
     318.SUFFIXES: .c .o .obj .validate
    319319$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
    320320        @for dep in $?; do \
     
    614614
    615615
    616 .PHONY : list
     616.PHONY: list .validate
     617.INTERMEDIATE: .validate .validate.c
    617618
    618619all-local :
     
    627628list :
    628629        @+${TEST_PY} --list ${concurrent}
     630
     631.validate: .validate.c
     632        @$(COMPILE) .validate.c -fsyntax-only
     633
     634.validate.c:
     635        @echo "int main() { return 0; }" > ${@}
    629636
    630637concurrency :
  • tests/pybin/settings.py

    r37fe352 r28582b2  
    33import os
    44import sys
     5import tools
    56
    67try :
     
    8586
    8687        make = "make" if not force else ("make -j%i" % jobs)
     88
     89def validate():
     90        make_ret, _ = tools.make( ".validate", error_file = ".validate.err", redirects  = "2> /dev/null 1> /dev/null", )
     91        if make_ret != 0:
     92                with open (".validate.err", "r") as myfile:
     93                        error=myfile.read()
     94                print('ERROR: Invalid configuration', file=sys.stderr)
     95                print("       verify returned : \n%s" % error, file=sys.stderr)
     96                tools.rm("%s/.validate.err" % BUILDDIR)
     97                sys.exit(1)
     98
     99        tools.rm("%s/.validate.err" % BUILDDIR)
  • tests/pybin/tools.py

    r37fe352 r28582b2  
    5252# Remove 1 or more files silently
    5353def rm( files ):
    54         try:
     54        if isinstance( files, basestring ):
     55                sh("rm -f %s > /dev/null 2>&1" % files )
     56        else:
    5557                for file in files:
    5658                        sh("rm -f %s > /dev/null 2>&1" % file )
    57         except TypeError:
    58                 sh("rm -f %s > /dev/null 2>&1" % files )
    5959
    6060# Create 1 or more directory
    6161def mkdir( files ):
    62         try:
     62        if isinstance( files, basestring ):
     63                sh("mkdir -p %s" % os.path.dirname(files) )
     64        else:
    6365                for file in files:
    6466                        sh("mkdir -p %s" % os.path.dirname(file) )
    65         except TypeError:
    66                 sh("mkdir -p %s" % os.path.dirname(files) )
     67
    6768
    6869def chdir( dest = __main__.__file__ ):
  • tests/test.py

    r37fe352 r28582b2  
    8585        # create a parser with the arguments for the tests script
    8686        parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    87         parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no')
     87        parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='yes')
    8888        parser.add_argument('--arch', help='Test for specific architecture', type=str, default='')
    8989        parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
     
    285285
    286286        else :
     287                # check the build configuration works
     288                settings.validate()
     289
    287290                options.jobs, forceJobs = jobCount( options, tests )
    288291                settings.updateMakeCmd(forceJobs, options.jobs)
Note: See TracChangeset for help on using the changeset viewer.