From efa2c8f41aa5cd2c27990fd9b57ea0eff06976e7 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 21 Dec 2018 11:00:28 -0500 Subject: Feature/remove app context (#765) * Remove AppContext. Use StdChannels to hold writers, and TestToolUtil to hold test tool specific functionality. * StdChannels -> StdWriters * getStdOut -> getOut, getStdError -> getError --- source/core/slang-test-tool-util.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 source/core/slang-test-tool-util.h (limited to 'source/core/slang-test-tool-util.h') diff --git a/source/core/slang-test-tool-util.h b/source/core/slang-test-tool-util.h new file mode 100644 index 000000000..615bbe10d --- /dev/null +++ b/source/core/slang-test-tool-util.h @@ -0,0 +1,25 @@ +#ifndef SLANG_TEST_TOOL_UTIL_H +#define SLANG_TEST_TOOL_UTIL_H + +#include "slang-std-writers.h" + +namespace Slang { + +#ifdef SLANG_SHARED_LIBRARY_TOOL +# define SLANG_TEST_TOOL_API SLANG_EXTERN_C SLANG_DLL_EXPORT +#else +# define SLANG_TEST_TOOL_API +#endif + +/* Utility functions for 'test tools' */ +struct TestToolUtil +{ + typedef SlangResult(*InnerMainFunc)(Slang::StdWriters* stdWriters, SlangSession* session, int argc, const char*const* argv); + + /// Given a slang result, returns a return code that can be returned from an executable + static int getReturnCode(SlangResult res); +}; + +} // namespace Slang + +#endif // SLANG_TEST_TOOL_H -- cgit v1.2.3