Changeset 14b253d


Ignore:
Timestamp:
Aug 15, 2018, 11:22:23 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
3de9135
Parents:
636e1b9 (diff), bdff89d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r636e1b9 r14b253d  
    128128                                        description: 'If true, jenkins also runs benchmarks',           \
    129129                                        name: 'pRunBenchmark',                                                          \
    130                                         defaultValue: true,                                                             \
     130                                        defaultValue: false,                                                            \
    131131                                ],                                                                                              \
    132132                                [$class: 'BooleanParameterDefinition',                                                  \
  • automake/cfa.m4

    r636e1b9 r14b253d  
    66                cfa_prefix=${prefix}
    77        fi
    8         cfa_prefix="$(readlink -f ${cfa_prefix})/"
     8        cfa_prefix="$(readlink -m ${cfa_prefix})/"
    99        AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.])
    1010        AC_SUBST(CFA_PREFIX, ${cfa_prefix})
    1111
    1212        if test "$includedir" = '${prefix}/include'; then
    13                 cfa_incdir="${cfa_prefix}/include/${cfa_name}"
     13                cfa_incdir="${cfa_prefix}include/${cfa_name}"
    1414        else
    1515                cfa_incdir=${includedir}
    1616        fi
    17         cfa_incdir="$(readlink -f ${cfa_incdir})/"
     17        cfa_incdir="$(readlink -m ${cfa_incdir})/"
    1818        AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
    1919        AC_SUBST(CFA_INCDIR, ${cfa_incdir})
    2020
    2121        if test "$bindir" = '${exec_prefix}/bin'; then
    22                 cfa_bindir="${cfa_prefix}/bin"
     22                cfa_bindir="${cfa_prefix}bin"
    2323        else
    2424                cfa_bindir=${bindir}
    2525        fi
    26         cfa_bindir="$(readlink -f ${cfa_bindir})/"
     26        cfa_bindir="$(readlink -m ${cfa_bindir})/"
    2727        AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
    2828        AC_SUBST(CFA_BINDIR, ${cfa_bindir})
     
    3030        if test "$libdir" = '${exec_prefix}/lib'; then
    3131                if test "${ARCHITECTURE}" != ""; then
    32                         cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
     32                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
    3333                else
    34                         cfa_libdir="${cfa_prefix}/lib/${cfa_name}/"
     34                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/"
    3535                fi
    3636        else
    3737                cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}"
    3838        fi
    39         cfa_libdir="$(readlink -f ${cfa_libdir})/"
     39        cfa_libdir="$(readlink -m ${cfa_libdir})/"
    4040        AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
    4141        AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
  • configure

    r636e1b9 r14b253d  
    32353235                cfa_prefix=${prefix}
    32363236        fi
    3237         cfa_prefix="$(readlink -f ${cfa_prefix})/"
     3237        cfa_prefix="$(readlink -m ${cfa_prefix})/"
    32383238
    32393239cat >>confdefs.h <<_ACEOF
     
    32453245
    32463246        if test "$includedir" = '${prefix}/include'; then
    3247                 cfa_incdir="${cfa_prefix}/include/${cfa_name}"
     3247                cfa_incdir="${cfa_prefix}include/${cfa_name}"
    32483248        else
    32493249                cfa_incdir=${includedir}
    32503250        fi
    3251         cfa_incdir="$(readlink -f ${cfa_incdir})/"
     3251        cfa_incdir="$(readlink -m ${cfa_incdir})/"
    32523252
    32533253cat >>confdefs.h <<_ACEOF
     
    32593259
    32603260        if test "$bindir" = '${exec_prefix}/bin'; then
    3261                 cfa_bindir="${cfa_prefix}/bin"
     3261                cfa_bindir="${cfa_prefix}bin"
    32623262        else
    32633263                cfa_bindir=${bindir}
    32643264        fi
    3265         cfa_bindir="$(readlink -f ${cfa_bindir})/"
     3265        cfa_bindir="$(readlink -m ${cfa_bindir})/"
    32663266
    32673267cat >>confdefs.h <<_ACEOF
     
    32743274        if test "$libdir" = '${exec_prefix}/lib'; then
    32753275                if test "${ARCHITECTURE}" != ""; then
    3276                         cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
     3276                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
    32773277                else
    3278                         cfa_libdir="${cfa_prefix}/lib/${cfa_name}/"
     3278                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/"
    32793279                fi
    32803280        else
    32813281                cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}"
    32823282        fi
    3283         cfa_libdir="$(readlink -f ${cfa_libdir})/"
     3283        cfa_libdir="$(readlink -m ${cfa_libdir})/"
    32843284
    32853285cat >>confdefs.h <<_ACEOF
     
    32943294# Create variables for commonly used targets
    32953295
    3296 TOP_SRCDIR="$(readlink -f $ac_confdir/)/"
    3297 TOP_BUILDDIR="$(readlink -f $ac_pwd/)/"
     3296TOP_SRCDIR="$(readlink -m $ac_confdir/)/"
     3297TOP_BUILDDIR="$(readlink -m $ac_pwd/)/"
    32983298
    32993299
  • configure.ac

    r636e1b9 r14b253d  
    8080# Create variables for commonly used targets
    8181
    82 TOP_SRCDIR="$(readlink -f $ac_confdir/)/"
    83 TOP_BUILDDIR="$(readlink -f $ac_pwd/)/"
     82TOP_SRCDIR="$(readlink -m $ac_confdir/)/"
     83TOP_BUILDDIR="$(readlink -m $ac_pwd/)/"
    8484
    8585AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$TOP_SRCDIR", [Top src directory])
  • libcfa/configure

    r636e1b9 r14b253d  
    25742574                cfa_prefix=${prefix}
    25752575        fi
    2576         cfa_prefix="$(readlink -f ${cfa_prefix})/"
     2576        cfa_prefix="$(readlink -m ${cfa_prefix})/"
    25772577
    25782578cat >>confdefs.h <<_ACEOF
     
    25842584
    25852585        if test "$includedir" = '${prefix}/include'; then
    2586                 cfa_incdir="${cfa_prefix}/include/${cfa_name}"
     2586                cfa_incdir="${cfa_prefix}include/${cfa_name}"
    25872587        else
    25882588                cfa_incdir=${includedir}
    25892589        fi
    2590         cfa_incdir="$(readlink -f ${cfa_incdir})/"
     2590        cfa_incdir="$(readlink -m ${cfa_incdir})/"
    25912591
    25922592cat >>confdefs.h <<_ACEOF
     
    25982598
    25992599        if test "$bindir" = '${exec_prefix}/bin'; then
    2600                 cfa_bindir="${cfa_prefix}/bin"
     2600                cfa_bindir="${cfa_prefix}bin"
    26012601        else
    26022602                cfa_bindir=${bindir}
    26032603        fi
    2604         cfa_bindir="$(readlink -f ${cfa_bindir})/"
     2604        cfa_bindir="$(readlink -m ${cfa_bindir})/"
    26052605
    26062606cat >>confdefs.h <<_ACEOF
     
    26132613        if test "$libdir" = '${exec_prefix}/lib'; then
    26142614                if test "${ARCHITECTURE}" != ""; then
    2615                         cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
     2615                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
    26162616                else
    2617                         cfa_libdir="${cfa_prefix}/lib/${cfa_name}/"
     2617                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/"
    26182618                fi
    26192619        else
    26202620                cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}"
    26212621        fi
    2622         cfa_libdir="$(readlink -f ${cfa_libdir})/"
     2622        cfa_libdir="$(readlink -m ${cfa_libdir})/"
    26232623
    26242624cat >>confdefs.h <<_ACEOF
  • tests/Makefile.am

    r636e1b9 r14b253d  
    2424concurrent=
    2525
    26 TEST_PY = python ${srcdir}/test.py
     26TEST_PY = python ${builddir}/test.py
    2727
    2828# applies to both programs
  • tests/Makefile.in

    r636e1b9 r14b253d  
    301301quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
    302302concurrent =
    303 TEST_PY = python ${srcdir}/test.py
     303TEST_PY = python ${builddir}/test.py
    304304
    305305# applies to both programs
  • tests/config.py.in

    r636e1b9 r14b253d  
    55"""
    66
    7 SRCDIR   = "@srcdir@"
    8 BUILDDIR = "@builddir@"
     7SRCDIR   = "@abs_srcdir@"
     8BUILDDIR = "@abs_builddir@"
    99HOSTARCH = "@host_cpu@"
  • tests/pybin/settings.py

    r636e1b9 r14b253d  
    66
    77try :
    8         sys.path.append(os.getcwd())
     8        testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0])))
     9        sys.path.append(testpath)
    910        import config
    1011
    1112        SRCDIR = os.path.abspath(config.SRCDIR)
    1213        BUILDDIR = os.path.abspath(config.BUILDDIR)
     14        os.chdir(testpath)
     15
    1316except:
    1417        print('ERROR: missing config.py, re-run configure script.', file=sys.stderr)
     
    8891                self.flags  = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree")
    8992
     93class Timeouts:
     94        def __init__(self, ts, tg):
     95                self.single = Timeouts.check(ts)
     96                self.total  = Timeouts.check(tg)
     97
     98        @classmethod
     99        def check(_, value):
     100                if value < 1:
     101                        print("Timeouts must be at least 1 second", file=sys.stderr)
     102                        sys.exit(1)
     103
     104                return value
     105
    90106def init( options ):
    91107        global arch
     
    95111        global debug
    96112        global install
     113        global timeout
    97114
    98115        dry_run    = options.dry_run
     
    102119        install    = Install(options.install)
    103120        arch       = Architecture(options.arch)
     121        timeout    = Timeouts(options.timeout, options.global_timeout)
    104122
    105123
     
    110128
    111129def validate():
    112         make_ret, _ = tools.make( ".validate", error_file = ".validate.err", redirects  = "2> /dev/null 1> /dev/null", )
     130        errf = os.path.join(BUILDDIR, ".validate.err")
     131        make_ret, _ = tools.make( ".validate", error_file = errf, redirects  = "2> /dev/null 1> /dev/null", )
    113132        if make_ret != 0:
    114                 with open (".validate.err", "r") as myfile:
     133                with open (errf, "r") as myfile:
    115134                        error=myfile.read()
    116135                print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr)
    117136                print("       verify returned : \n%s" % error, file=sys.stderr)
    118                 tools.rm("%s/.validate.err" % BUILDDIR)
     137                tools.rm(errf)
    119138                sys.exit(1)
    120139
    121         tools.rm("%s/.validate.err" % BUILDDIR)
     140        tools.rm(errf)
  • tests/pybin/tools.py

    r636e1b9 r14b253d  
    3636
    3737def is_ascii(fname):
     38        if settings.dry_run:
     39                print("is_ascii: %s" % fname)
     40                return True
     41
    3842        if not os.path.isfile(fname):
    3943                return False
     
    132136# helper function to replace patterns in a file
    133137def file_replace(fname, pat, s_after):
     138        if settings.dry_run:
     139                print("replacing '%s' with '%s' in %s" % (pat, s_after, fname))
     140                return
     141
    134142        file = fileinput.FileInput(fname, inplace=True, backup='.bak')
    135143        for line in file:
  • tests/test.py

    r636e1b9 r14b253d  
    8888        parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=yes_no, default='no')
    8989        parser.add_argument('--arch', help='Test for specific architecture', type=str, default='')
     90        parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=60)
     91        parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
    9092        parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
    9193        parser.add_argument('--list', help='List all test available', action='store_true')
     
    160162                if settings.dry_run or fileIsExecutable(exe_file) :
    161163                        # run test
    162                         retcode, _ = sh("timeout 60 %s > %s 2>&1" % (exe_file, out_file), input = in_file)
     164                        retcode, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe_file, out_file), input = in_file)
    163165                else :
    164166                        # simply cat the result into the output
     
    172174
    173175        if retcode == 0:
     176                fixoutput(out_file)
    174177                if settings.generating :
    175178                        # if we are ounly generating the output we still need to check that the test actually exists
     
    182185                else :
    183186                        # fetch return code and error from the diff command
    184                         fixoutput(out_file)
    185187                        retcode, error = diff(cmp_file, out_file)
    186188
     
    234236                        tests,
    235237                        chunksize = 1
    236                 ).get(7200)
     238                ).get(settings.timeout.total)
    237239        except KeyboardInterrupt:
    238240                pool.terminate()
     
    283285        # users may want to simply list the tests
    284286        if options.list_comp :
    285                 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected -j --jobs ", end='')
     287                print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --install --timeout --global-timeout -j --jobs ", end='')
    286288                print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
    287289
Note: See TracChangeset for help on using the changeset viewer.