aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/macros_with_error.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-03-15 19:59:12 +0300
committeralexv-smirnov <alex@ydb.tech>2023-03-15 19:59:12 +0300
commit056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11 (patch)
tree4740980126f32e3af7937ba0ca5f83e59baa4ab0 /build/plugins/macros_with_error.py
parent269126dcced1cc8b53eb4398b4a33e5142f10290 (diff)
downloadydb-056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11.tar.gz
add library/cpp/actors, ymake build to ydb oss export
Diffstat (limited to 'build/plugins/macros_with_error.py')
-rw-r--r--build/plugins/macros_with_error.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/build/plugins/macros_with_error.py b/build/plugins/macros_with_error.py
new file mode 100644
index 0000000000..e82fb56d2c
--- /dev/null
+++ b/build/plugins/macros_with_error.py
@@ -0,0 +1,29 @@
+import sys
+
+import _common
+
+import ymake
+
+
+def onmacros_with_error(unit, *args):
+ print >> sys.stderr, 'This macros will fail'
+ raise Exception('Expected fail in MACROS_WITH_ERROR')
+
+
+def onrestrict_path(unit, *args):
+ if args:
+ if 'MSG' in args:
+ pos = args.index('MSG')
+ paths, msg = args[:pos], args[pos + 1:]
+ msg = ' '.join(msg)
+ else:
+ paths, msg = args, 'forbidden'
+ if not _common.strip_roots(unit.path()).startswith(paths):
+ error_msg = "Path '[[imp]]{}[[rst]]' is restricted - [[bad]]{}[[rst]]. Valid path prefixes are: [[unimp]]{}[[rst]]".format(unit.path(), msg, ', '.join(paths))
+ ymake.report_configure_error(error_msg)
+
+def onassert(unit, *args):
+ val = unit.get(args[0])
+ if val and val.lower() == "no":
+ msg = ' '.join(args[1:])
+ ymake.report_configure_error(msg)