-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to get compile-failure tests working
- Loading branch information
1 parent
7dafc0f
commit 15fb92a
Showing
4 changed files
with
85 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/icm_build_failure_parse_and_run.cmake b/icm_build_failure_parse_and_run.cmake | ||
index 0e62f6c..2ea5f0a 100644 | ||
--- a/icm_build_failure_parse_and_run.cmake | ||
+++ b/icm_build_failure_parse_and_run.cmake | ||
@@ -29,14 +29,15 @@ endif() | ||
|
||
# collect possible errors from source | ||
file(READ "@parsedSourcePath@" sourceText) | ||
+ | ||
string(REGEX MATCHALL "//[ ]*build error:[^\n]+" matchErrors ${sourceText}) | ||
|
||
# look for collected errors in output | ||
foreach(possibleError ${matchErrors}) | ||
string(REGEX MATCH "//[ ]*build error:[ \t]*(.+)$" _ "${possibleError}") | ||
set(possibleError "${CMAKE_MATCH_1}") | ||
- string(FIND "${out}" "${possibleError}" pos) | ||
- if(NOT pos EQUAL -1) | ||
+ string(REGEX MATCH "${possibleError}" actualError "${out}") | ||
+ if(NOT "${actualError}" STREQUAL "") | ||
message("Success: output when building '@ARG_TARGET@' contains '${possibleError}'") | ||
return() | ||
endif() | ||
@@ -48,4 +49,4 @@ endforeach() | ||
# print execute_process output for debugging purposes | ||
message("${out}") | ||
# print error | ||
-message(FATAL_ERROR "Error: Building '@ARG_TARGET@' failed, but output doesn't contain any of the expected errors:${outErrors}") | ||
+message(FATAL_ERROR "Error: Building '@ARG_TARGET@' failed, but output doesn't match the expected errors:${outErrors}") |
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,25 @@ | ||
/* | ||
* Copyright (c) 2023 NVIDIA Corporation | ||
* | ||
* Licensed under the Apache License Version 2.0 with LLVM Exceptions | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* https://llvm.org/LICENSE.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <stdexec/execution.hpp> | ||
|
||
namespace ex = stdexec; | ||
|
||
int main() { | ||
ex::sender auto snd = ex::just(42) | ex::then([](int*){}); | ||
// build error: _NOT_CALLABLE_.*_WITH_FUNCTION_.*_WITH_ARGUMENTS_<int> | ||
stdexec::sync_wait(std::move(snd)); | ||
} |