Skip to content
Snippets Groups Projects
Commit 0ca05387 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Change location of generated files to PUGS_BINARY_DIR/tests/

The use of the temp dir (/tmp) could be problematic when running
several test bases at same time (different builds).
parent 7faa13c7
No related branches found
No related tags found
1 merge request!124Add files for high order integration with quadratures
......@@ -27,7 +27,7 @@ main(int argc, char* argv[])
const std::string output_base_name{"mpi_test_rank_"};
std::filesystem::path parallel_output(std::string{PUGS_BINARY_DIR});
std::filesystem::path parallel_output = std::filesystem::path{PUGS_BINARY_DIR}.append("tests");
std::filesystem::path gcov_prefix = [&]() -> std::filesystem::path {
std::string template_temp_dir = std::filesystem::temp_directory_path() / "pugs_gcov_XXXXXX";
......@@ -71,7 +71,7 @@ main(int argc, char* argv[])
<< rang::style::reset << '\n';
for (size_t i_rank = 1; i_rank < parallel::size(); ++i_rank) {
std::filesystem::path parallel_output(std::string{PUGS_BINARY_DIR});
std::filesystem::path parallel_output = std::filesystem::path{PUGS_BINARY_DIR}.append("tests");
parallel_output /= output_base_name + std::to_string(i_rank);
session.config().stream() << " - " << rang::fg::green << parallel_output.parent_path().string()
<< parallel_output.preferred_separator << rang::style::reset << rang::fgB::green
......
......@@ -3,6 +3,7 @@
#include <language/node_processor/BinaryExpressionProcessor.hpp>
#include <language/utils/OFStream.hpp>
#include <utils/pugs_config.hpp>
// clazy:excludeall=non-pod-global-static
......@@ -51,8 +52,8 @@ TEST_CASE("BinaryExpressionProcessor raw operators", "[language]")
REQUIRE(BinOp<language::divide_op>{}.eval(2.9, 3) == (2.9 / 3));
{
std::filesystem::path path = std::filesystem::temp_directory_path();
path.append(std::string{"binary_expression_processor_shift_left_"} + std::to_string(getpid()));
std::filesystem::path path{PUGS_BINARY_DIR};
path.append("tests").append(std::string{"binary_expression_processor_shift_left_"} + std::to_string(getpid()));
std::string filename = path.string();
......
......@@ -2,6 +2,7 @@
#include <catch2/matchers/catch_matchers_all.hpp>
#include <test_BinaryExpressionProcessor_utils.hpp>
#include <utils/pugs_config.hpp>
#include <fstream>
#include <unistd.h>
......@@ -12,9 +13,8 @@ TEST_CASE("BinaryExpressionProcessor shift", "[language]")
{
SECTION("<<")
{
std::filesystem::path path = std::filesystem::temp_directory_path();
path.append(std::string{"binary_expression_processor_"} + std::to_string(getpid()));
std::filesystem::path path{PUGS_BINARY_DIR};
path.append("tests").append(std::string{"binary_expression_processor_"} + std::to_string(getpid()));
std::string filename = path.string();
......
......@@ -12,7 +12,7 @@ TEST_CASE("OFStream", "[language]")
{
SECTION("ofstream")
{
const std::string basename = std::filesystem::temp_directory_path().append("ofstream_");
const std::string basename = std::filesystem::path{PUGS_BINARY_DIR}.append("tests").append("ofstream_");
const std::string filename = basename + std::to_string(parallel::rank());
// Ensures that the file is closed after this line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment