return"",fmt.Errorf("Could not find Camlistore repo in ancestors of %q",target)
}
returndir,nil
}
// writeDeps runs closure.GenDeps() on targetDir and writes the resulting dependencies to a temporary file which will be used during the test run. The entries in the deps files are generated with paths relative to baseJS, which should be Closure's base.js file.
return"",fmt.Errorf("Could not create temp js deps file: %v",err)
}
err=ioutil.WriteFile(depsFile.Name(),b,0644)
iferr!=nil{
return"",fmt.Errorf("Could not write js deps file: %v",err)
}
returndepsFile.Name(),nil
}
// TestCwd runs all the tests in the current working directory.
funcTestCwd(t*testing.T){
err:=checkSystemRequirements()
iferr!=nil{
t.Logf("WARNING: JavaScript unit tests could not be run due to a missing system dependency: %v.\nIf you are doing something that might affect JavaScript, you might want to fix this.",err)
t.Log(err)
t.Skip()
}
path,err:=os.Getwd()
iferr!=nil{
t.Fatalf("Could not determine current directory: %v.",err)
}
repoRoot,err:=getRepoRoot(path)
iferr!=nil{
t.Fatalf("Could not find repository root: %v",err)