Commit 25604baf authored by Laurent Le Brun's avatar Laurent Le Brun
Browse files

Update test directory

+ fix testing in release mode
parent 73dda2b4
......@@ -25,6 +25,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\Debug\Checker.XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
<StartWorkingDirectory>../../..</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -36,6 +37,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\Release\Checker.XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
<StartWorkingDirectory>..\..\..</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
......
......@@ -19,9 +19,9 @@ let testCompile content =
printfn "compilation failed: %s" info
false
let minify content =
Ast.targetOutput <- Ast.Text
content |> main.minify "input" |> Printer.print
let doMinify content =
Ast.targetOutput <- Ast.text()
main.minify("input", content) |> Printer.print
let check (file: string) =
try
......@@ -30,7 +30,7 @@ let check (file: string) =
printfn "Invalid input file '%s'" file
false
else
let minified = minify content + "\n"
let minified = doMinify content + "\n"
if not (testCompile minified) then
printfn "Minification broke the file '%s'" file
printfn "%s" minified
......@@ -43,13 +43,13 @@ let check (file: string) =
false
let inputs = [
@"..\..\..\tests\unit\blocks.frag"
@"..\..\..\tests\unit\hexa.frag"
@"..\..\..\tests\unit\inline.frag"
@"..\..\..\tests\unit\keyword_prefix.frag"
@"..\..\..\tests\unit\commas.frag"
@"..\..\..\tests\unit\numbers.frag"
@"..\..\..\tests\unit\array.frag"
@"tests\unit\blocks.frag"
@"tests\unit\hexa.frag"
@"tests\unit\inline.frag"
@"tests\unit\keyword_prefix.frag"
@"tests\unit\commas.frag"
@"tests\unit\numbers.frag"
@"tests\unit\array.frag"
]
[<EntryPoint>]
......
......@@ -5,6 +5,8 @@ open System.IO
type targetOutput = Text | CHeader | CList | JS | Nasm
let text() = Text
let version = "1.1.6" // Shader Minifer version
let debugMode = false
......
......@@ -52,7 +52,7 @@ let readFile file =
else new StreamReader(file)
stream.ReadToEnd()
let minify filename (content: string) =
let minify(filename, content: string) =
vprintf "Input file size is: %d\n" (content.Length)
let code = Parse.runParser filename content
vprintf "File parsed. "; printSize code
......@@ -72,7 +72,7 @@ let minify filename (content: string) =
let minifyFile file =
let content = readFile file
let filename = if file = "" then "stdin" else file
minify filename content
minify(filename, content)
let run files =
let fail (exn:exn) s =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment