Skip to content

Replace file_util.{h,cpp} by std::filesystem #8033

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

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

tautschnig
Copy link
Collaborator

With C++ 17 we can use the STL-provided implementation instead of rolling our own (platform-dependent) code.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (bf6d759) 79.09% compared to head (5664950) 79.08%.

Files Patch % Lines
src/goto-cc/compile.cpp 62.50% 6 Missing ⚠️
src/util/source_location.cpp 50.00% 3 Missing ⚠️
src/goto-cc/as_mode.cpp 0.00% 2 Missing ⚠️
src/goto-cc/ld_mode.cpp 0.00% 2 Missing ⚠️
src/goto-cc/ms_cl_mode.cpp 0.00% 2 Missing ⚠️
src/goto-instrument/count_eloc.cpp 0.00% 2 Missing ⚠️
src/goto-cc/gcc_mode.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8033      +/-   ##
===========================================
- Coverage    79.09%   79.08%   -0.01%     
===========================================
  Files         1699     1697       -2     
  Lines       196512   196437      -75     
===========================================
- Hits        155428   155362      -66     
+ Misses       41084    41075       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -303,9 +303,9 @@ int as_modet::as_hybrid_binary(const compilet &compiler)
std::string saved = output_file + ".goto-cc-saved";
try
{
file_rename(output_file, saved);
std::filesystem::rename(output_file, saved);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any tests for this (even manual)? The codecov warning is a bit concerning when refactoring bits like that, which follow some diverging codepaths like exceptions being triggered, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only time this is genuinely put to a test at the moment is the "Build Xen with CPROVER tools" CI job. We don't have regression tests for goto-as (as_modet) at this time.

@tautschnig tautschnig self-assigned this Nov 14, 2023
@tautschnig tautschnig removed their assignment Nov 16, 2023
With C++ 17 we can use the STL-provided implementation instead of
rolling our own (platform-dependent) code.
@tautschnig tautschnig merged commit d28ad2a into diffblue:develop Dec 15, 2023
@tautschnig tautschnig deleted the cleanup/filesystem branch December 15, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants