summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-08-09 12:40:35 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2019-08-09 09:40:35 -0700
commit97c46dd57c65ff596087c8b341926d1d2cbb6440 (patch)
tree123ea1cf7ee55137207df73b52660275bc57bf30
parent41247c3942210df33b9e3dd733eafb23573a4f2f (diff)
Fix TeamCity CI issues (#1013)
* Added CPU_REFLECTION test option - that has two versions of the reflection output depending on ptr size. * Added 'shared-library' test category. This category is disabled on CI targets that have issues.
-rw-r--r--tests/cpp-compiler/c-compile-shared-library.c2
-rw-r--r--tests/cpp-compiler/cpp-compile-shared-library.cpp4
-rw-r--r--tests/cross-compile/cpp-resource-reflection.slang2
-rw-r--r--tests/cross-compile/cpp-resource-reflection.slang.32.expected163
-rw-r--r--tests/cross-compile/cpp-resource-reflection.slang.64.expected (renamed from tests/cross-compile/cpp-resource-reflection.slang.expected)0
-rw-r--r--tools/slang-test/slang-test-main.cpp30
6 files changed, 193 insertions, 8 deletions
diff --git a/tests/cpp-compiler/c-compile-shared-library.c b/tests/cpp-compiler/c-compile-shared-library.c
index 8b6be6115..5ae61d65b 100644
--- a/tests/cpp-compiler/c-compile-shared-library.c
+++ b/tests/cpp-compiler/c-compile-shared-library.c
@@ -1,4 +1,4 @@
-//TEST(smoke):CPP_COMPILER_SHARED_LIBRARY:
+//TEST(smoke,shared-library):CPP_COMPILER_SHARED_LIBRARY:
#include <stdlib.h>
#include <stdio.h>
diff --git a/tests/cpp-compiler/cpp-compile-shared-library.cpp b/tests/cpp-compiler/cpp-compile-shared-library.cpp
index 8b70f258d..5341cd2fb 100644
--- a/tests/cpp-compiler/cpp-compile-shared-library.cpp
+++ b/tests/cpp-compiler/cpp-compile-shared-library.cpp
@@ -1,6 +1,4 @@
-//TEST(smoke):CPP_COMPILER_SHARED_LIBRARY:
-
-//#include <slang.h>
+//TEST(smoke,shared-library):CPP_COMPILER_SHARED_LIBRARY:
#include <stdlib.h>
#include <stdio.h>
diff --git a/tests/cross-compile/cpp-resource-reflection.slang b/tests/cross-compile/cpp-resource-reflection.slang
index 122e7b4de..52884fe03 100644
--- a/tests/cross-compile/cpp-resource-reflection.slang
+++ b/tests/cross-compile/cpp-resource-reflection.slang
@@ -1,4 +1,4 @@
-//TEST:REFLECTION: -profile cs_5_0 -entry computeMain -target cpp
+//TEST:CPU_REFLECTION: -profile cs_5_0 -entry computeMain -target cpp
struct Thing
diff --git a/tests/cross-compile/cpp-resource-reflection.slang.32.expected b/tests/cross-compile/cpp-resource-reflection.slang.32.expected
new file mode 100644
index 000000000..7f88c134e
--- /dev/null
+++ b/tests/cross-compile/cpp-resource-reflection.slang.32.expected
@@ -0,0 +1,163 @@
+result code = 0
+standard error = {
+}
+standard output = {
+{
+ "parameters": [
+ {
+ "name": "thing3",
+ "binding": {"kind": "uniform", "offset": 0, "size": 4},
+ "type": {
+ "kind": "constantBuffer",
+ "elementType": {
+ "kind": "struct",
+ "name": "Thing",
+ "fields": [
+ {
+ "name": "a",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ },
+ "binding": {"kind": "uniform", "offset": 0, "size": 4}
+ },
+ {
+ "name": "b",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ },
+ "binding": {"kind": "uniform", "offset": 4, "size": 4}
+ },
+ {
+ "name": "c",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ },
+ "binding": {"kind": "uniform", "offset": 8, "size": 4}
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "outputBuffer",
+ "binding": {"kind": "uniform", "offset": 4, "size": 8},
+ "type": {
+ "kind": "resource",
+ "baseShape": "structuredBuffer",
+ "access": "readWrite",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ }
+ }
+ },
+ {
+ "name": "tex",
+ "binding": {"kind": "uniform", "offset": 12, "size": 4},
+ "type": {
+ "kind": "resource",
+ "baseShape": "texture2D"
+ }
+ },
+ {
+ "name": "sampler",
+ "binding": {"kind": "uniform", "offset": 16, "size": 4},
+ "type": {
+ "kind": "samplerState"
+ }
+ }
+ ],
+ "entryPoints": [
+ {
+ "name": "computeMain",
+ "stage:": "compute",
+ "parameters": [
+ {
+ "name": "dispatchThreadID",
+ "semanticName": "SV_DISPATCHTHREADID",
+ "type": {
+ "kind": "vector",
+ "elementCount": 3,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "uint32"
+ }
+ }
+ },
+ {
+ "name": "thing",
+ "binding": {"kind": "uniform", "offset": 0, "size": 12},
+ "type": {
+ "kind": "struct",
+ "name": "Thing",
+ "fields": [
+ {
+ "name": "a",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ },
+ "binding": {"kind": "uniform", "offset": 0, "size": 4}
+ },
+ {
+ "name": "b",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ },
+ "binding": {"kind": "uniform", "offset": 4, "size": 4}
+ },
+ {
+ "name": "c",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ },
+ "binding": {"kind": "uniform", "offset": 8, "size": 4}
+ }
+ ]
+ }
+ },
+ {
+ "name": "thing2",
+ "binding": {"kind": "uniform", "offset": 12, "size": 12},
+ "type": {
+ "kind": "struct",
+ "name": "Thing",
+ "fields": [
+ {
+ "name": "a",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ },
+ "binding": {"kind": "uniform", "offset": 0, "size": 4}
+ },
+ {
+ "name": "b",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ },
+ "binding": {"kind": "uniform", "offset": 4, "size": 4}
+ },
+ {
+ "name": "c",
+ "type": {
+ "kind": "scalar",
+ "scalarType": "float32"
+ },
+ "binding": {"kind": "uniform", "offset": 8, "size": 4}
+ }
+ ]
+ }
+ }
+ ],
+ "threadGroupSize": [4, 1, 1]
+ }
+ ]
+}
+}
diff --git a/tests/cross-compile/cpp-resource-reflection.slang.expected b/tests/cross-compile/cpp-resource-reflection.slang.64.expected
index a0e5241f0..a0e5241f0 100644
--- a/tests/cross-compile/cpp-resource-reflection.slang.expected
+++ b/tests/cross-compile/cpp-resource-reflection.slang.64.expected
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 3235cc785..8be8f797a 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -1217,6 +1217,8 @@ TestResult runReflectionTest(TestContext* context, TestInput& input)
auto filePath = input.filePath;
auto outputStem = input.outputStem;
+ bool isCPUTest = input.testOptions->command.startsWith("CPU_");
+
CommandLine cmdLine;
cmdLine.setExecutablePath(Path::combine(options.binDir, String("slang-reflection-test") + ProcessUtil::getExecutableSuffix()));
@@ -1237,6 +1239,15 @@ TestResult runReflectionTest(TestContext* context, TestInput& input)
String actualOutput = getOutput(exeRes);
+ if (isCPUTest)
+ {
+#if SLANG_PTR_IS_32
+ outputStem.append(".32");
+#else
+ outputStem.append(".64");
+#endif
+ }
+
String expectedOutputPath = outputStem + ".expected";
String expectedOutput;
try
@@ -2417,6 +2428,7 @@ static const TestCommandInfo s_testCommandInfos[] =
{
{ "SIMPLE", &runSimpleTest},
{ "REFLECTION", &runReflectionTest},
+ { "CPU_REFLECTION", &runReflectionTest},
{ "COMMAND_LINE_SIMPLE", &runSimpleCompareCommandLineTest},
{ "COMPARE_HLSL", &runHLSLComparisonTest},
{ "COMPARE_HLSL_RENDER", &runHLSLRenderComparisonTest},
@@ -2828,10 +2840,11 @@ SlangResult innerMain(int argc, char** argv)
/*auto computeTestCategory = */categorySet.add("compute", fullTestCategory);
auto vulkanTestCategory = categorySet.add("vulkan", fullTestCategory);
auto unitTestCatagory = categorySet.add("unit-test", fullTestCategory);
- auto compatibilityIssueCatagory = categorySet.add("compatibility-issue", fullTestCategory);
-
+ auto compatibilityIssueCategory = categorySet.add("compatibility-issue", fullTestCategory);
+ auto sharedLibraryCategory = categorySet.add("shared-library", fullTestCategory);
+
#if SLANG_WINDOWS_FAMILY
- auto windowsCatagory = categorySet.add("windows", fullTestCategory);
+ auto windowsCategory = categorySet.add("windows", fullTestCategory);
#endif
#if SLANG_UNIX_FAMILY
@@ -2908,6 +2921,17 @@ SlangResult innerMain(int argc, char** argv)
return func(StdWriters::getSingleton(), context.getSession(), int(args.getCount()), args.getBuffer());
}
+ // On TeamCity CI there is an issue with unix/linux targets where test system may be different from the build system
+ // That when C/C++ code is compiled, it does so for the test systems arch not for the build system
+ // This leads to shared library not being loadable, so we need to disable such tests that have this requirement
+ if (options.outputMode == TestOutputMode::TeamCity)
+ {
+#if SLANG_UNIX_FAMILY && SLANG_PROCESSOR_X86
+ // Disable shared library requiring tests
+ options.excludeCategories.Add(sharedLibraryCategory, sharedLibraryCategory);
+#endif
+ }
+
if( options.includeCategories.Count() == 0 )
{
options.includeCategories.Add(fullTestCategory, fullTestCategory);