Skip to content
Snippets Groups Projects
Commit 798ba31b authored by Frederik Hennig's avatar Frederik Hennig
Browse files

add test for nested namespaces

parent 45febbc7
Branches
Tags
1 merge request!17Improved Source File and Code Structure Modelling
Pipeline #73821 passed
......@@ -48,6 +48,10 @@ Conditionals:
- regex: if\s*\(\s*noodle\s==\sNoodles::RIGATONI\s\|\|\snoodle\s==\sNoodles::SPAGHETTI\s*\)
count: 1
NestedNamespaces:
sfg-args:
output-mode: header-only
# Kernel Generation
ScaleKernel:
......
#include "NestedNamespaces.hpp"
static_assert( outer::X == 13 );
static_assert( outer::inner::Y == 52 );
static_assert( outer::Z == 41 );
static_assert( outer::second_inner::W == 91 );
static_assert( outer::inner::innermost::V == 29 );
static_assert( GLOBAL == 42 );
int main() {
return 0;
}
from pystencilssfg import SourceFileGenerator
with SourceFileGenerator() as sfg:
with sfg.namespace("outer"):
sfg.code("constexpr int X = 13;")
with sfg.namespace("inner"):
sfg.code("constexpr int Y = 52;")
sfg.code("constexpr int Z = 41;")
with sfg.namespace("outer::second_inner"):
sfg.code("constexpr int W = 91;")
with sfg.namespace("outer::inner::innermost"):
sfg.code("constexpr int V = 29;")
sfg.code("constexpr int GLOBAL = 42;")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment