This repository has been archived on 2020-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
FediPotato/tests/main.cpp

40 lines
1.1 KiB
C++

/* This file is part of FediPotato.
* Copyright © 2020 tastytea <tastytea@tastytea.de>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#define CATCH_CONFIG_MAIN
#include "environment_variables.hpp"
#include <catch.hpp>
#include <cstdlib>
#if __has_include(<filesystem>)
# include <filesystem>
#else
# include <experimental/filesystem>
#endif
namespace FediPotato
{
namespace fs = std::filesystem;
void set_environment_variables()
{
setenv("XDG_CONFIG_HOME", fs::temp_directory_path().c_str(), 1);
}
} // namespace FediPotato