Skip to content
Snippets Groups Projects
Commit a5c16227 authored by Aaron Green's avatar Aaron Green Committed by CQ bot account: commit-bot@chromium.org
Browse files

[fuzzing] Run scripts/fuzzing/test/* as host test.

This CL extends the host test for host fuzzers to also run the python
unit tests for 'fx fuzz'.

Bugs: SEC-170
Test: fx set core.x64 --with //src/fuzzing:tests
      fx run-host-test fuzzing_host_test
Change-Id: Ic2568e5603b34d35a94ebe85161f476f7854c330
parent 8cd5884f
No related branches found
No related tags found
No related merge requests found
......@@ -8,17 +8,17 @@ import("//build/go/go_test.gni")
group("tests") {
testonly = true
public_deps = [
":host_fuzzers_test($host_toolchain)",
":fuzzing_host_test($host_toolchain)",
]
}
go_library("host_fuzzers_test_lib") {
go_library("fuzzing_host_test_lib") {
name = "fuzzing"
}
go_test("host_fuzzers_test") {
go_test("fuzzing_host_test") {
gopackage = "fuzzing"
deps = [
":host_fuzzers_test_lib",
":fuzzing_host_test_lib",
]
}
......@@ -21,6 +21,28 @@ type FuzzSpec struct {
Targets []string `json:"fuzz_targets"`
}
func TestFxFuzzLib(t *testing.T) {
fuchsiaDir, found := os.LookupEnv("FUCHSIA_DIR")
if !found {
t.SkipNow()
}
scriptsFuzzingTests := []string{
"cipd_test.py",
"device_test.py",
"fuzzer_test.py",
"host_test.py",
}
for _, test := range scriptsFuzzingTests {
pytest := path.Join(fuchsiaDir, "scripts", "fuzzing", "test", test)
cmd := exec.Command("python", pytest)
output, err := cmd.CombinedOutput()
if err != nil {
t.Errorf("%s failed:: %v", test, err)
}
t.Log(string(output[:]))
}
}
func TestHostFuzzers(t *testing.T) {
// Search the build directory structure for host variant fuzzer builds.
// This is necessarily sensitive to the layout of the build directory and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment