Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: init
run: choco install ninja
- name: configure
run: cmake -S . --preset=ninja-clang -B clang
- name: build debug
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/building.md → lib/docs/build.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Building
## Build

### Requirements

Expand Down
26 changes: 22 additions & 4 deletions tests/test_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@
namespace {
namespace fs = std::filesystem;

auto get_paths() {
auto locate_jsons_dir() -> fs::path {
auto err = std::error_code{};
for (auto dir = fs::current_path(); !dir.empty() && dir.has_parent_path(); dir = dir.parent_path()) {
auto const ret = dir / "tests/jsons";
if (fs::is_directory(ret, err)) { return ret; }
}
return {};
}

auto get_paths(fs::path const& dir) -> std::vector<fs::path> {
auto ret = std::vector<fs::path>{};
auto err = std::error_code{};
for (auto const& it : fs::directory_iterator{"tests/jsons", err}) {
for (auto const& it : fs::directory_iterator{dir, err}) {
if (!it.is_regular_file(err)) { continue; }
auto const& path = it.path();
if (path.extension().generic_string() != ".json") { continue; }
Expand All @@ -20,8 +29,17 @@ auto get_paths() {
}

TEST(test_files) {
auto const paths = get_paths();
EXPECT(!paths.empty());
auto const jsons_dir = locate_jsons_dir();
if (jsons_dir.empty()) {
std::println("skipping test: could not locate 'tests/jsons' directory");
return;
}

auto const paths = get_paths(jsons_dir);
if (paths.empty()) {
std::println("skipping test: no JSON files found in '{}'", jsons_dir.generic_string());
return;
}

for (auto const& path : paths) {
std::println("-- {}", path.filename().generic_string());
Expand Down
2 changes: 1 addition & 1 deletion version.cmake
Original file line number Diff line number Diff line change
@@ -1 +1 @@
set(djson_version "3.1.1")
set(djson_version "3.1.2")
Loading