diff --git a/tests/mpi_test_main.cpp b/tests/mpi_test_main.cpp index 4c94634173799a17519b5d417bfc914a99e2e740..3f195f2ec81f455f46604d2e30cf5a3ab81bceaa 100644 --- a/tests/mpi_test_main.cpp +++ b/tests/mpi_test_main.cpp @@ -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 diff --git a/tests/test_BinaryExpressionProcessor_raw.cpp b/tests/test_BinaryExpressionProcessor_raw.cpp index c115c67ca070c0610e5225c022fc527e4cff8a1a..22e32de89c715a5fa8e24a38007e0ab792e9dd19 100644 --- a/tests/test_BinaryExpressionProcessor_raw.cpp +++ b/tests/test_BinaryExpressionProcessor_raw.cpp @@ -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(); diff --git a/tests/test_BinaryExpressionProcessor_shift.cpp b/tests/test_BinaryExpressionProcessor_shift.cpp index 082d5fc5e829e11ac14e700e226f07278fca13c8..2f89f1f61c45ddcc137434d28f3196201c1ce866 100644 --- a/tests/test_BinaryExpressionProcessor_shift.cpp +++ b/tests/test_BinaryExpressionProcessor_shift.cpp @@ -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(); diff --git a/tests/test_OFStream.cpp b/tests/test_OFStream.cpp index 5ca9c38fd4b8f01f6ed28a263d9199905481edf5..edcee297572862e12d62a8a5032757ea84b364e2 100644 --- a/tests/test_OFStream.cpp +++ b/tests/test_OFStream.cpp @@ -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