Commit fe54157e authored by Eldritch Conundrum's avatar Eldritch Conundrum
Browse files

fix handling of whitespaces in test filenames

parent 16e1c7bd
......@@ -4,16 +4,21 @@ open System
open System.IO
open System.Diagnostics
let binaryFilename = "./shader_minifier.exe"
let outFilename = Path.Combine(Path.GetTempPath(), "shader_code.h")
let testFiles = Directory.GetFiles("tests/", "*.*", SearchOption.AllDirectories)
let quoteArgs = fun s -> "\"" + s + "\""
let () =
if not(File.Exists(binaryFilename)) then
printfn "You need to compile %s first!" binaryFilename
exit 1
let stopwatch = Stopwatch.StartNew()
printfn "Running %i tests..." (testFiles.Length)
let failedTestCount = ref 0
for filename in testFiles do
let p = Process.Start("./shader_minifier.exe",
String.concat " " [ filename; "-o"; outFilename ])
let p = Process.Start(binaryFilename,
String.concat " " (List.map quoteArgs [ filename; "-o"; outFilename ]))
p.WaitForExit()
if p.ExitCode <> 0 then
printfn "*** error while testing %s: program returned %i" filename p.ExitCode
......
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