summaryrefslogtreecommitdiff
path: root/tools/slang-test/test-context.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/slang-test/test-context.h')
-rw-r--r--tools/slang-test/test-context.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/slang-test/test-context.h b/tools/slang-test/test-context.h
index a81473efa..cf047cec7 100644
--- a/tools/slang-test/test-context.h
+++ b/tools/slang-test/test-context.h
@@ -1,6 +1,10 @@
// test-context.h
#include "../../source/core/slang-string-util.h"
+#include "../../source/core/platform.h"
+#include "../../source/core/slang-app-context.h"
+#include "../../source/core/dictionary.h"
+
#define SLANG_CHECK(x) TestContext::get()->addResultWithLocation((x), #x, __FILE__, __LINE__);
@@ -54,6 +58,7 @@ enum class TestMessageType
class TestContext
{
public:
+ typedef SlangResult(*InnerMainFunc)(Slang::AppContext* appContext, SlangSession* session, int argc, const char*const* argv);
struct TestInfo
{
@@ -124,6 +129,9 @@ class TestContext
/// Returns true if all run tests succeeded
bool didAllSucceed() const;
+ /// Get the InnerMain function from a shared library tool
+ InnerMainFunc getInnerMainFunc(const Slang::String& dirPath, const Slang::String& name);
+
/// Get the slang session
SlangSession* getSession() const { return m_session; }
@@ -134,7 +142,6 @@ class TestContext
/// Dtor
~TestContext();
-
static TestResult combine(TestResult a, TestResult b) { return (a > b) ? a : b; }
static TestContext* get() { return s_context; }
@@ -155,9 +162,17 @@ class TestContext
bool m_dumpOutputOnFailure;
bool m_isVerbose;
+ bool m_useExes;
+
void outputSummary();
protected:
+ struct SharedLibraryTool
+ {
+ Slang::SharedLibrary::Handle m_sharedLibrary;
+ InnerMainFunc m_func;
+ };
+
void _addResult(const TestInfo& info);
Slang::StringBuilder m_currentMessage;
@@ -168,7 +183,9 @@ protected:
bool m_inTest;
SlangSession* m_session;
-
+
+ Slang::Dictionary<Slang::String, SharedLibraryTool> m_sharedLibTools;
+
static TestContext* s_context;
};