Exemplo n.º 1
0
func bareTestRun(t *testing.T, input string, N int) (out string, e error) {
	bs, es, _ := CompileBareFunc("main.g", input)
	if es != nil {
		t.Log(input)
		for _, e := range es {
			t.Log(e)
		}
		t.Error("compile failed")
		return "", errRunFailed
	}

	ncycle, out, e := arch8.RunImageOutput(bs, N)
	if ncycle == N {
		t.Log(input)
		t.Error("running out of time")
		return "", errRunFailed
	}
	return out, e
}
Exemplo n.º 2
0
func multiTestRun(t *testing.T, fs map[string]string, N int) (
	string, error,
) {
	bs, es, _ := buildMulti(fs)
	if es != nil {
		t.Log(fs)
		for _, err := range es {
			t.Log(err)
		}
		t.Error("compile failed")
		return "", errRunFailed
	}

	ncycle, out, err := arch8.RunImageOutput(bs, N)
	if ncycle == N {
		t.Log(fs)
		t.Error("running out of time")
		return "", errRunFailed
	}
	return out, err
}