Changeset a5121bf


Ignore:
Timestamp:
Aug 7, 2018, 3:23:34 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
575a6e5
Parents:
524ed86
Message:

Tests can now be run from installed binaries or tree binaries

Files:
14 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r524ed86 ra5121bf  
    3636debug=yes
    3737check:
    38         $(MAKE) -C tests all-tests install=no debug=${debug}
     38        $(MAKE) -C tests all-tests installed=no debug=${debug}
    3939
    4040installcheck:
    41         $(MAKE) -C tests all-tests install=yes debug=${debug}
     41        $(MAKE) -C tests all-tests installed=yes debug=${debug}
  • Makefile.in

    r524ed86 ra5121bf  
    900900        @cd $(dir $@) && $(abs_top_srcdir)/libcfa/configure $(config_data)
    901901check:
    902         $(MAKE) -C tests all-tests install=no debug=${debug}
     902        $(MAKE) -C tests all-tests installed=no debug=${debug}
    903903
    904904installcheck:
    905         $(MAKE) -C tests all-tests install=yes debug=${debug}
     905        $(MAKE) -C tests all-tests installed=yes debug=${debug}
    906906
    907907# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • automake/cfa.m4

    r524ed86 ra5121bf  
    2626
    2727        if test "$libdir" = '${exec_prefix}/lib'; then
    28                 cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}${CONFIGURATION}"
     28                if test "${ARCHITECTURE}" != ""; then
     29                        cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
     30                else
     31                        cfa_libdir="${cfa_prefix}/lib/${cfa_name}/"
     32                fi
    2933        else
    3034                cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}"
  • configure

    r524ed86 ra5121bf  
    32663266
    32673267        if test "$libdir" = '${exec_prefix}/lib'; then
    3268                 cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}${CONFIGURATION}"
     3268                if test "${ARCHITECTURE}" != ""; then
     3269                        cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
     3270                else
     3271                        cfa_libdir="${cfa_prefix}/lib/${cfa_name}/"
     3272                fi
    32693273        else
    32703274                cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}"
     
    34503454
    34513455        lib_arch=${cannon_arch_name}
    3452         lib_dir="libcfa-${lib_arch}-${lib_config}"
     3456        lib_dir="libcfa/${lib_arch}-${lib_config}"
    34533457
    34543458        LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}"
    34553459        LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile"
    34563460
    3457         mkdir -p libcfa-${lib_arch}-${lib_config}
    3458         echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data
    3459         echo -n "${LIBCFA_PATHS} " >> libcfa-${lib_arch}-${lib_config}/config.data
    3460         echo -n "ARCHITECTURE=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data
    3461         echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data
     3461        mkdir -p ${lib_dir}
     3462        echo -n "${LIBCFA_GENERAL_ARGS} " > ${lib_dir}/config.data
     3463        echo -n "${LIBCFA_PATHS} " >> ${lib_dir}/config.data
     3464        echo -n "ARCHITECTURE=${lib_arch} " >> ${lib_dir}/config.data
     3465        echo -n "CONFIGURATION=${lib_config}" >> ${lib_dir}/config.data
    34623466done
    34633467
  • configure.ac

    r524ed86 ra5121bf  
    145145        M4CFA_CANNON_CPU([${arch_name}])
    146146        lib_arch=${cannon_arch_name}
    147         lib_dir="libcfa-${lib_arch}-${lib_config}"
     147        lib_dir="libcfa/${lib_arch}-${lib_config}"
    148148
    149149        LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}"
    150150        LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile"
    151151
    152         mkdir -p libcfa-${lib_arch}-${lib_config}
    153         echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data
    154         echo -n "${LIBCFA_PATHS} " >> libcfa-${lib_arch}-${lib_config}/config.data
    155         echo -n "ARCHITECTURE=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data
    156         echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data
     152        mkdir -p ${lib_dir}
     153        echo -n "${LIBCFA_GENERAL_ARGS} " > ${lib_dir}/config.data
     154        echo -n "${LIBCFA_PATHS} " >> ${lib_dir}/config.data
     155        echo -n "ARCHITECTURE=${lib_arch} " >> ${lib_dir}/config.data
     156        echo -n "CONFIGURATION=${lib_config}" >> ${lib_dir}/config.data
    157157done
    158158
  • driver/cfa.cc

    r524ed86 ra5121bf  
    8686        string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) );
    8787
    88         string installincdir( CFA_INCDIR );                                     // fixed location of include files
    89         string installlibdir( CFA_LIBDIR );                                     // fixed location of cc1 and cfa-cpp commands
     88        string installincdir( CFA_INCDIR );                         // fixed location of include files
     89        string installlibdir( CFA_LIBDIR );                         // fixed location of cc1 and cfa-cpp commands when installed
     90        string srcdriverdir ( TOP_BUILDDIR "driver");                // fixed location of cc1 and cfa-cpp commands when in tree
    9091
    9192        string heading;                                                                         // banner printed at start of cfa compilation
     
    171172                                noincstd_flag = true;                                   // strip the no-include-stdhdr flag
    172173                        } else if ( arg == "-in-tree" ) {
    173                                 noincstd_flag = true;
    174174                                intree = true;
    175175                        } else if ( arg == "-compiler" ) {
     
    338338
    339339        // add the CFA include-library paths, which allow direct access to header files without directory qualification
    340         args[nargs] = "-I" CFA_INCDIR;
    341         nargs += 1;
    342         if ( ! noincstd_flag ) {                                                        // do not use during build
    343                 args[nargs] = "-I" CFA_INCDIR "/stdhdr";
    344                 nargs += 1;
    345         } // if
    346         args[nargs] = "-I" CFA_INCDIR "/concurrency";
    347         nargs += 1;
    348         args[nargs] = "-I" CFA_INCDIR "/containers";
    349         nargs += 1;
    350 
    351         string libdir;
    352340        if( !intree ) {
    353                 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU);
    354                 const char * config = debug ? "debug": "nodebug";
    355                 libdir = string(CFA_LIBDIR) + arch + config;
    356                 if( !dirExists(libdir) ) {
    357                         cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
    358                         libdir = string(CFA_LIBDIR) + arch + "nolib";
    359                 }
    360 
    361                 if( !dirExists(libdir) ) {
    362                         cerr << argv[0] << " internal error, cannot find prelude directory." << endl;
    363                         cerr << "Was looking for " << libdir << endl;
    364                         exit( EXIT_FAILURE );
    365                 }
    366 
    367                 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir) ).c_str();
     341                args[nargs] = "-I" CFA_INCDIR;
     342                nargs += 1;
     343                if ( ! noincstd_flag ) {                                                        // do not use during build
     344                        args[nargs] = "-I" CFA_INCDIR "/stdhdr";
     345                        nargs += 1;
     346                } // if
     347                args[nargs] = "-I" CFA_INCDIR "/concurrency";
     348                nargs += 1;
     349                args[nargs] = "-I" CFA_INCDIR "/containers";
    368350                nargs += 1;
    369351        } else {
     352                args[nargs] = "-I" TOP_SRCDIR "libcfa/src";
     353                nargs += 1;
     354                if ( ! noincstd_flag ) {                                                        // do not use during build
     355                        args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr";
     356                        nargs += 1;
     357                } // if
     358                args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/concurrency";
     359                nargs += 1;
     360                args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/containers";
     361                nargs += 1;
     362        }
     363
     364        string libbase;
     365        if( !intree ) {
     366                libbase = CFA_LIBDIR;
     367        } else {
     368                libbase = TOP_BUILDDIR "libcfa/";
    370369                args[nargs] = "-D__CFA_FLAG__=-t";
    371370                nargs += 1;
    372371        }
     372
     373        const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU);
     374        const char * config = debug ? "debug": "nodebug";
     375        string libdir = libbase + arch + "-" + config;
     376        if( !dirExists(libdir) ) {
     377                cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
     378                cerr << "Was looking for " << libdir << endl;
     379                libdir = libbase + arch + "-" + "nolib";
     380        }
     381
     382        if( !dirExists(libdir) ) {
     383                cerr << argv[0] << " internal error, cannot find prelude directory." << endl;
     384                cerr << "Was looking for " << libdir << endl;
     385                exit( EXIT_FAILURE );
     386        }
     387
     388        args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str();
     389        nargs += 1;
    373390
    374391        if ( link ) {
     
    387404
    388405                // include the cfa library in case it's needed
    389                 if( !intree ) {
    390                         args[nargs] = ( *new string( string("-L" ) + libdir) ).c_str();
    391                         nargs += 1;
    392                 }
     406                args[nargs] = ( *new string( string("-L" ) + libdir + (intree ? "/src" : "")) ).c_str();
     407                nargs += 1;
    393408                args[nargs] = "-lcfa";
    394409                nargs += 1;
     
    445460
    446461        if ( Bprefix.length() == 0 ) {
    447                 Bprefix = installlibdir;
     462                Bprefix = !intree ? installlibdir : srcdriverdir;
    448463                args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
    449464                nargs += 1;
  • libcfa/configure

    r524ed86 ra5121bf  
    25842584
    25852585        if test "$libdir" = '${exec_prefix}/lib'; then
    2586                 cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}${CONFIGURATION}"
     2586                if test "${ARCHITECTURE}" != ""; then
     2587                        cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
     2588                else
     2589                        cfa_libdir="${cfa_prefix}/lib/${cfa_name}/"
     2590                fi
    25872591        else
    25882592                cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}"
  • libcfa/src/Makefile.am

    r524ed86 ra5121bf  
    2828# use -no-include-stdhdr to prevent rebuild cycles
    2929# The built sources must not depend on the installed headers
    30 AM_CFAFLAGS = -quiet -in-tree -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr
     30AM_CFAFLAGS = -quiet -in-tree -imacros prelude.c -I$(srcdir)/stdhdr
    3131AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@
    3232AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@
  • libcfa/src/Makefile.in

    r524ed86 ra5121bf  
    339339# use -no-include-stdhdr to prevent rebuild cycles
    340340# The built sources must not depend on the installed headers
    341 AM_CFAFLAGS = -quiet -in-tree -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr
     341AM_CFAFLAGS = -quiet -in-tree -imacros prelude.c -I$(srcdir)/stdhdr
    342342AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@
    343343AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@
  • tests/Makefile.am

    r524ed86 ra5121bf  
    3131        -Wno-unused-function \
    3232        -quiet @CFA_FLAGS@ \
    33         -DIN_DIR="${srcdir}/.in/" \
    34         @BUILD_IN_TREE_FLAGS@
     33        -DIN_DIR="${srcdir}/.in/"
    3534
    36 AM_CFLAGS += ${DEBUG_FLAGS}
     35AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS}
    3736
    3837CC = @CFACC@
     
    4847#----------------------------------------------------------------------------------------------------------------
    4948all-local :
    50         @+${TEST_PY} --debug=${debug} ${concurrent} ${quick_test}
     49        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${quick_test}
    5150
    5251all-tests :
    53         @+${TEST_PY} --all --debug=${debug} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     52        @+${TEST_PY} --all --debug=${debug}  --install=${installed} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    5453
    5554clean-local :
     
    6665
    6766concurrency :
    68         @+${TEST_PY} --debug=${debug} -Iconcurrent
     67        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
    6968
    7069#----------------------------------------------------------------------------------------------------------------
  • tests/Makefile.in

    r524ed86 ra5121bf  
    303303# applies to both programs
    304304AM_CFLAGS = $(if $(test), 2> $(test), ) -g -Wall -Wno-unused-function \
    305         -quiet @CFA_FLAGS@ -DIN_DIR="${srcdir}/.in/" \
    306         @BUILD_IN_TREE_FLAGS@ ${DEBUG_FLAGS}
     305        -quiet @CFA_FLAGS@ -DIN_DIR="${srcdir}/.in/" ${DEBUG_FLAGS} \
     306        ${INSTALL_FLAGS}
    307307fstream_test_SOURCES = fstream_test.c
    308308avl_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
     
    613613#----------------------------------------------------------------------------------------------------------------
    614614all-local :
    615         @+${TEST_PY} --debug=${debug} ${concurrent} ${quick_test}
     615        @+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${quick_test}
    616616
    617617all-tests :
    618         @+${TEST_PY} --all --debug=${debug} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     618        @+${TEST_PY} --all --debug=${debug}  --install=${installed} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    619619
    620620clean-local :
     
    631631
    632632concurrency :
    633         @+${TEST_PY} --debug=${debug} -Iconcurrent
     633        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
    634634
    635635#----------------------------------------------------------------------------------------------------------------
  • tests/pybin/settings.py

    r524ed86 ra5121bf  
    6767                self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug" if value else "-nodebug")
    6868
     69class Install:
     70        def __init__(self, value):
     71                self.string = "installed" if value else "in-tree"
     72                self.flags  = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree")
     73
    6974def init( options ):
    7075        global arch
     
    7378        global make
    7479        global debug
    75         global debugFlag
     80        global install
    7681
    7782        dry_run    = options.dry_run
     
    7984        make       = 'make'
    8085        debug        = Debug(options.debug)
     86        install    = Install(options.install)
    8187        arch       = Architecture(options.arch)
    8288
  • tests/pybin/tools.py

    r524ed86 ra5121bf  
    102102                test_param,
    103103                settings.debug.flags,
     104                settings.install.flags,
    104105                flags,
    105106                target,
  • tests/test.py

    r524ed86 ra5121bf  
    8686        parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    8787        parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='yes')
     88        parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=yes_no, default='no')
    8889        parser.add_argument('--arch', help='Test for specific architecture', type=str, default='')
    8990        parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
Note: See TracChangeset for help on using the changeset viewer.