Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
Shader_Minifier
Commits
fe54157e
Commit
fe54157e
authored
Apr 25, 2017
by
Eldritch Conundrum
Browse files
fix handling of whitespaces in test filenames
parent
16e1c7bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tests.fs
View file @
fe54157e
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment