• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmc-dev / openmc / 18750783817

23 Oct 2025 01:55PM UTC coverage: 81.273% (-0.6%) from 81.918%
18750783817

Pull #3339

github

web-flow
Merge 3dea40422 into c31032cf2
Pull Request #3339: Enable Scikit-Build-Core Support

16592 of 23295 branches covered (71.23%)

Branch coverage included in aggregate %.

34 of 34 new or added lines in 3 files covered. (100.0%)

588 existing lines in 7 files now uncovered.

53443 of 62878 relevant lines covered (84.99%)

43574323.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.43
/src/file_utils.cpp
1
#include "openmc/file_utils.h"
2

3
#include <filesystem>
4

5
namespace openmc {
6

7
bool dir_exists(const std::string& path)
272✔
8
{
9
  std::filesystem::path d(path);
272✔
10
  return std::filesystem::is_directory(d);
544✔
11
}
272✔
12

13
bool file_exists(const std::string& filename)
6,044,088✔
14
{
15
  std::filesystem::path p(filename);
6,044,088✔
16
  if (!std::filesystem::exists(p)) {
6,044,088✔
17
    return false;
38,978✔
18
  }
19
  if (std::filesystem::is_directory(p)) {
6,005,110!
20
    return false;
×
21
  }
22
  return true;
6,005,110✔
23
}
6,044,088✔
24

25
std::string dir_name(const std::string& filename)
25✔
26
{
27
  std::filesystem::path p(filename);
25!
28
  return (p.parent_path()).string();
75!
29
}
25✔
30

31
std::string get_file_extension(const std::string& filename)
9,279✔
32
{
33
  std::filesystem::path p(filename);
9,279✔
34
  auto ext = p.extension();
9,279✔
35
  if (!ext.empty()) {
9,279!
36
    // path::extension includes the period
37
    return ext.string().substr(1);
18,558✔
38
  }
UNCOV
39
  return "";
×
40
}
9,279✔
41

42
} // namespace openmc
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc