summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniel Friesel <dfriesel@uos.de>2022-05-20 10:13:50 +0000
committerDaniel Friesel <dfriesel@uos.de>2022-05-20 10:13:50 +0000
commit4eb9358714cc5553c886021931752ec2b95055f4 (patch)
tree54ca7cb2b8748139fa534dcbdf40f7397ac72e7a /examples
parent0daafbe96c1057fe7fd9cc64f3e74fb914c1eeb4 (diff)
Add a test benchmark for explore-kconfig
Diffstat (limited to 'examples')
-rw-r--r--examples/kconfig-static/Kconfig22
-rw-r--r--examples/kconfig-static/Makefile19
-rw-r--r--examples/kconfig-static/nfpkeys.json1
-rwxr-xr-xexamples/kconfig-static/nfpvalues.sh22
4 files changed, 64 insertions, 0 deletions
diff --git a/examples/kconfig-static/Kconfig b/examples/kconfig-static/Kconfig
new file mode 100644
index 0000000..1b02bac
--- /dev/null
+++ b/examples/kconfig-static/Kconfig
@@ -0,0 +1,22 @@
+choice
+prompt "pi or tau?"
+
+config X5
+bool "X = 5"
+
+config X6
+bool "X = 6"
+depends on !Y0
+
+endchoice
+
+choice
+prompt "apples or oranges?"
+
+config Y4
+bool "Y = 4"
+
+config Y0
+bool "Y = 0"
+
+endchoice
diff --git a/examples/kconfig-static/Makefile b/examples/kconfig-static/Makefile
new file mode 100644
index 0000000..9e56c12
--- /dev/null
+++ b/examples/kconfig-static/Makefile
@@ -0,0 +1,19 @@
+default:
+ @true
+
+config:
+ kconfig-qconf Kconfig
+
+randconfig:
+ kconfig-conf --randconfig Kconfig
+
+clean:
+ @true
+
+nfpvalues:
+ @./nfpvalues.sh
+
+nfpkeys:
+ @cat nfpkeys.json
+
+.PHONY: default config randconfig clean nfpvalues nfpkeys
diff --git a/examples/kconfig-static/nfpkeys.json b/examples/kconfig-static/nfpkeys.json
new file mode 100644
index 0000000..82a3e7f
--- /dev/null
+++ b/examples/kconfig-static/nfpkeys.json
@@ -0,0 +1 @@
+{"Synthetic": {"X": {"unit": "apples", "description": "NFP X", "minimize": true}, "Y": {"unit": "oranges", "description": "NFP Y", "minimize": true}}}
diff --git a/examples/kconfig-static/nfpvalues.sh b/examples/kconfig-static/nfpvalues.sh
new file mode 100755
index 0000000..574aa47
--- /dev/null
+++ b/examples/kconfig-static/nfpvalues.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+. ./.config
+
+X=0
+Y=0
+
+if [ "$CONFIG_X5" = y ]; then
+ X=5
+fi
+if [ "$CONFIG_X6" = y ]; then
+ X=6
+fi
+
+if [ "$CONFIG_Y0" = y ]; then
+ Y=0
+fi
+if [ "$CONFIG_Y4" = y ]; then
+ Y=4
+fi
+
+echo '{"Synthetic": {"X": '$X', "Y": '$Y'}}'