Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit-test for UpwardFileSearch(). #783

Merged
merged 10 commits into from
Apr 22, 2021
Merged

Add unit-test for UpwardFileSearch(). #783

merged 10 commits into from
Apr 22, 2021

Commits on Apr 21, 2021

  1. Add unit-test for UpwardFileSearch().

    Precondition to change the implementation to use
    std::filesystem.
    
    Issues: #765 #307
    
    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    72c6fd1 View commit details
    Browse the repository at this point in the history
  2. fix formatting.

    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    84a80be View commit details
    Browse the repository at this point in the history
  3. Embrace blocks to make clang-format not create unpleasent output.

    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    ab8b976 View commit details
    Browse the repository at this point in the history
  4. Don't query length() if we can use empty().

    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    07f3cc7 View commit details
    Browse the repository at this point in the history
  5. Test multiple consecutive slashes in join-path.

    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    500f010 View commit details
    Browse the repository at this point in the history
  6. Output failing tests to stderr.

    We can't access the test logfiles on the CI machine, so it is
    important that it prints it out for us to see.
    
    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    c4bc303 View commit details
    Browse the repository at this point in the history
  7. Make sure we're operating in not a crowded toplevel namespace.

    Don't create test structure in toplevel testing::TempDir(), but
    create our test-specific path.
    
    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    7cc7cb7 View commit details
    Browse the repository at this point in the history
  8. Make testing of path independent of absolute paths setup.

    We can not assume that the full absolute path is the same
    for the UpwardFileSearch() as it does realpath(). We only
    know that 'our' part of the filesystem construction will
    match.
    
    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    57c9d7c View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2021

  1. Use absl::string_view not std::string_view.

    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 22, 2021
    Configuration menu
    Copy the full SHA
    25d655d View commit details
    Browse the repository at this point in the history
  2. Address review comments.

    Signed-off-by: Henner Zeller <h.zeller@acm.org>
    hzeller committed Apr 22, 2021
    Configuration menu
    Copy the full SHA
    71894e8 View commit details
    Browse the repository at this point in the history