all: add support for Windows

This commit is contained in:
Ayke van Laethem
2019-04-04 15:05:14 +02:00
committed by Ron Evans
parent 8906192690
commit 7369a0e7f2
11 changed files with 157 additions and 28 deletions
+8 -5
View File
@@ -45,11 +45,13 @@ func TestCompiler(t *testing.T) {
}
defer os.RemoveAll(tmpdir)
t.Log("running tests on host...")
for _, path := range matches {
t.Run(path, func(t *testing.T) {
runTest(path, tmpdir, "", t)
})
if runtime.GOOS != "windows" {
t.Log("running tests on host...")
for _, path := range matches {
t.Run(path, func(t *testing.T) {
runTest(path, tmpdir, "", t)
})
}
}
if testing.Short() {
@@ -162,6 +164,7 @@ func runTest(path, tmpdir string, target string, t *testing.T) {
// putchar() prints CRLF, convert it to LF.
actual := bytes.Replace(stdout.Bytes(), []byte{'\r', '\n'}, []byte{'\n'}, -1)
expected = bytes.Replace(expected, []byte{'\r', '\n'}, []byte{'\n'}, -1) // for Windows
// Check whether the command ran successfully.
fail := false