File: test_utils.hpp

package info (click to toggle)
nmodl 0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,016 kB
  • sloc: cpp: 28,492; javascript: 9,841; yacc: 2,804; python: 1,971; lex: 1,674; xml: 181; sh: 136; ansic: 37; makefile: 17; pascal: 7
file content (30 lines) | stat: -rw-r--r-- 792 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*************************************************************************
 * Copyright (C) 2018-2022 Blue Brain Project
 *
 * This file is part of NMODL distributed under the terms of the GNU
 * Lesser General Public License. See top-level LICENSE file for details.
 *************************************************************************/

#pragma once

#include <filesystem>
#include <string>

namespace nmodl {
namespace test_utils {

std::string reindent_text(const std::string& text);

/**
 * \brief Create an empty file which is then removed when the C++ object is destructed
 */
struct TempFile {
    TempFile(std::filesystem::path path, const std::string& content);
    ~TempFile();

  private:
    std::filesystem::path path_;
};

}  // namespace test_utils
}  // namespace nmodl