From 1011655d2ef76a0c0aa29dbbff091dab139198e3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 24 Oct 2020 16:32:18 +0200 Subject: Add FlowGraph --- tests/test-cppbnf.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/test-cppbnf.cpp (limited to 'tests/test-cppbnf.cpp') diff --git a/tests/test-cppbnf.cpp b/tests/test-cppbnf.cpp new file mode 100644 index 0000000..e365574 --- /dev/null +++ b/tests/test-cppbnf.cpp @@ -0,0 +1,45 @@ +#include "bnf.h" +#include "cpp.h" +#include "cppbnf.h" +#include "lexer.h" +#include "grammer.h" +#include "minicc.h" +#include "debug.h" + +#include + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +class CppBnfTest: public ::testing::Test +{ +protected: + CppBnfTest() { + //debug = true; + } + ~CppBnfTest() { + } +}; + +TEST_F(CppBnfTest, LexicalBnf) { + auto bnf = SubBNF(CPPBNF::GetCppBNFLex(), "preprocessing-token"); + + EXPECT_TRUE(CPPBNF::valid(bnf)); + EXPECT_TRUE(CPPBNF::validLex(bnf)); +} + +TEST_F(CppBnfTest, GrammarBnf) { + auto bnf = SubBNF(CPPBNF::GetCppBNFGram(), "translation-unit"); + + EXPECT_TRUE(CPPBNF::valid(bnf)); +} + -- cgit v1.2.3