add integration tests for fomod parser
This commit is contained in:
88
tests/data/fomod/moduleconfig/banana.xml
Normal file
88
tests/data/fomod/moduleconfig/banana.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
<moduleName>The BANANA Mod</moduleName>
|
||||
<moduleImage path="fomod\images\banana.jpg" />
|
||||
|
||||
<installSteps>
|
||||
<installStep name="THE FIRST OF MANY STEPS">
|
||||
<optionalFileGroups order="Explicit">
|
||||
|
||||
|
||||
<group name="Banana Types" type="SelectAny">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="1700s">
|
||||
<description>Bananas from the 1700s were vastly different from what we see on the shelves today!</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="Required" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Australian">
|
||||
<description>Nobody knows why, but Australia has some WEIRD bananas.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="Recommended" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Modern Worldwide">
|
||||
<description>Ah, the modern Cavendish banana! How not-sweet it tastes! Do yourself a favor and get one from the 1700s.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="Optional" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Purple Bananas">
|
||||
<description>~~CENSORED~~</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="CouldBeUsable" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Brown Bananas">
|
||||
<description>Sorry, but you can't have feces.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="NotUsable" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
|
||||
<group name="Banana Textures" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="Base 1024x1024">
|
||||
<description>These textures are used for anything we didn't downscale/upscale.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="Required" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="2048x2048">
|
||||
<description>2K is a comfortable resolution fot banana textures.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="Recommended" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="4096x4096">
|
||||
<description>4K might be a bit over the top, but hey.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="Optional" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="128x128">
|
||||
<description>Looks awful.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="CouldBeUsable" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="0x0">
|
||||
<description>Just... don't install the mod.</description>
|
||||
<conditionFlags><flag name="1">1</flag></conditionFlags>
|
||||
<typeDescriptor><type name="NotUsable" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
</installSteps>
|
||||
|
||||
</config>
|
||||
10
tests/data/fomod/moduleconfig/example_01.xml
Normal file
10
tests/data/fomod/moduleconfig/example_01.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
|
||||
<moduleName>Example Mod</moduleName>
|
||||
|
||||
<requiredInstallFiles>
|
||||
<file source="example.plugin"/>
|
||||
</requiredInstallFiles>
|
||||
|
||||
</config>
|
||||
30
tests/data/fomod/moduleconfig/example_02.xml
Normal file
30
tests/data/fomod/moduleconfig/example_02.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<!-- For this second example, let's make use of dependencies.
|
||||
Before starting the installation, dependencies
|
||||
make sure the things you specify are in place.
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
|
||||
<moduleName>Example Mod</moduleName>
|
||||
|
||||
<!-- The "And" operator means that all dependencies
|
||||
below this tag must be true for it to be true
|
||||
as well. The other possible value is "Or".
|
||||
-->
|
||||
<moduleDependencies operator="And">
|
||||
<fileDependency file="depend1.plugin" state="Active"/>
|
||||
<dependencies operator="Or">
|
||||
<fileDependency file="depend2v1.plugin" state="Active"/>
|
||||
<fileDependency file="depend2v2.plugin" state="Active"/>
|
||||
</dependencies>
|
||||
</moduleDependencies>
|
||||
|
||||
<!-- Now before installing our lovely and empty
|
||||
data file in requiredInstallFiles,
|
||||
we need to make sure a few other plugins exist
|
||||
-->
|
||||
<requiredInstallFiles>
|
||||
<file source="example.plugin"/>
|
||||
</requiredInstallFiles>
|
||||
|
||||
</config>
|
||||
86
tests/data/fomod/moduleconfig/example_03.xml
Normal file
86
tests/data/fomod/moduleconfig/example_03.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<!-- On the third example, we'll take a look at using
|
||||
install steps to let users choose what to install
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
|
||||
<moduleName>Example Mod</moduleName>
|
||||
|
||||
<moduleDependencies operator="And">
|
||||
<fileDependency file="depend1.plugin" state="Active"/>
|
||||
<dependencies operator="Or">
|
||||
<fileDependency file="depend2v1.plugin" state="Active"/>
|
||||
<fileDependency file="depend2v2.plugin" state="Active"/>
|
||||
</dependencies>
|
||||
</moduleDependencies>
|
||||
|
||||
<!-- We'll no longer be using "requiredInstallFiles"
|
||||
since we can now offer a choice between files
|
||||
-->
|
||||
<installSteps order="Explicit">
|
||||
<installStep name="Choose Option">
|
||||
|
||||
<!-- In 99.9% of cases you'll want to set
|
||||
the 'order' attribute in "installSteps",
|
||||
"optionalFileGroups" and "plugins" to
|
||||
'Explicit'
|
||||
-->
|
||||
<optionalFileGroups order="Explicit">
|
||||
|
||||
<!-- This tag collects options into separate
|
||||
groups - useful if you want to have multiple
|
||||
types of choices for the user in a single
|
||||
step
|
||||
-->
|
||||
<group name="Select an option:" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<!-- Each "plugin" tag represents a choice
|
||||
the user can make.
|
||||
-->
|
||||
<plugin name="Option A">
|
||||
|
||||
<description>Select this to install Option A!</description>
|
||||
|
||||
<!-- Optional but recommended
|
||||
-->
|
||||
<image path="fomod/option_a.png"/>
|
||||
|
||||
<!-- The files/folders to install
|
||||
-->
|
||||
<files>
|
||||
<folder source="option_a"/>
|
||||
</files>
|
||||
|
||||
<!-- This describes what type the plugin is.
|
||||
Most likely you'll choose between:
|
||||
- 'Optional'
|
||||
- 'Required'
|
||||
- 'Recommended'
|
||||
-->
|
||||
<typeDescriptor>
|
||||
<type name="Recommended"/>
|
||||
</typeDescriptor>
|
||||
|
||||
</plugin>
|
||||
|
||||
<plugin name="Option B">
|
||||
<description>Select this to install Option B!</description>
|
||||
<image path="fomod/option_b.png"/>
|
||||
<files>
|
||||
<folder source="option_b"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
</optionalFileGroups>
|
||||
|
||||
</installStep>
|
||||
</installSteps>
|
||||
|
||||
</config>
|
||||
141
tests/data/fomod/moduleconfig/example_04.xml
Normal file
141
tests/data/fomod/moduleconfig/example_04.xml
Normal file
@@ -0,0 +1,141 @@
|
||||
<!-- This time we'll take a look at multiple step
|
||||
installs - flags and visiblity
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
|
||||
<moduleName>Example Mod</moduleName>
|
||||
|
||||
<moduleDependencies operator="And">
|
||||
<fileDependency file="depend1.plugin" state="Active"/>
|
||||
<dependencies operator="Or">
|
||||
<fileDependency file="depend2v1.plugin" state="Active"/>
|
||||
<fileDependency file="depend2v2.plugin" state="Active"/>
|
||||
</dependencies>
|
||||
</moduleDependencies>
|
||||
|
||||
<installSteps order="Explicit">
|
||||
|
||||
<installStep name="Choose Option">
|
||||
<optionalFileGroups order="Explicit">
|
||||
<group name="Select an option:" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="Option A">
|
||||
<description>Select this to install Option A!</description>
|
||||
<image path="fomod/option_a.png"/>
|
||||
<files>
|
||||
<folder source="option_a"/>
|
||||
</files>
|
||||
<!-- conditionFlags and files have interchangeable
|
||||
order and at least one of them needs to be
|
||||
present.
|
||||
|
||||
conditionFlags sets flags whenever this plugin
|
||||
is selected.
|
||||
-->
|
||||
<conditionFlags>
|
||||
<flag name="option_a">selected</flag>
|
||||
</conditionFlags>
|
||||
<typeDescriptor>
|
||||
<type name="Recommended"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Option B">
|
||||
<description>Select this to install Option B!</description>
|
||||
<image path="fomod/option_b.png"/>
|
||||
<files>
|
||||
<folder source="option_b"/>
|
||||
</files>
|
||||
<conditionFlags>
|
||||
<flag name="option_b">selected</flag>
|
||||
</conditionFlags>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
|
||||
<installStep name="Choose Texture">
|
||||
<!-- visible is a dependencies network that lets this
|
||||
step appear only when it's conditions are met.
|
||||
|
||||
If they're not met, this step is skipped.
|
||||
-->
|
||||
<visible>
|
||||
<flagDependency flag="option_a" value="selected"/>
|
||||
</visible>
|
||||
<optionalFileGroups order="Explicit">
|
||||
<group name="Select a texture:" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="Texture Blue">
|
||||
<description>Select this to install Texture Blue!</description>
|
||||
<image path="fomod/texture_blue.png"/>
|
||||
<files>
|
||||
<folder source="texture_blue_a"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Texture Red">
|
||||
<description>Select this to install Texture Red!</description>
|
||||
<image path="fomod/texture_red.png"/>
|
||||
<files>
|
||||
<folder source="texture_red_a"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
|
||||
<installStep name="Choose Texture">
|
||||
<visible>
|
||||
<flagDependency flag="option_b" value="selected"/>
|
||||
</visible>
|
||||
<optionalFileGroups order="Explicit">
|
||||
<group name="Select a texture:" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="Texture Blue">
|
||||
<description>Select this to install Texture Blue!</description>
|
||||
<image path="fomod/texture_blue.png"/>
|
||||
<files>
|
||||
<folder source="texture_blue_b"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Texture Red">
|
||||
<description>Select this to install Texture Red!</description>
|
||||
<image path="fomod/texture_red.png"/>
|
||||
<files>
|
||||
<folder source="texture_red_b"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
|
||||
</installSteps>
|
||||
|
||||
</config>
|
||||
133
tests/data/fomod/moduleconfig/example_05.xml
Normal file
133
tests/data/fomod/moduleconfig/example_05.xml
Normal file
@@ -0,0 +1,133 @@
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
|
||||
<moduleName>Example Mod</moduleName>
|
||||
|
||||
<moduleDependencies operator="And">
|
||||
<fileDependency file="depend1.plugin" state="Active"/>
|
||||
<dependencies operator="Or">
|
||||
<fileDependency file="depend2v1.plugin" state="Active"/>
|
||||
<fileDependency file="depend2v2.plugin" state="Active"/>
|
||||
</dependencies>
|
||||
</moduleDependencies>
|
||||
|
||||
<installSteps order="Explicit">
|
||||
<installStep name="Choose Option">
|
||||
<optionalFileGroups order="Explicit">
|
||||
|
||||
<group name="Select an option:" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="Option A">
|
||||
<description>Select this to install Option A!</description>
|
||||
<image path="fomod/option_a.png"/>
|
||||
<conditionFlags>
|
||||
<flag name="option_a">selected</flag>
|
||||
</conditionFlags>
|
||||
<typeDescriptor>
|
||||
<type name="Recommended"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Option B">
|
||||
<description>Select this to install Option B!</description>
|
||||
<image path="fomod/option_b.png"/>
|
||||
<conditionFlags>
|
||||
<flag name="option_b">selected</flag>
|
||||
</conditionFlags>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
<!-- Since we're installing everything in
|
||||
conditionalFileInstalls we're free to
|
||||
make all selections in a single step.
|
||||
-->
|
||||
<group name="Select a texture:" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="Texture Blue">
|
||||
<description>Select this to install Texture Blue!</description>
|
||||
<image path="fomod/texture_blue.png"/>
|
||||
<conditionFlags>
|
||||
<flag name="texture_blue">selected</flag>
|
||||
</conditionFlags>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Texture Red">
|
||||
<description>Select this to install Texture Red!</description>
|
||||
<image path="fomod/texture_red.png"/>
|
||||
<conditionFlags>
|
||||
<flag name="texture_red">selected</flag>
|
||||
</conditionFlags>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
</installSteps>
|
||||
|
||||
<!-- This is where we're installing everything.
|
||||
-->
|
||||
<conditionalFileInstalls>
|
||||
<patterns>
|
||||
<!-- Each pattern is a piece of the matrix
|
||||
eseentially linking a set of dependencies
|
||||
to a set of files to install.
|
||||
-->
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="option_a" value="selected"/>
|
||||
<flagDependency flag="texture_blue" value="selected"/>
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="option_a"/>
|
||||
<folder source="texture_blue_a"/>
|
||||
</files>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="option_a" value="selected"/>
|
||||
<flagDependency flag="texture_red" value="selected"/>
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="option_a"/>
|
||||
<folder source="texture_red_a"/>
|
||||
</files>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="option_b" value="selected"/>
|
||||
<flagDependency flag="texture_blue" value="selected"/>
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="option_b"/>
|
||||
<folder source="texture_blue_b"/>
|
||||
</files>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="option_b" value="selected"/>
|
||||
<flagDependency flag="texture_red" value="selected"/>
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="option_b"/>
|
||||
<folder source="texture_red_b"/>
|
||||
</files>
|
||||
</pattern>
|
||||
</patterns>
|
||||
</conditionalFileInstalls>
|
||||
|
||||
</config>
|
||||
118
tests/data/fomod/moduleconfig/ineed.xml
Normal file
118
tests/data/fomod/moduleconfig/ineed.xml
Normal file
@@ -0,0 +1,118 @@
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
<moduleName>iNeed - Food, Water and Sleep - Continued</moduleName>
|
||||
<installSteps order="Explicit">
|
||||
<installStep name="Options">
|
||||
<optionalFileGroups>
|
||||
<group name="0. Core" type="SelectAny">
|
||||
<plugins order="Explicit">
|
||||
<plugin name="Core Files">
|
||||
<description>
|
||||
Contains the main mod.
|
||||
</description>
|
||||
<image path="FOMod\screenshot.jpg"/>
|
||||
<files>
|
||||
<folder source="00 Core" destination="" priority="0"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Required"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
<group name="1. Extended" type="SelectExactlyOne">
|
||||
<plugins order="Explicit">
|
||||
<plugin name="Full | Requires AE and Creation Club Fishing">
|
||||
<description>
|
||||
Requires AE and Creation Club Fishing. This option is not compatible with other mods that modify vanilla food, recipes and with 'Survival' mode! Enables snow collection from medium to large exterior snow drifts simply by activating them. Removes magic effect buffs and debuffs from most food and drink items. Removes the Salt Pile ingredient from cooked meat. Rebalances soup recipes by adding a water ingredient requirement and by changing the number of soups produced from 1 to 2. Innkeepers will now sometimes sell soups and Hearthfire foods.
|
||||
</description>
|
||||
<image path="FOMod\extended.jpg"/>
|
||||
<files>
|
||||
<folder source="01 Extended" destination="" priority="1"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
<plugin name="No Food Changes | Requires AE and Creation Club Fishing">
|
||||
<description>
|
||||
Requires AE and Creation Club Fishing. This option is not compatible with other mods that modify vanilla recipes and with 'Survival' mode! Enables snow collection from medium to large exterior snow drifts simply by activating them. Removes the Salt Pile ingredient from cooked meat. Rebalances soup recipes by adding a water ingredient requirement and by changing the number of soups produced from 1 to 2. Innkeepers will now sometimes sell soups and Hearthfire foods.
|
||||
</description>
|
||||
<image path="FOMod\extended.jpg"/>
|
||||
<files>
|
||||
<folder source="02 Extended - No Food" destination="" priority="1"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
<plugin name="No Food / No Recipe Changes | Requires AE and Creation Club Fishing">
|
||||
<description>
|
||||
Requires AE and Creation Club Fishing. Enables snow collection from medium to large exterior snow drifts simply by activating them. This option is compatible with all other mods that change "vanilla" cooking recipes, such as CACO or Cooking Expanded. Install it if such mods are installed, for better compatibility with iNeed.
|
||||
</description>
|
||||
<image path="FOMod\extended.jpg"/>
|
||||
<files>
|
||||
<folder source="03 Extended - No Food - No Recipes" destination="" priority="1"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
<plugin name="None">
|
||||
<description>
|
||||
iNeed - Extended will not be installed.
|
||||
</description>
|
||||
<image path="FOMod\extended.jpg"/>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
<group name="2. Compatibility" type="SelectAny">
|
||||
<plugins order="Explicit">
|
||||
<plugin name="Nordic Snow">
|
||||
<description>
|
||||
Select this option if you have any version of iNeed - Extended installed along with Nordic Snow. This patch will match up the snow drift textures with the rest of the landscape modified by Nordic Snow.
|
||||
</description>
|
||||
<image path="FOMod\snow.jpg"/>
|
||||
<files>
|
||||
<folder source="10 Nordic Snow" destination="" priority="1"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
<plugin name="NobleSkyrimMod">
|
||||
<description>
|
||||
Select this option if you have any version of iNeed - Extended installed along with NobleSkyrimMod. This patch will match up the snow drift textures with the rest of the landscape modified by NobleSkyrimMod.
|
||||
</description>
|
||||
<image path="FOMod\snow.jpg"/>
|
||||
<files>
|
||||
<folder source="11 NobleSkyrimMod" destination="" priority="1"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
<group name="Optionals" type="SelectAny">
|
||||
<plugins order="Explicit">
|
||||
<plugin name="Dangerous Diseases">
|
||||
<description>
|
||||
All non-transformative diseases will be more unique, harder to cure and progress through 4 deadlier stages at random intervals. See mod description for more information.
|
||||
</description>
|
||||
<image path="FOMod\disease.jpg"/>
|
||||
<files>
|
||||
<folder source="12 Dangerous Diseases Converted" destination="" priority="1"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
</installSteps>
|
||||
</config>
|
||||
171
tests/data/fomod/moduleconfig/starui.xml
Normal file
171
tests/data/fomod/moduleconfig/starui.xml
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
<moduleName>StarUI Inventory</moduleName>
|
||||
|
||||
<installSteps order="Explicit">
|
||||
|
||||
<installStep name="Select installation options">
|
||||
<optionalFileGroups order="Explicit">
|
||||
<group name="Main files" type="SelectAny">
|
||||
<plugins order="Explicit">
|
||||
|
||||
<plugin name="StarUI Inventory">
|
||||
<description>StarUI Inventory improves all inventory screens for use on a PC. Compact display style. More details in sortable columns. Item category icons. Category as left sidebar. Many quality of life features!</description>
|
||||
<image path="fomod\images\StarUI Inventory Teaser.jpg" />
|
||||
<files />
|
||||
<typeDescriptor><type name="Required" /></typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
<group name="Mod Manager" type="SelectExactlyOne">
|
||||
<plugins order='Explicit'>
|
||||
<plugin name="Vortex">
|
||||
<description>Select this if you use Vortex</description>
|
||||
<image path="fomod\images\StarUI Inventory Teaser.jpg" />
|
||||
<conditionFlags>
|
||||
<flag name="flag_vortex">Active</flag>
|
||||
</conditionFlags>
|
||||
<files>
|
||||
<folder source="Interface" destination="Data\Interface" />
|
||||
</files>
|
||||
<typeDescriptor><type name="Optional" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Mod Organizer 2">
|
||||
<description>Select this if you use Mod Organizer 2.</description>
|
||||
<image path="fomod\images\StarUI Inventory Teaser.jpg" />
|
||||
<conditionFlags>
|
||||
<flag name="flag_mo2">Active</flag>
|
||||
</conditionFlags>
|
||||
<files>
|
||||
<folder source="Interface" destination="Interface" />
|
||||
</files>
|
||||
<typeDescriptor><type name="Optional" /></typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
|
||||
<group name="FPS (Frames Per Second)" type="SelectExactlyOne">
|
||||
<plugins order='Explicit'>
|
||||
<plugin name="30 FPS - Vanilla">
|
||||
<description>Vanilla interface FPS. As like in the original game.</description>
|
||||
<image path="fomod\images\StarUI Inventory Teaser.jpg" />
|
||||
<conditionFlags>
|
||||
<flag name="flag_30fps">Active</flag>
|
||||
</conditionFlags>
|
||||
<files />
|
||||
<typeDescriptor><type name="Optional" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="60 FPS - Smooth and stable">
|
||||
<description>Doubles the default interface FPS. Smoother and more responsive.</description>
|
||||
<image path="fomod\images\StarUI Inventory Teaser.jpg" />
|
||||
<conditionFlags>
|
||||
<flag name="flag_60fps">Active</flag>
|
||||
</conditionFlags>
|
||||
<files />
|
||||
<typeDescriptor><type name="Recommended" /></typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="120 FPS - High-FPS (may cause crashes)">
|
||||
<description>High-FPS version. This version needs an appropiate monitor to be used. 
|
||||
WARNING: Using 120FPS may cause the game to crash, as the game engine is not programmed for such high interface FPS rates.
|
||||

