Add a new integration test framework

I have had this living in a separate branch for now, but we need this in the main branch sooner rather than later.

One big advantage of this is that integration tests can live in any package, not just hugolib.
This commit is contained in:
Bjørn Erik Pedersen
2022-02-09 13:41:04 +01:00
parent 9262719092
commit 64f75adcf6
6 changed files with 477 additions and 1 deletions

View File

@@ -117,6 +117,7 @@ func (h *HugoSites) getContentMaps() *pageMaps {
// Only used in tests.
type testCounters struct {
contentRenderCounter uint64
pageRenderCounter uint64
}
func (h *testCounters) IncrContentRender() {
@@ -126,6 +127,13 @@ func (h *testCounters) IncrContentRender() {
atomic.AddUint64(&h.contentRenderCounter, 1)
}
func (h *testCounters) IncrPageRender() {
if h == nil {
return
}
atomic.AddUint64(&h.pageRenderCounter, 1)
}
type fatalErrorHandler struct {
mu sync.Mutex