llvm/clang/unittests/Basic/SarifTest.cpp

//===- unittests/Basic/SarifTest.cpp - Test writing SARIF documents -------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "clang/Basic/Sarif.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

#include <algorithm>

usingnamespaceclang;

namespace {

LineCol;

static std::string serializeSarifDocument(llvm::json::Object &&Doc) {}

class SarifDocumentWriterTest : public ::testing::Test {};

TEST_F(SarifDocumentWriterTest, canCreateEmptyDocument) {}

// Test that a newly inserted run will associate correct tool names
TEST_F(SarifDocumentWriterTest, canCreateDocumentWithOneRun) {}

TEST_F(SarifDocumentWriterTest, addingResultsWillCrashIfThereIsNoRun) {}

TEST_F(SarifDocumentWriterTest, settingInvalidRankWillCrash) {}

TEST_F(SarifDocumentWriterTest, creatingResultWithDisabledRuleWillCrash) {}

// Test adding rule and result shows up in the final document
TEST_F(SarifDocumentWriterTest, addingResultWithValidRuleAndRunIsOk) {}

TEST_F(SarifDocumentWriterTest, checkSerializingResultsWithDefaultRuleConfig) {}

TEST_F(SarifDocumentWriterTest, checkSerializingResultsWithCustomRuleConfig) {}

// Check that serializing artifacts from results produces valid SARIF
TEST_F(SarifDocumentWriterTest, checkSerializingArtifacts) {}

TEST_F(SarifDocumentWriterTest, checkSerializingCodeflows) {}

} // namespace