summaryrefslogtreecommitdiffstats
path: root/test/parser/extract-config.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/parser/extract-config.awk')
-rw-r--r--test/parser/extract-config.awk21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/parser/extract-config.awk b/test/parser/extract-config.awk
new file mode 100644
index 0000000..e7a5b33
--- /dev/null
+++ b/test/parser/extract-config.awk
@@ -0,0 +1,21 @@
+BEGIN {
+ config=0
+}
+
+/^#if\s*0\s*\/\*\s*PARSER_EMBEDDED_CONFIG/ {
+ config=1
+ print "#include <stdlib.h>"
+ print "const char __embedded_config[] = "
+ next
+}
+!config {
+ next
+}
+/^#endif/ {
+ print ";"
+ print "const size_t __embedded_config_size = sizeof(__embedded_config);"
+ exit
+}
+{
+ print "\t\"" $0 "\\n\""
+}
OpenPOWER on IntegriCloud