1616#include < utility>
1717#include < vector>
1818
19+ #ifndef SIMPLECPP_TEST_SOURCE_DIR
20+ #error "SIMPLECPP_TEST_SOURCE_DIR is not defined."
21+ #endif
22+
1923#define STRINGIZE_ (x ) #x
2024#define STRINGIZE (x ) STRINGIZE_(x)
2125
@@ -1556,9 +1560,7 @@ static void has_include_1()
15561560 " #endif\n "
15571561 " #endif" ;
15581562 simplecpp::DUI dui;
1559- #ifdef SIMPLECPP_TEST_SOURCE_DIR
15601563 dui.includePaths .push_back (SIMPLECPP_TEST_SOURCE_DIR);
1561- #endif
15621564 dui.std = " c++17" ;
15631565 ASSERT_EQUALS (" \n\n A" , preprocess (code, dui));
15641566 dui.std = " c++14" ;
@@ -1576,9 +1578,7 @@ static void has_include_2()
15761578 " #endif\n "
15771579 " #endif" ;
15781580 simplecpp::DUI dui;
1579- #ifdef SIMPLECPP_TEST_SOURCE_DIR
15801581 dui.includePaths .push_back (SIMPLECPP_TEST_SOURCE_DIR);
1581- #endif
15821582 dui.std = " c++17" ;
15831583 ASSERT_EQUALS (" \n\n A" , preprocess (code, dui));
15841584 ASSERT_EQUALS (" " , preprocess (code));
@@ -1598,11 +1598,7 @@ static void has_include_3()
15981598 // Test file not found...
15991599 ASSERT_EQUALS (" \n\n\n\n B" , preprocess (code, dui));
16001600 // Unless -I is set (preferably, we should differentiate -I and -isystem...)
1601- #ifdef SIMPLECPP_TEST_SOURCE_DIR
16021601 dui.includePaths .push_back (std::string (SIMPLECPP_TEST_SOURCE_DIR) + " /testsuite" );
1603- #else
1604- dui.includePaths .push_back (" ./testsuite" );
1605- #endif
16061602 ASSERT_EQUALS (" \n\n A" , preprocess (code, dui));
16071603 ASSERT_EQUALS (" " , preprocess (code));
16081604}
@@ -1618,9 +1614,7 @@ static void has_include_4()
16181614 " #endif" ;
16191615 simplecpp::DUI dui;
16201616 dui.std = " c++17" ;
1621- #ifdef SIMPLECPP_TEST_SOURCE_DIR
16221617 dui.includePaths .push_back (SIMPLECPP_TEST_SOURCE_DIR);
1623- #endif
16241618 ASSERT_EQUALS (" \n\n A" , preprocess (code, dui));
16251619 ASSERT_EQUALS (" " , preprocess (code));
16261620}
@@ -1636,9 +1630,7 @@ static void has_include_5()
16361630 " #endif" ;
16371631 simplecpp::DUI dui;
16381632 dui.std = " c++17" ;
1639- #ifdef SIMPLECPP_TEST_SOURCE_DIR
16401633 dui.includePaths .push_back (SIMPLECPP_TEST_SOURCE_DIR);
1641- #endif
16421634 ASSERT_EQUALS (" \n\n A" , preprocess (code, dui));
16431635 ASSERT_EQUALS (" " , preprocess (code));
16441636}
@@ -1654,9 +1646,7 @@ static void has_include_6()
16541646 " #endif" ;
16551647 simplecpp::DUI dui;
16561648 dui.std = " gnu99" ;
1657- #ifdef SIMPLECPP_TEST_SOURCE_DIR
16581649 dui.includePaths .push_back (SIMPLECPP_TEST_SOURCE_DIR);
1659- #endif
16601650 ASSERT_EQUALS (" \n\n A" , preprocess (code, dui));
16611651 ASSERT_EQUALS (" " , preprocess (code));
16621652}
0 commit comments