From d4470788a4be14283b21ef5b39a1cabbe5274bd3 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 26 Aug 2016 11:11:29 +0200 Subject: [PATCH] Cleanup Scenarios to make it easier for TravisCI --- .../Paket.IntegrationTests/TestHelper.fs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/integrationtests/Paket.IntegrationTests/TestHelper.fs b/integrationtests/Paket.IntegrationTests/TestHelper.fs index ef684cb6c5..538bec714b 100644 --- a/integrationtests/Paket.IntegrationTests/TestHelper.fs +++ b/integrationtests/Paket.IntegrationTests/TestHelper.fs @@ -9,12 +9,27 @@ open FsUnit open System open System.IO +let scenarios = System.Collections.Generic.List<_>() + let paketToolPath = FullName(__SOURCE_DIRECTORY__ + "../../../bin/paket.exe") let integrationTestPath = FullName(__SOURCE_DIRECTORY__ + "../../../integrationtests/scenarios") let scenarioTempPath scenario = Path.Combine(integrationTestPath,scenario,"temp") let originalScenarioPath scenario = Path.Combine(integrationTestPath,scenario,"before") +let cleanup scenario = + let scenarioPath = scenarioTempPath scenario + CleanDir scenarioPath + +let cleanupAllScenarios() = + for scenario in scenarios do + cleanup scenario + scenarios.Clear() + let prepare scenario = + if scenarios.Count > 10 then + cleanupAllScenarios() + + scenarios.Add scenario let originalScenarioPath = originalScenarioPath scenario let scenarioPath = scenarioTempPath scenario CleanDir scenarioPath