From e449c8f2cbdebe67f456f503c93a413e7d8b824c Mon Sep 17 00:00:00 2001 From: Dimitri Baron Date: Mon, 18 Nov 2024 13:25:14 +0100 Subject: [PATCH] #428 Addition of unit test on outputIIDM (work in progress) Signed-off-by: Dimitri Baron --- .../test/TestRobustnessAnalysisLauncher.cpp | 18 ++ sources/Launcher/test/res/fic_DYD.xml | 119 +++++++ sources/Launcher/test/res/fic_IIDM.xml | 236 ++++++++++++++ sources/Launcher/test/res/fic_JOB.xml | 27 ++ sources/Launcher/test/res/fic_PAR.xml | 294 ++++++++++++++++++ 5 files changed, 694 insertions(+) create mode 100644 sources/Launcher/test/res/fic_DYD.xml create mode 100644 sources/Launcher/test/res/fic_IIDM.xml create mode 100644 sources/Launcher/test/res/fic_JOB.xml create mode 100644 sources/Launcher/test/res/fic_PAR.xml diff --git a/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp b/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp index 72394db6..584a4ab9 100644 --- a/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp +++ b/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp @@ -79,6 +79,18 @@ class MyLauncher : public RobustnessAnalysisLauncher { ASSERT_TRUE(exists("res/logs/log_MyScenario.log")); } + void launch2() { + inputs_.readInputs(workingDirectory_, "fic_JOB.xml"); + boost::shared_ptr job = inputs_.cloneJobEntry(); + SimulationParameters params; + params.activateExportIIDM_ = true; + result_.setScenarioId("MyScenario3"); + boost::shared_ptr simu = createAndInitSimulation("res", job, params, result_, inputs_); + simulate(simu, result_); + writeResults(); + ASSERT_TRUE(exists("res/outputs2/outputIIDM/outputIIDM_MyScenario3.xml")); + } + void testInputFile(const std::string& inputFile) { ASSERT_EQ(inputFile_, inputFile); } @@ -174,6 +186,12 @@ TEST(TestLauncher, TestRobustnessAnalysisLauncher) { launcher.testOutputFileFullPath(createAbsolutePath("MyOutputFile.zip", createAbsolutePath("res", current_path()))); launcher.testMultipleJobs(); launcher.launch(); + + MyLauncher launcher2; + launcher2.setInputFile("MyInputFile.zip"); + launcher2.setDirectory("res"); + launcher2.init(); + launcher2.launch2(); } diff --git a/sources/Launcher/test/res/fic_DYD.xml b/sources/Launcher/test/res/fic_DYD.xml new file mode 100644 index 00000000..1aca30e4 --- /dev/null +++ b/sources/Launcher/test/res/fic_DYD.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/Launcher/test/res/fic_IIDM.xml b/sources/Launcher/test/res/fic_IIDM.xml new file mode 100644 index 00000000..8ecba546 --- /dev/null +++ b/sources/Launcher/test/res/fic_IIDM.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/Launcher/test/res/fic_JOB.xml b/sources/Launcher/test/res/fic_JOB.xml new file mode 100644 index 00000000..896bad8b --- /dev/null +++ b/sources/Launcher/test/res/fic_JOB.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + diff --git a/sources/Launcher/test/res/fic_PAR.xml b/sources/Launcher/test/res/fic_PAR.xml new file mode 100644 index 00000000..3f1be3dc --- /dev/null +++ b/sources/Launcher/test/res/fic_PAR.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +