diff options
author | Marco Poletti <poletti.marco@gmail.com> | 2016-02-07 09:52:02 +0000 |
---|---|---|
committer | Marco Poletti <poletti.marco@gmail.com> | 2016-02-07 09:52:02 +0000 |
commit | cbe3c7af07dab188cda88a8316f8bd2cbee22839 (patch) | |
tree | 3fe28bcb916282e56a376694d82b68eb76ac4457 /tests/CMakeLists.txt | |
parent | c1f7e1f1bb0d3254e6faf7b303a278506d884fc0 (diff) | |
download | google-fruit-cbe3c7af07dab188cda88a8316f8bd2cbee22839.tar.gz |
Now PartialComponent is parameterized on human-readable binding types, instead of metaprogramming types.
This allows to hide metaprogramming types in template instantiation traces in errors, making them less verbose/confusing.
This change is not fully backwards-compatible; Component no longer inherits from PartialComponent, and createComponent() now returns a PartialComponent.
Even though PartialComponent is implicitly convertible to Component, an explicit cast to Component might be required in some cases.
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fea17e6..2ebd426 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -285,25 +285,21 @@ function(add_test_expected_to_fail_at_compile_time NAME MESSAGE) rm -f \${F} exit 1 fi - # We can't make the errors very concise when they are detected inside Component's constructor. - # This not ideal but it's a known issue (and it's unclear how to prevent that from happening). - if ! cat \${F} | head -n 6 | fgrep -q 'Component<Types>::Component(fruit::PartialComponent<OtherComp>)'; then - # 6 is just a constant that works for both g++ (<=4.8.3) and clang++ (<=3.5.0). It might need to be changed. - if [ \$STATIC_ASSERT_ERROR_LINE -gt 6 ] || [ \$ERROR_TYPE_LINE -gt 6 ]; then - cat \${F} | head -n 6 - rm -f \${F} - echo 'The compilation of ${NAME} failed with the expected message, but the error message contained too many lines before the relevant ones.' - echo \"The error type was reported on line \$ERROR_TYPE_LINE of the message (should be <=6)\" - echo \"The static assert was reported on line \$STATIC_ASSERT_ERROR_LINE of the message (should be <=6)\" - exit 1 - fi - - if cat \${F} | head -n 6 | sed 's/fruit::impl::meta::Error//' | grep -q 'fruit::impl::meta'; then - echo 'The compilation of ${NAME} failed with the expected message, but the error message contained some metaprogramming types in the output (besides Error).' - cat \${F} | head -n 40 - rm -f \${F} - exit 1 - fi + # 6 is just a constant that works for both g++ (<=4.8.3) and clang++ (<=3.5.0). It might need to be changed. + if [ \$STATIC_ASSERT_ERROR_LINE -gt 6 ] || [ \$ERROR_TYPE_LINE -gt 6 ]; then + cat \${F} | head -n 6 + rm -f \${F} + echo 'The compilation of ${NAME} failed with the expected message, but the error message contained too many lines before the relevant ones.' + echo \"The error type was reported on line \$ERROR_TYPE_LINE of the message (should be <=6)\" + echo \"The static assert was reported on line \$STATIC_ASSERT_ERROR_LINE of the message (should be <=6)\" + exit 1 + fi + + if cat \${F} | head -n 6 | grep -q 'fruit::impl::meta'; then + echo 'The compilation of ${NAME} failed with the expected message, but the error message contained some metaprogramming types in the output (besides Error).' + cat \${F} | head -n 40 + rm -f \${F} + exit 1 fi rm -f \${F} ") |