aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorKhaled Yakdan2023-01-08 23:30:14 -0800
committerGitHub2023-01-09 15:30:14 +0800
commitdbfc5aa0165ca550cb24dc6113a124d8e730aa3c (patch)
treee4208e71d4ffcb89e4b2eeba1cd3cdf02483af88 /tools
parent9e94346529e1b03d5d1de1604dad88c15b4131ef (diff)
Move fuzz tests into tests/fuzz (#22376)
This puts the fuzz tests in the same directory as other tests and eases the integration in OSS-Fuzz Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/fuzz_test.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/tools/fuzz_test.go b/tools/fuzz_test.go
deleted file mode 100644
index 106ed19a4..000000000
--- a/tools/fuzz_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2023 The Gitea Authors. All rights reserved.
-// SPDX-License-Identifier: MIT
-
-package main
-
-import (
- "bytes"
- "context"
- "io"
- "testing"
-
- "code.gitea.io/gitea/modules/markup"
- "code.gitea.io/gitea/modules/markup/markdown"
- "code.gitea.io/gitea/modules/setting"
-)
-
-var renderContext = markup.RenderContext{
- Ctx: context.Background(),
- URLPrefix: "https://example.com/go-gitea/gitea",
- Metas: map[string]string{
- "user": "go-gitea",
- "repo": "gitea",
- },
-}
-
-func FuzzMarkdownRenderRaw(f *testing.F) {
- f.Fuzz(func(t *testing.T, data []byte) {
- setting.AppURL = "http://localhost:3000/"
- markdown.RenderRaw(&renderContext, bytes.NewReader(data), io.Discard)
- })
-}
-
-func FuzzMarkupPostProcess(f *testing.F) {
- f.Fuzz(func(t *testing.T, data []byte) {
- setting.AppURL = "http://localhost:3000/"
- markup.PostProcess(&renderContext, bytes.NewReader(data), io.Discard)
- })
-}