Closed balazske closed 6 years ago
fixes #371 (maybe remove the unit test?)
Oh, I see now, the test still fails. Why is there the failure? Since we have a test to demonstrate we do not crash I am ok with removing the disabled test.
Instead of deletion I'd rather change the unittest to reflect what really happens, i.e. a nullptr is returned when the function is imported, right?
This means a new 'testNotImport' function is needed?
@balazske
I think you could just use the ASTImportTestBase
with getTuDecl
and then Import
.
Is it bad to have unit test and lit test for the same problem? (But these test not exactly the same thing.)
@balazske No, that is absolutely not bad at all. Lit tests are rather integration tests, i.e. they are in a higher level in the test pyramid. Lit tests checks the output of the whole program, while in the unit test we test very specific parts only.
updated code
updated code again beginSourceFile is called only once
Phabricator review of a part of the changes: https://reviews.llvm.org/D47445
Phabricator review back-ported in pull request: https://github.com/Ericsson/clang/pull/411
Added a new lit test to test that this is not supported. The warning message could not be printed out in ASTImporterTest, this is corrected. The ImportRecordDeclInFuncParams test still fails but does not crash.