2022-07-31 08:22:22 +03:00
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++ (supporting code)
2022-08-12 16:04:06 +03:00
// | | |__ | | | | | | version 3.11.2
2022-07-31 08:22:22 +03:00
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
2022-07-20 13:41:33 +03:00
# pragma once
# include <cstdio> // fopen, fclose, FILE
# include <memory> // unique_ptr
# include <test_data.hpp>
# include <doctest.h>
namespace utils
{
inline bool check_testsuite_downloaded ( )
{
2022-09-13 13:58:26 +03:00
const std : : unique_ptr < std : : FILE , decltype ( & std : : fclose ) > file ( std : : fopen ( TEST_DATA_DIRECTORY " /README.md " , " r " ) , & std : : fclose ) ;
2022-07-20 13:41:33 +03:00
return file ! = nullptr ;
}
TEST_CASE ( " check test suite is downloaded " )
{
REQUIRE_MESSAGE ( utils : : check_testsuite_downloaded ( ) , " Test data not found in ' " TEST_DATA_DIRECTORY " '. Please execute target 'download_test_data' before running this test suite. See <https://github.com/nlohmann/json#execute-unit-tests> for more information. " ) ;
}
} // namespace utils