From 6fad701809947e52fdeb31989899119a6615ebf4 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Sat, 15 Sep 2018 17:37:07 +0100 Subject: [PATCH] rearrange required files for testing. Remove unused files in library, add reset scripts in testing and update save location path in console tests. --- DeathSocket/1000x1000.png | Bin 6132 -> 0 bytes DeathSocket/DeathSocket.fsproj | 2 - DeathSocket/IO.fs | 2 - TestCentre/ConsoleTests.fs | 2 +- .../LoadingTestArea/AboutLoadingTestArea.txt | 3 -- TestCentre/LoadingTestArea/LoadTest.png | Bin 6132 -> 0 bytes .../LoadingTestArea/RequiredInfo/LoadTest.png | Bin 0 -> 22529 bytes .../SavingTestArea/AboutSavingTestArea.txt | 2 - TestCentre/Script.fsx | 39 +++++++++++++++--- TestCentre/TestCentre.fsproj | 7 ---- 10 files changed, 35 insertions(+), 22 deletions(-) delete mode 100644 DeathSocket/1000x1000.png delete mode 100644 DeathSocket/IO.fs delete mode 100644 TestCentre/LoadingTestArea/AboutLoadingTestArea.txt delete mode 100644 TestCentre/LoadingTestArea/LoadTest.png create mode 100644 TestCentre/LoadingTestArea/RequiredInfo/LoadTest.png delete mode 100644 TestCentre/SavingTestArea/AboutSavingTestArea.txt diff --git a/DeathSocket/1000x1000.png b/DeathSocket/1000x1000.png deleted file mode 100644 index 8a6dd877b15d1a8aadfdbbf31f42b01976be81fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6132 zcmeAS@N?(olHy`uVBq!ia0y~yV15C@9Be=l-^Ev+04c`eAa^H*b?0PW0y!+{j=qiz z3>*8o|0J>k`J4qFk;M!Qe1}1p@p%4<6b1(IPEQxdkczms*9{pN3WB0J z)_kCb1D1~L3=9nnqvU7^jE2By2#kinXb6mkz-S1JhQMeDjE2By2#kinXb6mkz-S1J vhQMeDjE2By2#kinXb6mk09heWe49N$yWteiS<;GMzK)z4*}Q$iB}7I!mF diff --git a/DeathSocket/DeathSocket.fsproj b/DeathSocket/DeathSocket.fsproj index bb26fcc..3f8cc01 100644 --- a/DeathSocket/DeathSocket.fsproj +++ b/DeathSocket/DeathSocket.fsproj @@ -5,9 +5,7 @@ - - diff --git a/DeathSocket/IO.fs b/DeathSocket/IO.fs deleted file mode 100644 index 5b3461a..0000000 --- a/DeathSocket/IO.fs +++ /dev/null @@ -1,2 +0,0 @@ -module IO - diff --git a/TestCentre/ConsoleTests.fs b/TestCentre/ConsoleTests.fs index 154d8b3..d6b7873 100644 --- a/TestCentre/ConsoleTests.fs +++ b/TestCentre/ConsoleTests.fs @@ -24,7 +24,7 @@ let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea" // File Path - let loadPath = loadLocation + "/LoadTest.png" + let loadPath = loadLocation + "/RequiredInfo/LoadTest.png" let savePath = saveLocation + "/SaveTest.png" (* Brushes converted to string []. diff --git a/TestCentre/LoadingTestArea/AboutLoadingTestArea.txt b/TestCentre/LoadingTestArea/AboutLoadingTestArea.txt deleted file mode 100644 index 6b9a412..0000000 --- a/TestCentre/LoadingTestArea/AboutLoadingTestArea.txt +++ /dev/null @@ -1,3 +0,0 @@ -This folder is the test area for loading images which are used in the Test Centre. -Images in here should not be deleted. -If you create a test which involves loading any pre-determined images (or any other content), please store it in this folder. diff --git a/TestCentre/LoadingTestArea/LoadTest.png b/TestCentre/LoadingTestArea/LoadTest.png deleted file mode 100644 index 8a6dd877b15d1a8aadfdbbf31f42b01976be81fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6132 zcmeAS@N?(olHy`uVBq!ia0y~yV15C@9Be=l-^Ev+04c`eAa^H*b?0PW0y!+{j=qiz z3>*8o|0J>k`J4qFk;M!Qe1}1p@p%4<6b1(IPEQxdkczms*9{pN3WB0J z)_kCb1D1~L3=9nnqvU7^jE2By2#kinXb6mkz-S1JhQMeDjE2By2#kinXb6mkz-S1J vhQMeDjE2By2#kinXb6mk09heWe49N$yWteiS<;GMzK)z4*}Q$iB}7I!mF diff --git a/TestCentre/LoadingTestArea/RequiredInfo/LoadTest.png b/TestCentre/LoadingTestArea/RequiredInfo/LoadTest.png new file mode 100644 index 0000000000000000000000000000000000000000..44f413cb89430fa23d946f87aa276c5af844e1fd GIT binary patch literal 22529 zcmeI4J4?e*0EMr{XQkrg;E>6VZn_GQXp^D!flve~ii+T%q97s^!A%P~yS5HaqS8Mg ztq9^$aTHuC1kph#3gTd*HeR=;&_>}agyzxdkbBO#-@SBuBpMC|x&lIoplRr1LMWDV zv^3dwBI%og{naq9MKmE!_S)X38|~}XWn*Ghi1w^=)Lkqc&I%Dro4Pi>9)HT81r@C$ zdtAIL&P|>_X!UE#TOwy%r@~3KXCq_fODChLq22CZcRnA577F~>l?65A*9J9E!@@Uk z(WHtMUW#+fPNrQdlY!H0`Lp?1^nW5)X>CeV)zEWfp7SXZNV=d`yR{*e{rpA(zC` LFsdI7Ol^GtHgSTU literal 0 HcmV?d00001 diff --git a/TestCentre/SavingTestArea/AboutSavingTestArea.txt b/TestCentre/SavingTestArea/AboutSavingTestArea.txt deleted file mode 100644 index 3f89da6..0000000 --- a/TestCentre/SavingTestArea/AboutSavingTestArea.txt +++ /dev/null @@ -1,2 +0,0 @@ -This folder is the test area for saving the images produced in Test Centre. -When a test produces an image, it should save it in here and conduct any processing on it here also. diff --git a/TestCentre/Script.fsx b/TestCentre/Script.fsx index 0203dea..7c24da5 100644 --- a/TestCentre/Script.fsx +++ b/TestCentre/Script.fsx @@ -8,6 +8,39 @@ open System.Reflection open SmoulderingBeachBall.Domain open SmoulderingBeachBall.Services open System.Threading +open System.IO + +let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea" +let saveLocation = __SOURCE_DIRECTORY__ + "/SavingTestArea" +let random = Random() + +(*Resetting the Testing Area Folders Scripts +=============================================================================== +The following scripts are for when you need to "manually" clear out the +LoadingTestArea and SavingTestArea folders. If you do not want to open up the +folder in Explorer and delete the files that way, just run the scripts in this +section. If you reset the LoadingTestArea, you will need to repopulate it using +the "Populating LoadingTestArea Folder Scripts" below. *) + +let resetSavingTestArea () = + let files = Directory.GetFileSystemEntries(saveLocation, "*.png") + match files.Length with + | 0 -> () + | _ -> + files + |> Array.iter (fun f -> File.Delete(f)) + +let resetLoadingTestArea () = + let files = Directory.GetFileSystemEntries(loadLocation, "*.png") + match files.Length with + | 0 -> () + | _ -> + files + |> Array.iter (fun f -> File.Delete(f)) + +// Run these when the above functions have been added to F# interactive. +resetSavingTestArea () +resetLoadingTestArea () (* Populating LoadingTestArea Folder Scripts =============================================================================== @@ -16,10 +49,6 @@ You can then use these images in LibraryTests.fs -- Property Tests. The tests consists of loading images from LoadingTestArea, transforming them and saving them in SavingTestArea. *) -let saveLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea" - -let random = Random() - let allColours = let properties = typeof.GetProperties(BindingFlags.Public ||| BindingFlags.Static) @@ -42,7 +71,7 @@ let populateSpec sizes = { width = randomSize (sizes) height = randomSize (sizes) colour = (randomBrush ()) :?> Brush - filePath = saveLocation + filePath = loadLocation overlay = None } let generateSpecs amount = diff --git a/TestCentre/TestCentre.fsproj b/TestCentre/TestCentre.fsproj index 2e6f108..095f0ae 100644 --- a/TestCentre/TestCentre.fsproj +++ b/TestCentre/TestCentre.fsproj @@ -45,13 +45,6 @@ - - - PreserveNewest - - - PreserveNewest -