summaryrefslogtreecommitdiffstats
path: root/korundum/rubylib/rbkconfig_compiler/tests
diff options
context:
space:
mode:
Diffstat (limited to 'korundum/rubylib/rbkconfig_compiler/tests')
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/Makefile.am40
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/myprefs.rb5
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg55
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test1.kcfgc18
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test1main.rb4
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test2.kcfg78
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test2.kcfgc11
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test2main.rb5
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test3.kcfg26
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test3.kcfgc12
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test3main.rb4
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg42
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test4.kcfgc11
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test4main.rb4
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg42
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test5.kcfgc11
-rw-r--r--korundum/rubylib/rbkconfig_compiler/tests/test5main.rb4
17 files changed, 372 insertions, 0 deletions
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/Makefile.am b/korundum/rubylib/rbkconfig_compiler/tests/Makefile.am
new file mode 100644
index 00000000..ce61f658
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/Makefile.am
@@ -0,0 +1,40 @@
+check_PROGRAMS = test1 test2 test3 test4 test5
+
+CLEANFILES = test1.rb \
+ test2.rb \
+ test3.rb \
+ test4.rb \
+ test5.rb \
+ md5sums
+
+all: $(SOURCES)
+
+# Splitting this with backslashses produces broken Makefiles
+SOURCES = test1main.rb test1.rb test2main.rb test2.rb test3main.rb test3.rb test4main.rb test4.rb test5main.rb test5.rb
+
+# avoid running the below command in parallel
+test1.rb: $(srcdir)/test1.kcfg ../rbkconfig_compiler $(srcdir)/test1.kcfgc
+ ../rbkconfig_compiler $(srcdir)/test1.kcfg $(srcdir)/test1.kcfgc
+
+# avoid running the below command in parallel
+test2.rb: $(srcdir)/test2.kcfg ../rbkconfig_compiler $(srcdir)/test2.kcfgc
+ ../rbkconfig_compiler $(srcdir)/test2.kcfg $(srcdir)/test2.kcfgc
+
+# avoid running the below command in parallel
+test3.rb: $(srcdir)/test3.kcfg ../rbkconfig_compiler $(srcdir)/test3.kcfgc
+ ../rbkconfig_compiler $(srcdir)/test3.kcfg $(srcdir)/test3.kcfgc
+
+# avoid running the below command in parallel
+test4.rb: $(srcdir)/test4.kcfg ../rbkconfig_compiler $(srcdir)/test4.kcfgc
+ ../rbkconfig_compiler $(srcdir)/test4.kcfg $(srcdir)/test4.kcfgc
+
+# avoid running the below command in parallel
+test5.rb: $(srcdir)/test5.kcfg ../rbkconfig_compiler $(srcdir)/test5.kcfgc
+ ../rbkconfig_compiler $(srcdir)/test5.kcfg $(srcdir)/test5.kcfgc
+
+md5sums:
+ $(MD5SUM) $(srcdir)/test*.ref | sed -e "s,$(srcdir)/,,; s,\.ref$$,," > md5sums
+
+md5check: test1.rb test2.rb test3.rb test4.rb test5.rb md5sums
+ $(MD5SUM) --check md5sums
+
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/myprefs.rb b/korundum/rubylib/rbkconfig_compiler/tests/myprefs.rb
new file mode 100644
index 00000000..a4f1f082
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/myprefs.rb
@@ -0,0 +1,5 @@
+class MyPrefs < KDE::ConfigSkeleton
+ def initialize( a )
+ super( a )
+ end
+end
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg
new file mode 100644
index 00000000..0c0c8216
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <include>qdir.h</include>
+ <kcfgfile name="examplerc">
+ <parameter name="transport" />
+ <parameter name="folder" />
+ </kcfgfile>
+ <group name="General-$(folder)">
+ <entry name="OneOption" type="Bool">
+ <label>One option</label>
+ <default>true</default>
+ </entry>
+ <entry name="AnotherOption" type="Int" key="Another Option">
+ <label>Another option</label>
+ <default>5</default>
+ </entry>
+ <entry name="ListOption" type="Enum">
+ <label>This is some funky option</label>
+ <whatsthis>And this is a longer description of this option. Just wondering, how will the translations of those be handled?</whatsthis>
+ <choices>
+ <choice name="One"/>
+ <choice name="Two"/>
+ <choice name="Three"/>
+ </choices>
+ <default>One</default>
+ </entry>
+ </group>
+ <group name="MyOptions">
+ <entry name="MyString" type="String">
+ <label>This is a string</label>
+ <default>Default String</default>
+ </entry>
+ <entry name="MyPath" type="Path">
+ <label>This is a path</label>
+ <default code="true">Qt::Dir.homeDirPath()+".hidden_file"</default>
+ </entry>
+ <entry name="AnotherOption2" type="Int" key="Another Option">
+ <label>Another option</label>
+ <default>10</default>
+ </entry>
+ <entry name="MyStringList" type="StringList">
+ <default>up,down</default>
+ </entry>
+ <entry name="MyStringListHidden" hidden="true" type="StringList">
+ <default>up,down</default>
+ </entry>
+ <entry name="MyNumber" type="Int" key="List-$(transport)-$(folder)">
+ <label>List Number</label>
+ <default>1</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfgc b/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfgc
new file mode 100644
index 00000000..6e0edd36
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test1.kcfgc
@@ -0,0 +1,18 @@
+# Code generation options for kconfig_compiler
+ClassName=Test1
+#
+# Singleton=false
+#
+# Inherits=KConfigSkeleton
+#
+# IncludeFiles=libkdepim/kpimprefs.h
+#
+# MemberVariables=public
+#
+### The following line includes the file exampleprefs_base_addon.h
+### It can be used to add extra functions and variables to the
+### class.
+# CustomAdditions=true
+#
+### Provide setFooBar(int) style functions
+Mutators=true
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test1main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test1main.rb
new file mode 100644
index 00000000..88a151a6
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test1main.rb
@@ -0,0 +1,4 @@
+require 'Korundum'
+require 'test1.rb'
+
+t = Test1.new(nil, nil)
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test2.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test2.kcfg
new file mode 100644
index 00000000..3b19e270
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test2.kcfg
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="korganizerrc"/>
+
+ <group name="General">
+ <entry type="Bool" key="Auto Save">
+ <label>Enable automatic saving of calendar</label>
+ <whatsthis>WhatsThis text for AutoSave option</whatsthis>
+ <default>false</default>
+ </entry>
+ <entry type="Int" key="Auto Save Interval">
+ <default>10</default>
+ </entry>
+ <entry type="Bool" key="Confirm Deletes" name="Confirm">
+ <label>Confirm deletes</label>
+ <default>true</default>
+ </entry>
+ <entry type="String" key="Archive File">
+ </entry>
+ <entry type="Enum" key="Destination" name="Destination">
+ <label>New Events/Todos Should</label>
+ <choices>
+ <choice name="standardDestination">
+ </choice>
+ <choice name="askDestination">
+ </choice>
+ <choice name="argl1">
+ <label>Argl1 Label</label>
+ </choice>
+ <choice name="argl2">
+ <whatsthis>Argl2 Whatsthis</whatsthis>
+ </choice>
+ <choice name="argl3">
+ <label>Argl3 Label</label>
+ <whatsthis>Argl3 Whatsthis</whatsthis>
+ </choice>
+ </choices>
+ <default>standardDestination</default>
+ </entry>
+ </group>
+
+ <group name="Views">
+ <entry type="Int" key="Hour Size">
+ <default>10</default>
+ </entry>
+ <entry type="Bool" name="SelectionStartsEditor">
+ <label>Time range selection in agenda view starts event editor</label>
+ <default>false</default>
+ </entry>
+ </group>
+
+ <group name="KOrganizer Plugins">
+ <entry type="StringList" name="SelectedPlugins">
+ <default>holidays,webexport</default>
+ </entry>
+ </group>
+
+ <group name="Colors">
+ <entry type="Color" key="Highlight Color">
+ <label>Highlight color</label>
+ <default>100, 100, 255</default>
+ </entry>
+ <entry type="Color" key="Agenda Background Color" name="AgendaBgColor">
+ <label>Agenda view background color</label>
+ <default>255, 255, 255</default>
+ </entry>
+ </group>
+
+ <group name="Fonts">
+ <entry type="Font" key="TimeBar Font">
+ <label>Time bar</label>
+ </entry>
+ </group>
+
+</kcfg>
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test2.kcfgc b/korundum/rubylib/rbkconfig_compiler/tests/test2.kcfgc
new file mode 100644
index 00000000..56620d2f
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test2.kcfgc
@@ -0,0 +1,11 @@
+# Code generation options for kconfig_compiler
+File=test2.kcfg
+ClassName=Test2
+Singleton=false
+Mutators=true
+Inherits=MyPrefs
+IncludeFiles=myprefs.h
+MemberVariables=public
+GlobalEnums=true
+ItemAccessors=true
+SetUserTexts=true
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test2main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test2main.rb
new file mode 100644
index 00000000..85d18f07
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test2main.rb
@@ -0,0 +1,5 @@
+require 'Korundum'
+require 'myprefs.rb'
+require 'test2.rb'
+
+t = Test2.new()
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test3.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test3.kcfg
new file mode 100644
index 00000000..77916da4
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test3.kcfg
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="test3rc"/>
+
+ <group name="General">
+ <entry type="Bool" key="Auto Save">
+ <label>Enable automatic saving of calendar</label>
+ <whatsthis>WhatsThis text for AutoSave option</whatsthis>
+ <default>false</default>
+ </entry>
+ </group>
+
+ <group name="Blah">
+ <entry type="Int" name="Blubb">
+ <default>10</default>
+ </entry>
+ <entry type="String" name="BlahBlah">
+ <default>a string</default>
+ </entry>
+ <entry type="Password" name="MyPassword"/>
+ </group>
+
+</kcfg>
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test3.kcfgc b/korundum/rubylib/rbkconfig_compiler/tests/test3.kcfgc
new file mode 100644
index 00000000..ca2c2205
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test3.kcfgc
@@ -0,0 +1,12 @@
+# Code generation options for kconfig_compiler
+File=test3.kcfg
+NameSpace=TestNameSpace
+ClassName=Test3
+#Singleton=false
+Mutators=true
+#Inherits=MyPrefs
+#IncludeFiles=myprefs.h
+#MemberVariables=public
+GlobalEnums=true
+ItemAccessors=true
+#SetUserTexts=true
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test3main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test3main.rb
new file mode 100644
index 00000000..8c19b442
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test3main.rb
@@ -0,0 +1,4 @@
+require 'Korundum'
+require 'test3.rb'
+
+t = TestNameSpace::Test3.new()
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg
new file mode 100644
index 00000000..1428bc0d
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfg
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="test4rc"/>
+
+ <group name="Foo">
+ <entry name="Color$(Number)" type="Color" key="color #$(Number)">
+ <parameter name="Number" type="Int" max="3"/>
+ <label>Block colors.</label>
+ <code>defaultColor = [ Qt::red, Qt::blue, Qt::green, Qt::black ]</code>
+ <default code="true">defaultColor[$(Number)]</default>
+ </entry>
+ <entry name="MouseAction$(Button)" type="Enum" key="$(Button)_mouse_action">
+ <parameter name="Button" type="Enum">
+ <values>
+ <value>right</value>
+ <value>mid</value>
+ <value>left</value>
+ </values>
+ </parameter>
+ <label>Mouse actions.</label>
+ <choices>
+ <choice name="Encrypt"/>
+ <choice name="Decrypt"/>
+ <choice name="CrashNBurn"/>
+ <choice name="PumpNDump"/>
+ </choices>
+ <default param="right">Decrypt</default>
+ <default param="mid">Encrypt</default>
+ <default param="left">PumpNDump</default>
+ </entry>
+ <entry name="FooBar" key="foo bar" type="String"/>
+ <entry name="Age" type="Int">
+ <default>35</default>
+ <min>8</min>
+ <max>88</max>
+ </entry>
+ </group>
+
+</kcfg>
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfgc b/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfgc
new file mode 100644
index 00000000..754706df
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test4.kcfgc
@@ -0,0 +1,11 @@
+# Code generation options for kconfig_compiler
+File=test4.kcfg
+ClassName=Test4
+Singleton=true
+Mutators=true
+#Inherits=MyPrefs
+#IncludeFiles=myprefs.h
+#MemberVariables=public
+GlobalEnums=false
+ItemAccessors=false
+#SetUserTexts=true
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test4main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test4main.rb
new file mode 100644
index 00000000..c75f0995
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test4main.rb
@@ -0,0 +1,4 @@
+require 'Korundum'
+require 'test4.rb'
+
+t = Test4.instance()
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg b/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg
new file mode 100644
index 00000000..1428bc0d
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfg
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="test4rc"/>
+
+ <group name="Foo">
+ <entry name="Color$(Number)" type="Color" key="color #$(Number)">
+ <parameter name="Number" type="Int" max="3"/>
+ <label>Block colors.</label>
+ <code>defaultColor = [ Qt::red, Qt::blue, Qt::green, Qt::black ]</code>
+ <default code="true">defaultColor[$(Number)]</default>
+ </entry>
+ <entry name="MouseAction$(Button)" type="Enum" key="$(Button)_mouse_action">
+ <parameter name="Button" type="Enum">
+ <values>
+ <value>right</value>
+ <value>mid</value>
+ <value>left</value>
+ </values>
+ </parameter>
+ <label>Mouse actions.</label>
+ <choices>
+ <choice name="Encrypt"/>
+ <choice name="Decrypt"/>
+ <choice name="CrashNBurn"/>
+ <choice name="PumpNDump"/>
+ </choices>
+ <default param="right">Decrypt</default>
+ <default param="mid">Encrypt</default>
+ <default param="left">PumpNDump</default>
+ </entry>
+ <entry name="FooBar" key="foo bar" type="String"/>
+ <entry name="Age" type="Int">
+ <default>35</default>
+ <min>8</min>
+ <max>88</max>
+ </entry>
+ </group>
+
+</kcfg>
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfgc b/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfgc
new file mode 100644
index 00000000..663005e5
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test5.kcfgc
@@ -0,0 +1,11 @@
+# Code generation options for kconfig_compiler
+File=test5.kcfg
+ClassName=Test5
+Singleton=true
+Mutators=true
+#Inherits=MyPrefs
+#IncludeFiles=myprefs.h
+#MemberVariables=public
+GlobalEnums=true
+ItemAccessors=false
+#SetUserTexts=true
diff --git a/korundum/rubylib/rbkconfig_compiler/tests/test5main.rb b/korundum/rubylib/rbkconfig_compiler/tests/test5main.rb
new file mode 100644
index 00000000..cd0fbeb7
--- /dev/null
+++ b/korundum/rubylib/rbkconfig_compiler/tests/test5main.rb
@@ -0,0 +1,4 @@
+require 'Korundum'
+require 'test5.rb'
+
+t = Test5.instance()