-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
124 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
load("//lang/cc:defs.bzl", "cc_build_error") | ||
load("//matcher:defs.bzl", "matcher") | ||
|
||
cc_build_error( | ||
name = "plain", | ||
src = "cpp_successful_build.cpp", | ||
tags = ["manual"], | ||
) | ||
|
||
cc_build_error( | ||
name = "with_substr_matcher", | ||
src = "cpp_successful_build.cpp", | ||
compile_stderr = matcher.has_substr("for cpp_successful_build.cpp"), | ||
tags = ["manual"], | ||
) | ||
|
||
cc_build_error( | ||
name = "with_basic_regex_matcher", | ||
src = "cpp_successful_build.cpp", | ||
compile_stderr = matcher.contains_basic_regex(r"for[[:space:]]cpp_successful_build\.\(cpp\|cxx\)"), | ||
tags = ["manual"], | ||
) | ||
|
||
cc_build_error( | ||
name = "with_extended_regex_matcher", | ||
src = "cpp_successful_build.cpp", | ||
compile_stderr = matcher.contains_extended_regex(r"for[[:space:]]cpp_successful_build\.(cpp|cxx)"), | ||
tags = ["manual"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
int main() | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
load("//lang/cc:defs.bzl", "cc_build_error") | ||
load("//matcher:defs.bzl", "matcher") | ||
|
||
cc_library( | ||
name = "library", | ||
srcs = ["library.cpp"], | ||
hdrs = ["library.hpp"], | ||
tags = ["manual"], | ||
) | ||
|
||
cc_build_error( | ||
name = "plain", | ||
src = "cpp_compile_error.cpp", | ||
tags = ["manual"], | ||
deps = [":library"], | ||
) | ||
|
||
cc_build_error( | ||
name = "with_substr_matcher", | ||
src = "cpp_compile_error.cpp", | ||
compile_stderr = matcher.has_substr("requires single argument"), | ||
tags = ["manual"], | ||
deps = [":library"], | ||
) | ||
|
||
cc_build_error( | ||
name = "with_basic_regex_matcher", | ||
src = "cpp_compile_error.cpp", | ||
compile_stderr = matcher.contains_basic_regex("requires single argument.*argument"), | ||
tags = ["manual"], | ||
deps = [":library"], | ||
) | ||
|
||
cc_build_error( | ||
name = "with_extended_regex_matcher", | ||
src = "cpp_compile_error.cpp", | ||
compile_stderr = matcher.contains_extended_regex("requires single argument.*argument"), | ||
tags = ["manual"], | ||
deps = [":library"], | ||
) |
6 changes: 6 additions & 0 deletions
6
tests/cc/cpp_successful_build_with_deps/cpp_compile_error.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "library.hpp" | ||
|
||
int main() | ||
{ | ||
return NormalFunction(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "library.hpp" | ||
|
||
int NormalFunction(int value) | ||
{ | ||
return 123 + value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef TESTS_CC_CPP_SUCCESSFUL_BUILD_WITH_DEPS_ASSERTION_HPP_ | ||
#define TESTS_CC_CPP_SUCCESSFUL_BUILD_WITH_DEPS_ASSERTION_HPP_ | ||
|
||
int NormalFunction(int value); | ||
|
||
#endif // TESTS_CC_CPP_SUCCESSFUL_BUILD_WITH_DEPS_ASSERTION_HPP_ |