diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-03-30 18:33:01 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-03-30 18:33:01 +0200 |
commit | 79fbc8bf495770e4a8b7c66c46acf07f4e47e568 (patch) | |
tree | 174c0f3c194013c39a73f6a50ed8866784388c07 /test-cpp.cpp | |
parent | 2eb2383387d16fc919c07e1a6b9211406576b893 (diff) |
Speed up compile
Diffstat (limited to 'test-cpp.cpp')
-rw-r--r-- | test-cpp.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
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; }"); +} + |