summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/render-test/slang-support.cpp1
-rw-r--r--tools/slang-test/slang-test-main.cpp58
-rw-r--r--tools/slang-test/test-context.cpp16
-rw-r--r--tools/slang-test/test-context.h10
4 files changed, 45 insertions, 40 deletions
diff --git a/tools/render-test/slang-support.cpp b/tools/render-test/slang-support.cpp
index 9a7c13d7a..37c9b1036 100644
--- a/tools/render-test/slang-support.cpp
+++ b/tools/render-test/slang-support.cpp
@@ -158,6 +158,7 @@ static const char computeEntryPointName[] = "computeMain";
SLANG_RETURN_ON_FAIL(res);
// We are going to get the entry point count... lets check what we have
+ if (input.passThrough == SLANG_PASS_THROUGH_NONE)
{
auto reflection = spGetReflection(slangRequest);
// Get the amount of entry points in reflection
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index e0474ebe6..51c3ecea9 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -19,7 +19,7 @@ using namespace Slang;
#include "options.h"
#include "slangc-tool.h"
-#include "../../source/core/slang-cpp-compiler.h"
+#include "../../source/core/slang-downstream-compiler.h"
#include "../../source/core/slang-process-util.h"
@@ -1257,13 +1257,13 @@ String getExpectedOutput(String const& outputStem)
return expectedOutput;
}
-static String _calcSummary(const CPPCompiler::Output& inOutput)
+static String _calcSummary(const DownstreamDiagnostics& inOutput)
{
- CPPCompiler::Output output(inOutput);
+ DownstreamDiagnostics output(inOutput);
// We only want to analyse errors for now
- output.removeByType(CPPCompiler::Diagnostic::Type::Info);
- output.removeByType(CPPCompiler::Diagnostic::Type::Warning);
+ output.removeByType(DownstreamDiagnostics::Diagnostic::Type::Info);
+ output.removeByType(DownstreamDiagnostics::Diagnostic::Type::Warning);
StringBuilder builder;
@@ -1280,9 +1280,9 @@ static String _calcModulePath(const TestInput& input)
return Path::combine(directory, moduleName);
}
-static TestResult runCPPCompilerCompile(TestContext* context, TestInput& input)
+static TestResult runCompilerCompile(TestContext* context, TestInput& input)
{
- CPPCompiler* compiler = context->getDefaultCPPCompiler();
+ DownstreamCompiler* compiler = context->getDefaultCompiler();
if (!compiler)
{
return TestResult::Ignored;
@@ -1322,9 +1322,9 @@ static TestResult runCPPCompilerCompile(TestContext* context, TestInput& input)
return TestResult::Pass;
}
-static TestResult runCPPCompilerSharedLibrary(TestContext* context, TestInput& input)
+static TestResult runCompilerSharedLibrary(TestContext* context, TestInput& input)
{
- CPPCompiler* compiler = context->getDefaultCPPCompiler();
+ DownstreamCompiler* compiler = context->getDefaultCompiler();
if (!compiler)
{
return TestResult::Ignored;
@@ -1352,12 +1352,12 @@ static TestResult runCPPCompilerSharedLibrary(TestContext* context, TestInput& i
File::remove(sharedLibraryPath);
// Set up the compilation options
- CPPCompiler::CompileOptions options;
+ DownstreamCompiler::CompileOptions options;
- options.sourceType = (ext == "c") ? CPPCompiler::SourceType::C : CPPCompiler::SourceType::CPP;
+ options.sourceType = (ext == "c") ? DownstreamCompiler::SourceType::C : DownstreamCompiler::SourceType::CPP;
// Build a shared library
- options.targetType = CPPCompiler::TargetType::SharedLibrary;
+ options.targetType = DownstreamCompiler::TargetType::SharedLibrary;
// Compile this source
options.sourceFiles.add(filePath);
@@ -1365,16 +1365,18 @@ static TestResult runCPPCompilerSharedLibrary(TestContext* context, TestInput& i
options.includePaths.add(".");
- CPPCompiler::Output output;
- if (SLANG_FAILED(compiler->compile(options, output)))
+ RefPtr<DownstreamCompileResult> compileResult;
+ if (SLANG_FAILED(compiler->compile(options, compileResult)))
{
return TestResult::Fail;
}
- if (SLANG_FAILED(output.result))
+ const auto& diagnostics = compileResult->getDiagnostics();
+
+ if (SLANG_FAILED(diagnostics.result))
{
// Compilation failed
- String actualOutput = _calcSummary(output);
+ String actualOutput = _calcSummary(diagnostics);
// Write the output
Slang::File::writeAllText(actualOutputPath, actualOutput);
@@ -1438,9 +1440,9 @@ static TestResult runCPPCompilerSharedLibrary(TestContext* context, TestInput& i
return TestResult::Pass;
}
-static TestResult runCPPCompilerExecute(TestContext* context, TestInput& input)
+static TestResult runCompilerExecute(TestContext* context, TestInput& input)
{
- CPPCompiler* compiler = context->getDefaultCPPCompiler();
+ DownstreamCompiler* compiler = context->getDefaultCompiler();
if (!compiler)
{
return TestResult::Ignored;
@@ -1472,26 +1474,28 @@ static TestResult runCPPCompilerExecute(TestContext* context, TestInput& input)
}
// Set up the compilation options
- CPPCompiler::CompileOptions options;
+ DownstreamCompiler::CompileOptions options;
- options.sourceType = (ext == "c") ? CPPCompiler::SourceType::C : CPPCompiler::SourceType::CPP;
+ options.sourceType = (ext == "c") ? DownstreamCompiler::SourceType::C : DownstreamCompiler::SourceType::CPP;
// Compile this source
options.sourceFiles.add(filePath);
options.modulePath = modulePath;
- CPPCompiler::Output output;
- if (SLANG_FAILED(compiler->compile(options, output)))
+ RefPtr<DownstreamCompileResult> compileResult;
+ if (SLANG_FAILED(compiler->compile(options, compileResult)))
{
return TestResult::Fail;
}
String actualOutput;
+ const auto& diagnostics = compileResult->getDiagnostics();
+
// If the actual compilation failed, then the output will be
- if (SLANG_FAILED(output.result))
+ if (SLANG_FAILED(diagnostics.result))
{
- actualOutput = _calcSummary(output);
+ actualOutput = _calcSummary(diagnostics);
}
else
{
@@ -2438,9 +2442,9 @@ static const TestCommandInfo s_testCommandInfos[] =
{ "COMPARE_RENDER_COMPUTE", &runSlangRenderComputeComparisonTest},
{ "COMPARE_GLSL", &runGLSLComparisonTest},
{ "CROSS_COMPILE", &runCrossCompilerTest},
- { "CPP_COMPILER_EXECUTE", &runCPPCompilerExecute},
- { "CPP_COMPILER_SHARED_LIBRARY", &runCPPCompilerSharedLibrary},
- { "CPP_COMPILER_COMPILE", &runCPPCompilerCompile},
+ { "CPP_COMPILER_EXECUTE", &runCompilerExecute},
+ { "CPP_COMPILER_SHARED_LIBRARY", &runCompilerSharedLibrary},
+ { "CPP_COMPILER_COMPILE", &runCompilerCompile},
{ "PERFORMANCE_PROFILE", &runPerformanceProfile},
{ "COMPILE", &runCompile},
};
diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp
index fe9bdbc0e..c37261b61 100644
--- a/tools/slang-test/test-context.cpp
+++ b/tools/slang-test/test-context.cpp
@@ -92,21 +92,21 @@ void TestContext::setInnerMainFunc(const String& name, InnerMainFunc func)
}
}
-CPPCompilerSet* TestContext::getCPPCompilerSet()
+DownstreamCompilerSet* TestContext::getCompilerSet()
{
- if (!cppCompilerSet)
+ if (!compilerSet)
{
- cppCompilerSet = new CPPCompilerSet;
+ compilerSet = new DownstreamCompilerSet;
- CPPCompilerUtil::InitializeSetDesc desc;
- CPPCompilerUtil::initializeSet(desc, cppCompilerSet);
+ DownstreamCompilerUtil::InitializeSetDesc desc;
+ DownstreamCompilerUtil::initializeSet(desc, compilerSet);
}
- return cppCompilerSet;
+ return compilerSet;
}
-Slang::CPPCompiler* TestContext::getDefaultCPPCompiler()
+Slang::DownstreamCompiler* TestContext::getDefaultCompiler()
{
- CPPCompilerSet* set = getCPPCompilerSet();
+ DownstreamCompilerSet* set = getCompilerSet();
return set ? set->getDefaultCompiler() : nullptr;
}
diff --git a/tools/slang-test/test-context.h b/tools/slang-test/test-context.h
index a9f3cec25..aa81fc72a 100644
--- a/tools/slang-test/test-context.h
+++ b/tools/slang-test/test-context.h
@@ -9,7 +9,7 @@
#include "../../source/core/slang-dictionary.h"
#include "../../source/core/slang-test-tool-util.h"
#include "../../source/core/slang-render-api-util.h"
-#include "../../source/core/slang-cpp-compiler.h"
+#include "../../source/core/slang-downstream-compiler.h"
#include "options.h"
@@ -92,9 +92,9 @@ class TestContext
/// If set, then tests are executed
bool isExecuting() const { return testRequirements == nullptr; }
- /// Get compiler factory
- Slang::CPPCompilerSet* getCPPCompilerSet();
- Slang::CPPCompiler* getDefaultCPPCompiler();
+ /// Get compiler set
+ Slang::DownstreamCompilerSet* getCompilerSet();
+ Slang::DownstreamCompiler* getDefaultCompiler();
/// Ctor
TestContext();
@@ -112,7 +112,7 @@ class TestContext
Slang::RenderApiFlags availableRenderApiFlags = 0;
bool isAvailableRenderApiFlagsValid = false;
- Slang::RefPtr<Slang::CPPCompilerSet> cppCompilerSet;
+ Slang::RefPtr<Slang::DownstreamCompilerSet> compilerSet;
protected:
struct SharedLibraryTool