File: nmodl_constructs.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 (63 lines) | stat: -rw-r--r-- 1,594 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*************************************************************************
 * 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 <map>
#include <string>
#include <vector>

namespace nmodl {
namespace test_utils {

/// represent nmodl test construct
struct NmodlTestCase {
    /// name of the test
    std::string name;

    /// input nmodl construct
    std::string input;

    /// expected nmodl output
    std::string output;

    /// \todo : add associated json (to use in visitor test)

    NmodlTestCase() = delete;

    NmodlTestCase(std::string name, std::string input)
        : name(name)
        , input(input)
        , output(input) {}

    NmodlTestCase(std::string name, std::string input, std::string output)
        : name(name)
        , input(input)
        , output(output) {}
};

/// represent differential equation test construct
struct DiffEqTestCase {
    /// name of the mod file
    std::string name;

    /// differential equation to solve
    std::string equation;

    /// expected solution
    std::string solution;

    /// solve method
    std::string method;
};

extern std::map<std::string, NmodlTestCase> const nmodl_invalid_constructs;
extern std::map<std::string, NmodlTestCase> const nmodl_valid_constructs;
extern std::vector<DiffEqTestCase> const diff_eq_constructs;

}  // namespace test_utils
}  // namespace nmodl