|
||||
USE AT YOUR OWN RISK.
|
||||
</description>
|
||||
<image path="fomod\images\StarUI Inventory Teaser.jpg" />
|
||||
<conditionFlags>
|
||||
<flag name="flag_120fps">Active</flag>
|
||||
</conditionFlags>
|
||||
<files />
|
||||
<typeDescriptor><type name="Optional" /></typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
|
||||
</optionalFileGroups>
|
||||
|
||||
</installStep>
|
||||
|
||||
<installStep name="README">
|
||||
<optionalFileGroups order="Explicit">
|
||||
<group name="Please read the notes" type="SelectAny">
|
||||
<plugins order="Explicit">
|
||||
<plugin name="Requires Archive Invalidation">
|
||||
<description>You will need to enable Archive Invalidation to load loose files.
|
||||
If you haven't done that yet, see the mod page for detailed instructions.
</description>
|
||||
<files />
|
||||
<typeDescriptor>
|
||||
<type name="Required" />
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="INI: Settings, settings, settings">
|
||||
<description>You can configure many different settings in the file Interface\StarUI Inventory.ini .
|
||||
Every settings is described in the file, so you can easily adapt the whole mod to your liking.
</description>
|
||||
<files />
|
||||
<typeDescriptor>
|
||||
<type name="Required" />
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
<plugin name="Configuration done">
|
||||
<description>Ready for installation.
|
||||
If you are updating, make sure you have a backup of your StarUI Inventory.ini to keep your settings.
</description>
|
||||
<files />
|
||||
<typeDescriptor>
|
||||
<type name="Required" />
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</group>
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
</installSteps>
|
||||
|
||||
<conditionalFileInstalls>
|
||||
<patterns>
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="flag_vortex" value="Active" />
|
||||
<flagDependency flag="flag_30fps" value="Active" />
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="Optional\30fps\Interface" destination="Data\Interface" />
|
||||
</files>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="flag_mo2" value="Active" />
|
||||
<flagDependency flag="flag_30fps" value="Active" />
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="Optional\30fps\Interface" destination="Interface" />
|
||||
</files>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="flag_vortex" value="Active" />
|
||||
<flagDependency flag="flag_120fps" value="Active" />
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="Optional\120fps\Interface" destination="Data\Interface" />
|
||||
</files>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<dependencies operator="And">
|
||||
<flagDependency flag="flag_mo2" value="Active" />
|
||||
<flagDependency flag="flag_120fps" value="Active" />
|
||||
</dependencies>
|
||||
<files>
|
||||
<folder source="Optional\120fps\Interface" destination="Interface" />
|
||||
</files>
|
||||
</pattern>
|
||||
</patterns>
|
||||
</conditionalFileInstalls>
|
||||
|
||||
</config>
|
||||
60
tests/data/fomod/moduleconfig/trade_barter.xml
Normal file
60
tests/data/fomod/moduleconfig/trade_barter.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
|
||||
<moduleName>Trade and Barter - Patches</moduleName>
|
||||
<moduleImage path="FOMOD\header.jpg"/>
|
||||
|
||||
<installSteps order="Explicit">
|
||||
<installStep name="Trade and Barter - Patches ESPLite">
|
||||
<optionalFileGroups>
|
||||
<group name="Core" type="SelectAny">
|
||||
<plugins order="Explicit">
|
||||
<plugin name="Beyond Bruma Patch">
|
||||
<description>
|
||||
ESPLite version
|
||||
</description>
|
||||
<files>
|
||||
<folder source="01_bruma" destination="" priority="0"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
<plugin name="YASH Patch">
|
||||
<description>
|
||||
ESPLite version
|
||||
</description>
|
||||
<files>
|
||||
<folder source="02_yash" destination="" priority="0"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
<plugin name="Keld-Nar Patch">
|
||||
<description>
|
||||
ESPLite version
|
||||
</description>
|
||||
<files>
|
||||
<folder source="00_keld" destination="" priority="0"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
<plugin name="Priest Vendors Patch">
|
||||
<description>
|
||||
ESPLite version
|
||||
</description>
|
||||
<files>
|
||||
<folder source="03_vendor" destination="" priority="0"/>
|
||||
</files>
|
||||
<typeDescriptor>
|
||||
<type name="Optional"/>
|
||||
</typeDescriptor>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</group>
|
||||
</optionalFileGroups>
|
||||
</installStep>
|
||||
|
||||
</installSteps>
|
||||
</config>
|
||||
41
tests/fomod_test.rs
Normal file
41
tests/fomod_test.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use fomod_manager::fomod::{self, FOModError};
|
||||
|
||||
fn get_parent() -> PathBuf {
|
||||
PathBuf::from(file!()).parent().unwrap().to_owned()
|
||||
}
|
||||
|
||||
fn get_xml(filename: &str) -> PathBuf {
|
||||
get_parent().join(format!("data/fomod/moduleconfig/{}", filename))
|
||||
}
|
||||
|
||||
fn err_to_string(e: FOModError) -> String {
|
||||
match e {
|
||||
FOModError::Io(error) => format!("IO: {:?}", error),
|
||||
FOModError::Parse(de_error) => match de_error {
|
||||
quick_xml::DeError::UnexpectedStart(items) => {
|
||||
format!("UnexpectedStart: {}", str::from_utf8(&items).unwrap())
|
||||
}
|
||||
_ => format!("Other: {:?}", de_error),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse() {
|
||||
for xml in [
|
||||
"ineed.xml",
|
||||
"trade_barter.xml",
|
||||
"starui.xml",
|
||||
"example_01.xml",
|
||||
"example_02.xml",
|
||||
"example_03.xml",
|
||||
"example_04.xml",
|
||||
"example_05.xml",
|
||||
"banana.xml",
|
||||
] {
|
||||
fomod::Config::load_from_file(get_xml(xml))
|
||||
.unwrap_or_else(|e| panic!("Parse for {xml} with {}", err_to_string(e)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user