From 97c46dd57c65ff596087c8b341926d1d2cbb6440 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 9 Aug 2019 12:40:35 -0400 Subject: 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. --- tools/slang-test/slang-test-main.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'tools') 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); -- cgit v1.2.3