Change --disable-actor-without-wait-warning to --disable-diagnostics

We probably just want to disable all actor diagnostics for the flow test
files.

Also add --generate-probes to the help text
This commit is contained in:
Andrew Noyes 2019-08-09 13:43:02 -07:00
parent 4b97a7506d
commit a8cdcff0c2
4 changed files with 13 additions and 13 deletions

View File

@ -149,7 +149,7 @@ function(add_flow_target)
set(options EXECUTABLE STATIC_LIBRARY
DYNAMIC_LIBRARY)
set(oneValueArgs NAME)
set(multiValueArgs SRCS COVERAGE_FILTER_OUT DISABLE_ACTOR_WITHOUT_WAIT_WARNING ADDL_SRCS)
set(multiValueArgs SRCS COVERAGE_FILTER_OUT DISABLE_ACTOR_DIAGNOSTICS ADDL_SRCS)
cmake_parse_arguments(AFT "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
if(NOT AFT_NAME)
message(FATAL_ERROR "add_flow_target requires option NAME")
@ -158,10 +158,10 @@ function(add_flow_target)
message(FATAL_ERROR "No sources provided")
endif()
if(OPEN_FOR_IDE)
set(sources ${AFT_SRCS} ${AFT_DISABLE_ACTOR_WITHOUT_WAIT_WARNING} ${AFT_ADDL_SRCS})
set(sources ${AFT_SRCS} ${AFT_DISABLE_ACTOR_DIAGNOSTICS} ${AFT_ADDL_SRCS})
add_library(${AFT_NAME} OBJECT ${sources})
else()
foreach(src IN LISTS AFT_SRCS AFT_DISABLE_ACTOR_WITHOUT_WAIT_WARNING)
foreach(src IN LISTS AFT_SRCS AFT_DISABLE_ACTOR_DIAGNOSTICS)
set(actor_compiler_flags "")
if(${src} MATCHES ".*\\.actor\\.(h|cpp)")
list(APPEND actors ${src})
@ -171,9 +171,9 @@ function(add_flow_target)
else()
string(REPLACE ".actor.cpp" ".actor.g.cpp" generated ${src})
endif()
foreach(s IN LISTS AFT_DISABLE_ACTOR_WITHOUT_WAIT_WARNING)
foreach(s IN LISTS AFT_DISABLE_ACTOR_DIAGNOSTICS)
if("${s}" STREQUAL "${src}")
list(APPEND actor_compiler_flags "--disable-actor-without-wait-warning")
list(APPEND actor_compiler_flags "--disable-diagnostics")
break()
endif()
endforeach()

View File

@ -62,14 +62,14 @@ if(USE_VALGRIND)
target_link_libraries(thirdparty PUBLIC Valgrind)
endif()
set(FDBRPC_SRCS_DISABLE_ACTOR_WITHOUT_WAIT_WARNING
set(FDBRPC_SRCS_DISABLE_ACTOR_DIAGNOSTICS
ActorFuzz.actor.cpp
FlowTests.actor.cpp
dsltest.actor.cpp)
add_flow_target(STATIC_LIBRARY NAME fdbrpc
SRCS ${FDBRPC_SRCS}
DISABLE_ACTOR_WITHOUT_WAIT_WARNING ${FDBRPC_SRCS_DISABLE_ACTOR_WITHOUT_WAIT_WARNING})
DISABLE_ACTOR_DIAGNOSTICS ${FDBRPC_SRCS_DISABLE_ACTOR_DIAGNOSTICS})
target_include_directories(fdbrpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libeio)
target_link_libraries(fdbrpc PRIVATE thirdparty)
target_link_libraries(fdbrpc PUBLIC flow)

View File

@ -38,17 +38,17 @@ namespace actorcompiler
class ErrorMessagePolicy
{
public bool DisableActorWithoutWaitWarning = false;
public bool DisableDiagnostics = false;
public void HandleActorWithoutWait(String sourceFile, Actor actor)
{
if (!DisableActorWithoutWaitWarning && !actor.isTestCase)
if (!DisableDiagnostics && !actor.isTestCase)
{
// TODO(atn34): Once cmake is the only build system we can make this an error instead of a warning.
Console.Error.WriteLine("{0}:{1}: warning: ACTOR {2} does not contain a wait() statement", sourceFile, actor.SourceLine, actor.name);
}
}
public bool ActorsNoDiscardByDefault() {
return !DisableActorWithoutWaitWarning;
return !DisableDiagnostics;
}
}

View File

@ -34,7 +34,7 @@ namespace actorcompiler
if (args.Length < 2)
{
Console.WriteLine("Usage:");
Console.WriteLine(" actorcompiler <input> <output> [--disable-actor-without-wait-warning]");
Console.WriteLine(" actorcompiler <input> <output> [--disable-diagnostics] [--generate-probes]");
return 100;
}
Console.WriteLine("actorcompiler {0}", string.Join(" ", args));
@ -42,8 +42,8 @@ namespace actorcompiler
ErrorMessagePolicy errorMessagePolicy = new ErrorMessagePolicy();
foreach (var arg in args) {
if (arg.StartsWith("--")) {
if (arg.Equals("--disable-actor-without-wait-warning")) {
errorMessagePolicy.DisableActorWithoutWaitWarning = true;
if (arg.Equals("--disable-diagnostics")) {
errorMessagePolicy.DisableDiagnostics = true;
} else if (arg.Equals("--generate-probes")) {
generateProbes = true;
}