From 79fbc8bf495770e4a8b7c66c46acf07f4e47e568 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 30 Mar 2020 18:33:01 +0200 Subject: Speed up compile --- test-cpp.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'test-cpp.cpp') diff --git a/test-cpp.cpp b/test-cpp.cpp index aabc4f4..8a9b7cb 100644 --- a/test-cpp.cpp +++ b/test-cpp.cpp @@ -24,13 +24,12 @@ class CppTest: public ::testing::Test { protected: CppTest() { - debug = true; + //debug = true; } ~CppTest() { } }; -#if 1 TEST_F(CppTest, preprocessing_tokenize) { CPP cpp; auto pp_tokens = cpp.preprocessing_tokenize("int main() { return 1; }"); @@ -45,7 +44,6 @@ TEST_F(CppTest, preprocessing_tokenize) { ASSERT_EQ(nodes.size(), 44); } -#endif TEST_F(CppTest, preprocessing_tokenize_compile_error) { CPP cpp; @@ -65,8 +63,16 @@ TEST_F(CppTest, preprocessing_tokenize_compile_error) { FAIL() << "Exception expected"; } -#if 0 -TEST(Cpp, translate) { - CPP::translate(); +TEST(Cpp, compile) { + CPP cpp; + + cpp.compile("int main() { return 1 + 1; }"); } -#endif + +TEST(Cpp, compile_2_times) { + CPP cpp; + + cpp.compile("int main() { return (1 + 2) * 2; }"); + cpp.compile("int main() { return 1 + 2 * 2; }"); +} + -- cgit v1.2.3