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

openmc-dev / openmc / 13183419769

06 Feb 2025 04:31PM UTC coverage: 84.867% (+0.02%) from 84.851%
13183419769

Pull #3140

github

web-flow
Merge 0719c4ce7 into 6e0f156d3
Pull Request #3140: Add Versioning Support from `version.txt`

213 of 232 new or added lines in 18 files covered. (91.81%)

11 existing lines in 5 files now uncovered.

50142 of 59083 relevant lines covered (84.87%)

35246209.29 hits per line

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

95.65
/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)
304✔
8
{
9
  std::filesystem::path d(path);
304✔
10
  return std::filesystem::is_directory(d);
608✔
11
}
304✔
12

13
bool file_exists(const std::string& filename)
5,325,099✔
14
{
15
  std::filesystem::path p(filename);
5,325,099✔
16
  if (!std::filesystem::exists(p)) {
5,325,099✔
17
    return false;
34,904✔
18
  }
19
  if (std::filesystem::is_directory(p)) {
5,290,195✔
NEW
20
    return false;
×
21
  }
22
  return true;
5,290,195✔
23
}
5,325,099✔
24

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

31
std::string get_file_extension(const std::string& filename)
8,339✔
32
{
33
  std::filesystem::path p(filename);
8,339✔
34
  auto ext = p.extension();
8,339✔
35
  if (!ext.empty()) {
8,339✔
36
    // path::extension includes the period
37
    return ext.string().substr(1);
16,606✔
38
  }
39
  return "";
36✔
40
}
8,339✔
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