Skip to content

Commit

Permalink
Cleaned up solution
Browse files Browse the repository at this point in the history
Removed more crud from F# project. Added some documentation.

Work done for #196
  • Loading branch information
atruskie committed Mar 13, 2020
1 parent a6117a6 commit 922027d
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 76 deletions.
2 changes: 2 additions & 0 deletions AudioAnalysis.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=ffmpeg/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ffprobe/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=flac/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=FREEBSD/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Musl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pteropus/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Redirector/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -311,6 +312,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Shntool/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=spectrograms/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Splt/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Sqlite/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Subband/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Submatrix/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Anthony/@EntryIndexedValue">True</s:Boolean>
Expand Down
6 changes: 5 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<PropertyGroup>
<Deterministic>true</Deterministic>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)style.ruleset</CodeAnalysisRuleSet>
<DotnetFscCompilerPath></DotnetFscCompilerPath>
<!--<DotnetFscCompilerPath></DotnetFscCompilerPath>-->
<!-- all of these are 64 bit except for linux-arm -->
<RuntimeIdentifiers>win-x64;win-arm64;linux-x64;linux-musl-x64;linux-arm;linux-arm64;osx-x64</RuntimeIdentifiers>
<Deterministic>true</Deterministic>
<!--<DocumentationMode>Diagnose</DocumentationMode>-->
<!--Enable xml documentation output for everything -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">
Expand Down
8 changes: 0 additions & 8 deletions src/AED/AED.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<Name>AED</Name>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
<Tailcalls>false</Tailcalls>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="4.7.0" />
Expand Down
41 changes: 0 additions & 41 deletions src/AED/AssemblyInfo.fs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Acoustics.Shared.FSharp/Acoustics.Shared.FSharp.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@
<Name>Acoustics.Shared.FSharp</Name>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
<Tailcalls>false</Tailcalls>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Accord" Version="3.8.2-alpha" />
<PackageReference Include="Accord.Math" Version="3.8.2-alpha" />
<PackageReference Include="Accord.Statistics" Version="3.8.2-alpha" />
<PackageReference Include="FSharp.Core" Version="4.7.0" />
<PackageReference Include="Microsoft.Bcl.Build" Version="1.0.21" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void TestOfSpectralIndices()
}

/// <summary>
/// Test index calculation when the IndexCalculationDuration= 20 seconds & subsegmentOffsetTimeSpan = 40seconds
/// Test index calculation when the IndexCalculationDuration= 20 seconds &amp; subsegmentOffsetTimeSpan = 40seconds.
/// </summary>
[TestMethod]
public void TestOfSpectralIndices_ICD20()
Expand Down
8 changes: 0 additions & 8 deletions tests/Acoustics.Test/TestHelpers/PathHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@ public static FileInfo GetTestAudioFile(string filename)
return new FileInfo(Path.Combine(TestResources, filename));
}

public static FileInfo GetExe(string exePath)
{
//var resourcesBaseDir = TestHelper.GetResourcesBaseDir();

//return new FileInfo(Path.Combine(exePath, resourcesBaseDir));
return new FileInfo(exePath);
}

public static string GetResourcesBaseDir()
{
return TestResources;
Expand Down
19 changes: 19 additions & 0 deletions tests/Acoustics.Test/TestHelpers/PlatformSpecificTestMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ namespace Acoustics.Test.TestHelpers
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.TestTools.UnitTesting;

/// <summary>
/// Runs a test on a specific platform.
/// </summary>
public class PlatformSpecificTestMethod : TestMethodAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="PlatformSpecificTestMethod"/> class.
/// </summary>
/// <param name="platform">The platform to run the test on.</param>
public PlatformSpecificTestMethod(string platform)
: this(platform, null)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="PlatformSpecificTestMethod"/> class.
/// </summary>
/// <param name="platform">The platform to run the test on.</param>
/// <param name="displayName">The friendly name for this test.</param>
public PlatformSpecificTestMethod(string platform, string displayName)
: base(displayName)
{
Expand All @@ -29,10 +41,17 @@ public PlatformSpecificTestMethod(string platform, string displayName)
};
}

/// <summary>
/// Gets the platform to run the test on.
/// </summary>
public OSPlatform Platform { get; }

/// <summary>
/// Gets or sets an optional reason to add into the test result message.
/// </summary>
public string Reason { get; set; }

/// <inheritdoc />
public override TestResult[] Execute(ITestMethod testMethod)
{
if (!RuntimeInformation.IsOSPlatform(this.Platform))
Expand Down
10 changes: 5 additions & 5 deletions tests/Acoustics.Test/TestHelpers/TestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public static IAudioUtility GetAudioUtility()

public static IAudioUtility GetAudioUtilitySox()
{
var soxExe = PathHelper.GetExe(AppConfigHelper.SoxExe);
var soxExe = new FileInfo(AppConfigHelper.SoxExe);

var sox = new SoxAudioUtility(soxExe);

Expand All @@ -576,8 +576,8 @@ public static IAudioUtility GetAudioUtilitySox()

public static IAudioUtility GetAudioUtilityFfmpeg()
{
var ffmpegExe = PathHelper.GetExe(AppConfigHelper.FfmpegExe);
var ffprobeExe = PathHelper.GetExe(AppConfigHelper.FfprobeExe);
var ffmpegExe = new FileInfo(AppConfigHelper.FfmpegExe);
var ffprobeExe = new FileInfo(AppConfigHelper.FfprobeExe);

var ffmpeg = new FfmpegAudioUtility(ffmpegExe, ffprobeExe);

Expand All @@ -586,7 +586,7 @@ public static IAudioUtility GetAudioUtilityFfmpeg()

public static IAudioUtility GetAudioUtilityFfmpegRawPcm()
{
var ffmpegExe = PathHelper.GetExe(AppConfigHelper.FfmpegExe);
var ffmpegExe = new FileInfo(AppConfigHelper.FfmpegExe);

var ffmpeg = new FfmpegRawPcmAudioUtility(ffmpegExe);

Expand All @@ -595,7 +595,7 @@ public static IAudioUtility GetAudioUtilityFfmpegRawPcm()

public static IAudioUtility GetAudioUtilityWavunpack()
{
var wavunpackExe = PathHelper.GetExe(AppConfigHelper.WvunpackExe);
var wavunpackExe = new FileInfo(AppConfigHelper.WvunpackExe);

var util = new WavPackAudioUtility(wavunpackExe);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void RunUtility(AudioUtilityRequest request)
internal class FfmpegRawPcmAudioUtilityTester : FfmpegRawPcmAudioUtility
{
public FfmpegRawPcmAudioUtilityTester()
: base(PathHelper.GetExe(AppConfigHelper.FfmpegExe), null)
: base(new FileInfo(AppConfigHelper.FfmpegExe), null)
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Acoustics.Test/Tools/SoxUtilityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void SoxCanSegmentWithDifferentLocales(string culture, BandPassType bandP
Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
try
{
var util = new LeakySoxAudioUtility(PathHelper.GetExe(AppConfigHelper.SoxExe));
var util = new LeakySoxAudioUtility(new FileInfo(AppConfigHelper.SoxExe));

var source = TestHelper.GetAudioFile("CaneToad_Gympie_44100.wav");

Expand Down

0 comments on commit 922027d

Please sign in to comment.