1. 24 Jan, 2017 2 commits
    • David Gibson's avatar
      coroutine: Remove problematic diagnostic from api-3 test · ace6131e
      David Gibson authored
      The api-3 testcase devotes most of its available stack space to a test
      buffer, leaving only a small amount (COROUTINE_MIN_STKSZ) for the actual
      stack usage of the coroutine.
      
      It turns out that the ccan/tap diag() function can - depending on compiler
      version and flags, and on whether diagnostics are enabled - exceed that
      limited stack space.  That leads to a stack overrun, and in turn corruption
      of the parent routine's stack, generating unpredictable and hard to debug
      SEGVs.
      
      At present, this bug seems to be tripped by clang-3.8 when diagnostic
      messages are printed.
      
      This removes the troublesome diag() call.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      ace6131e
    • Rusty Russell's avatar
      tal: make tal_len/tal_count(NULL) return 0. · 9b3f4ef6
      Rusty Russell authored
      Previously it crashed, but if you're always dealing with tal arrays,
      this is painful.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      9b3f4ef6
  2. 19 Jan, 2017 1 commit
  3. 18 Jan, 2017 3 commits
    • David Gibson's avatar
      ccanlint: Correct default coverage tool for clang · 319dadd4
      David Gibson authored
      Currently ccanlint defaults to using "gcov" as the coverage analysis tool
      for any compiler defining __GNUC__.  That's generally correct for the
      (system default) gcc.  However, clang also defines __GNUC__ because it
      implements the GCC langauge extensions.  For clang, "gcov" is not the
      correct coverage tool (clang does use roughly the gcov format, but unless
      you're very lucky the system gcc and system clang won't use the same gcov
      versions).
      
      This changes the default coverage tool in the case of clang to the correct
      "llvm-cov gcov".
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      319dadd4
    • David Gibson's avatar
      ccanlint: Allow path to gcov to be overriden · d1827b42
      David Gibson authored
      Currently ccanlint always assumes that the coverage tool can be
      invoked under the command "gcov".
      
      However, the coverage tool generally needs to be closely matched to
      the compiler version.  So, the current behaviour won't work with
      compilers other than gcc, like clang.  It won't even work for a gcc
      version which isn't the standard system one matching gcov.
      
      To address this, allow the command for the coverage tool to be
      overridden on the ccanlint command line with a new --gcov option.  We
      also allow it to be overridden for make check with a GCOV make
      variable.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      d1827b42
    • David Gibson's avatar
      tools: Consolidate gcov handling · bcb956d9
      David Gibson authored
      At the moment, invocation of the 'gcov' tool for coverage analysis
      from ccanlint is put directly into the tests_compile_coverage.c and
      tests_coverage.c files.  This makes it awkard to extend.
      
      So, this patch moves the invocation of gcov into a new tools/gcov.v
      file, analagous to tools/compile.c.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      bcb956d9
  4. 17 Jan, 2017 3 commits
    • David Gibson's avatar
      .travis.yml: Add valgrind testing · 0fd6bb10
      David Gibson authored
      Currently, our Travis builds don't have valgrind installed, meaning
      that ccanlint's valgrind based tests will be skipped, which is
      unfortunate.
      
      This adds valgrind to some of the builds to give us better CI
      coverage.  It's not added for Precise with gcc, because that causes
      failures which appear to be due to something in the builtins of that
      gcc version.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      0fd6bb10
    • David Gibson's avatar
      .travis.yml: Add builds under Ubuntu Trusty · 870b6316
      David Gibson authored
      At the moment our Travis builds all use Travis's default Ubuntu
      Precise base distro.  For wider testing, add a build using their
      Ubuntu Trusty distro.  Only build with gcc there, for now, since clang
      will cause ccanlint failures, due to the gcov version there not being
      suitable for clang output.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      870b6316
    • David Gibson's avatar
      .travis.yml: Rework Travis matrix · 813e9726
      David Gibson authored
      At the moment the .travis.yml implicitly constructs a build matrix
      with the two compiler options.  In future we want to add more build
      options for wider testing: different base distro, more compiler
      versions, etc.  However, a fair few of the possible combinations have
      various problems meaning we don't want to test them routinely.
      
      So, this reworks from implicitly constructing the matrix to using
      matrix: include: options to explicitly build the options we want.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      813e9726
  5. 13 Jan, 2017 1 commit
  6. 11 Jan, 2017 1 commit
  7. 09 Jan, 2017 5 commits
  8. 07 Jan, 2017 1 commit
  9. 29 Dec, 2016 5 commits
  10. 24 Dec, 2016 2 commits
    • David Gibson's avatar
      ccanlint: Move ccanlint test options from _info comments to code · 0fe2d094
      David Gibson authored
      Currently, _info files can specify options, or note expected failures, for
      ccanlint checks in the _info file with specially structured comments. That
      differs from most other things ccanlint gets from _info, where it instead
      executes the info file with certain parameters.
      
      This changes ccanlint and existing _info files to use the normal method for
      the ccanlint test options as well.  This also has the advantage that an
      info file can alter its test options based on things from config.h - in
      some cases whether a test can work or not might depend on various things.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      0fe2d094
    • David Gibson's avatar
      Makefile: Make module checks depend on info file · 25b7406d
      David Gibson authored
      Changing the _info file can change how ccanlint assesses the module.
      Therefore, if the _info file changes, we should re-run ccanlint module
      tests with make check.  We didn't previously have a dependency for that,
      though, so this adds it.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      25b7406d
  11. 23 Dec, 2016 1 commit
  12. 12 Dec, 2016 2 commits
  13. 09 Dec, 2016 1 commit
  14. 07 Dec, 2016 1 commit
  15. 05 Dec, 2016 2 commits
  16. 01 Dec, 2016 1 commit
    • David Gibson's avatar
      Makefile: Remove testdepends from make check dependencies · 2581e470
      David Gibson authored
      The new Makefile system, via the helper script in tools/gen_deps.sh, when
      generating the targets to test a module, inserts dependencies meaning it
      must first check modules this one depends on, whether via 'depends' or
      'testdepends' in _info.
      
      Although it seems logical, including 'testdepends' is actually incorrect.
      If ccan/a testepends on ccan/b then ccan/b must be *built* in order to test
      ccan/a, but it doesn't need to be tested.  testepends are explicitly
      permitted to contain loops - it's quite common for two complementary
      modules to be used to test each other.  This is one of the reasons
      testdepends exists separate from depends.
      
      So, remove testdepends from the generated check dependencies, removing the
      circular dependency that Make complains about.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      2581e470
  17. 30 Nov, 2016 3 commits
  18. 27 Nov, 2016 1 commit
    • Kevin Locke's avatar
      edit_distance: Rename ED_STACK_ELEMS ED_STACK_DIST_VALS · 346058c0
      Kevin Locke authored
      The previous name was misleading, since it does not define the number of
      elements (ed_elem) on the stack, but rather the number of distance
      values (ed_dist).  Rename to make this more clear and add more
      documentation about what it does and how best to define it.
      
      Note:  This is an API change for custom-compiled versions, but since the
      module has only been included for a couple days I don't think it's worth
      a back-compat #ifdef at this point.
      Signed-off-by: default avatarKevin Locke <kevin@kevinlocke.name>
      346058c0
  19. 23 Nov, 2016 2 commits
    • David Gibson's avatar
      .travis.yml: Enable C99 mode for older gcc versions · 18cbdae8
      David Gibson authored
      Currently Travis builds fail on the edit_distance module, because that
      module uses C99 extensions, which aren't enabled by default on the
      Ubuntu Precise compiler version.  Force it to allow these, by adding the
      -std=gnu99 option to the compiler.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      18cbdae8
    • Kevin Locke's avatar
      edit_distance: calculate edit distance between strings · e0663bef
      Kevin Locke authored
      This commit creates the edit_distance module for calculating various
      edit distance measures.  The edit distance quantifies the similarity
      between two strings based on the number of modifications necessary to
      turn one string into the other.  There are several edit distance
      measures which differ in the operations which are permitted and the
      cost (aka weight) of the operations.  This module provides functions
      for calculating the Longest Common Subsequence (LCS), Levenshtein, and
      Damerau-Levenshtein (restricted and unrestricted) distances.  Weighted
      versions of these functions can be created by defining cost functions
      as preprocessor macros when compiling this module.  Distances over
      other array types (e.g. wide strings, integers, structs) can be
      accomplished by defining the element type and equality test macros.
      Signed-off-by: default avatarKevin Locke <kevin@kevinlocke.name>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      e0663bef
  20. 22 Nov, 2016 2 commits