Skip to content

Commit de9d233

Browse files
committed
ENH: Add test outline for Apple framework include handling
This is an outline of a test. The test currently fails. I could not figure out how these tests are working. I would greatly appreciate a little help to understand how to use the test framework.
1 parent ae98755 commit de9d233

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

test.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,32 @@ static void systemInclude()
20842084
ASSERT_EQUALS("", toString(outputList));
20852085
}
20862086

2087+
#if 0 // Disabled until the test can be written properly
2088+
#ifdef __APPLE__
2089+
static void appleFrameworkIncludeTest()
2090+
{
2091+
// This test is for the Apple framework include handling.
2092+
// If -I /Library/Developer/CommandLineTools/SDKs/MacOSX14.5.sdk/System/Library/Frameworks
2093+
// then:
2094+
const char code[] = "#include <Foundation/Foundation.h>\n";
2095+
// should find the include file:
2096+
// /Library/Developer/CommandLineTools/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
2097+
std::vector<std::string> files;
2098+
const simplecpp::TokenList rawtokens = makeTokenList(code,files,"sourcecode.cpp");
2099+
simplecpp::FileDataCache cache;
2100+
cache.insert({"Foundation/Foundation.h", simplecpp::TokenList(files)});
2101+
2102+
simplecpp::TokenList tokens2(files);
2103+
simplecpp::DUI dui;
2104+
dui.includePaths.push_back("/Library/Developer/CommandLineTools/SDKs/MacOSX14.5.sdk/System/Library/Frameworks");
2105+
2106+
simplecpp::OutputList outputList;
2107+
simplecpp::preprocess(tokens2, rawtokens, files, cache, dui, &outputList);
2108+
ASSERT_EQUALS("", toString(outputList));
2109+
}
2110+
#endif
2111+
#endif
2112+
20872113
static void multiline1()
20882114
{
20892115
const char code[] = "#define A \\\n"
@@ -3388,6 +3414,11 @@ int main(int argc, char **argv)
33883414
TEST_CASE(preprocess_files);
33893415

33903416
TEST_CASE(fuzz_crash);
3391-
3417+
#if 0 // Disabled until the test can be written properly
3418+
#ifdef __APPLE__
3419+
// Apple-specific test cases
3420+
TEST_CASE(appleFrameworkIncludeTest);
3421+
#endif
3422+
#endif
33923423
return numberOfFailedAssertions > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
33933424
}

0 commit comments

Comments
 (0)