[Pkg-cli-apps-commits] [fsharp] 47/60: Minor tweak to the PR and add some extra tests

Christopher Halse Rogers raof-guest at moszumanska.debian.org
Sun Sep 14 08:13:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

raof-guest pushed a commit to branch master
in repository fsharp.

commit 81a8ead21e49b40559b694e2a9e86e1892a02f83
Author: KevinRansom <codecutter at hotmail.com>
Date:   Thu Aug 28 10:47:02 2014 -0700

    Minor tweak to the PR and add some extra tests
---
 src/fsharp/fsc.fs                                           | 10 +++++-----
 .../CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs  | 13 +++++++++++++
 .../CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs  | 11 +++++++++++
 .../CustomAttributes/AttributeUsage/env.lst                 |  4 +++-
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs
index fa222b4..1c1e783 100644
--- a/src/fsharp/fsc.fs
+++ b/src/fsharp/fsc.fs
@@ -994,12 +994,12 @@ module AttributeHelpers =
         | _ -> None
 
     // Try to find an AssemblyVersion attribute 
-    let TryFindVersionAttribute tcGlobals attrib attribs =
+    let TryFindVersionAttribute tcGlobals attrib attribName attribs =
         match TryFindStringAttribute tcGlobals attrib attribs with
         | Some versionString ->
              try Some(IL.parseILVersion versionString)
              with e -> 
-                 warning(Error(FSComp.SR.fscBadAssemblyVersion(attrib, versionString),Range.rangeStartup));
+                 warning(Error(FSComp.SR.fscBadAssemblyVersion(attribName, versionString),Range.rangeStartup));
                  None
         | _ -> None
 
@@ -1183,12 +1183,12 @@ module MainModuleBuilder =
                     | _ -> []
 
                 let fileVersion = 
-                    match AttributeHelpers.TryFindVersionAttribute tcGlobals "System.Reflection.AssemblyFileVersionAttribute" topAttrs.assemblyAttrs with
+                    match AttributeHelpers.TryFindVersionAttribute tcGlobals "System.Reflection.AssemblyFileVersionAttribute" "AssemblyFileVersionAttribute" topAttrs.assemblyAttrs with
                     | Some v -> v
                     | None -> assemblyVersion
 
                 let productVersion = 
-                    match AttributeHelpers.TryFindVersionAttribute tcGlobals "System.Reflection.AssemblyInformationalVersionAttribute" topAttrs.assemblyAttrs with
+                    match AttributeHelpers.TryFindVersionAttribute tcGlobals "System.Reflection.AssemblyInformationalVersionAttribute" "AssemblyInformationalVersionAttribute" topAttrs.assemblyAttrs with
                     | Some v -> v
                     | None -> assemblyVersion
 
@@ -1937,7 +1937,7 @@ let main1(tcGlobals,tcImports : TcImports,frameworkTcImports,generatedCcu,typedA
 
     // Try to find an AssemblyVersion attribute 
     let assemVerFromAttrib = 
-        match AttributeHelpers.TryFindVersionAttribute tcGlobals "System.Reflection.AssemblyVersionAttribute" topAttrs.assemblyAttrs with
+        match AttributeHelpers.TryFindVersionAttribute tcGlobals "System.Reflection.AssemblyVersionAttribute" "AssemblyVersionAttribute" topAttrs.assemblyAttrs with
         | Some v -> 
            match tcConfig.version with 
            | VersionNone -> Some v
diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs
new file mode 100644
index 0000000..ca70019
--- /dev/null
+++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs
@@ -0,0 +1,13 @@
+// #Regression #Conformance #DeclarationElements #Attributes 
+//<Expects id="FS2003" status="warning">An AssemblyInformationalVersionAttribute specified version '6\.5\.4\.3\.2', but this value is invalid and has been ignored</Expects>
+//<Expects id="FS2003" status="warning">An AssemblyFileVersionAttribute specified version '9\.8\.7\.6\.5', but this value is invalid and has been ignored</Expects>
+
+[<assembly:System.Reflection.AssemblyVersion("1.2.3.4")>]
+[<assembly:System.Reflection.AssemblyInformationalVersion("6.5.4.3.2")>]
+[<assembly:System.Reflection.AssemblyFileVersion("9.8.7.6.5")>]
+do 
+    ()
+
+let asm = System.Reflection.Assembly.GetExecutingAssembly().GetName()
+
+exit 0
\ No newline at end of file
diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs
new file mode 100644
index 0000000..e4871dc
--- /dev/null
+++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs
@@ -0,0 +1,11 @@
+// #Regression #Conformance #DeclarationElements #Attributes 
+//<Expects id="FS2003" status="warning">An AssemblyInformationalVersionAttribute specified version '6\.5\.\*\.3', but this value is invalid and has been ignored</Expects>
+//<Expects id="FS2003" status="warning">An AssemblyFileVersionAttribute specified version '9\.8\.\*\.6', but this value is invalid and has been ignored</Expects>
+
+[<assembly:System.Reflection.AssemblyVersion("1.2.3.4")>]
+[<assembly:System.Reflection.AssemblyInformationalVersion("6.5.*.3")>]
+[<assembly:System.Reflection.AssemblyFileVersionAttribute("9.8.*.6")>]
+do 
+    ()
+
+exit 0
\ No newline at end of file
diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/env.lst b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/env.lst
index 6a65c06..18d4f28 100644
--- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/env.lst
+++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/env.lst
@@ -19,4 +19,6 @@
 	SOURCE=AssemblyVersion03.fs							# AssemblyVersion03.fs
 	SOURCE=AssemblyVersion04.fs							# AssemblyVersion04.fs
 	SOURCE=W_AssemblyVersion01.fs SCFLAGS="--test:ErrorRanges"	# W_AssemblyVersion01.fs
-	SOURCE=W_AssemblyVersion02.fs SCFLAGS="--test:ErrorRanges"	# W_AssemblyVersion02.fs
\ No newline at end of file
+	SOURCE=W_AssemblyVersion02.fs SCFLAGS="--test:ErrorRanges"	# W_AssemblyVersion02.fs
+	SOURCE=X_AssemblyVersion01.fs SCFLAGS="--test:ErrorRanges"	# X_AssemblyVersion01.fs
+	SOURCE=X_AssemblyVersion02.fs SCFLAGS="--test:ErrorRanges"	# X_AssemblyVersion02.fs
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cli-apps/packages/fsharp.git



More information about the Pkg-cli-apps-commits mailing list