Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
9065ed83
Commit
9065ed83
authored
Oct 05, 2016
by
John Kessenich
Committed by
GitHub
Oct 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #537 from dneto0/pass-cwd-to-gtest
Gtests can be run on another source tree
parents
c056adcd
1d3a9661
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
56 additions
and
34 deletions
+56
-34
AST.FromFile.cpp
gtests/AST.FromFile.cpp
+1
-1
BuiltInResource.FromFile.cpp
gtests/BuiltInResource.FromFile.cpp
+1
-1
CMakeLists.txt
gtests/CMakeLists.txt
+7
-2
Config.FromFile.cpp
gtests/Config.FromFile.cpp
+3
-3
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+2
-2
Link.FromFile.cpp
gtests/Link.FromFile.cpp
+2
-2
Pp.FromFile.cpp
gtests/Pp.FromFile.cpp
+1
-1
Remap.FromFile.cpp
gtests/Remap.FromFile.cpp
+3
-3
Settings.cpp
gtests/Settings.cpp
+11
-1
Settings.h
gtests/Settings.h
+4
-0
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+8
-8
TestFixture.h
gtests/TestFixture.h
+0
-8
main.cpp
gtests/main.cpp
+13
-2
No files found.
gtests/AST.FromFile.cpp
View file @
9065ed83
...
@@ -43,7 +43,7 @@ using CompileToAstTest = GlslangTest<::testing::TestWithParam<std::string>>;
...
@@ -43,7 +43,7 @@ using CompileToAstTest = GlslangTest<::testing::TestWithParam<std::string>>;
TEST_P
(
CompileToAstTest
,
FromFile
)
TEST_P
(
CompileToAstTest
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
(),
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
(),
Source
::
GLSL
,
Semantics
::
OpenGL
,
Source
::
GLSL
,
Semantics
::
OpenGL
,
Target
::
AST
);
Target
::
AST
);
}
}
...
...
gtests/BuiltInResource.FromFile.cpp
View file @
9065ed83
...
@@ -46,7 +46,7 @@ using DefaultResourceTest = GlslangTest<::testing::Test>;
...
@@ -46,7 +46,7 @@ using DefaultResourceTest = GlslangTest<::testing::Test>;
TEST_F
(
DefaultResourceTest
,
FromFile
)
TEST_F
(
DefaultResourceTest
,
FromFile
)
{
{
const
std
::
string
path
=
G
LSLANG_TEST_DIRECTORY
"/baseResults/test.conf"
;
const
std
::
string
path
=
G
lobalTestSettings
.
testRoot
+
"/baseResults/test.conf"
;
std
::
string
expectedConfig
;
std
::
string
expectedConfig
;
tryLoadFile
(
path
,
"expected resource limit"
,
&
expectedConfig
);
tryLoadFile
(
path
,
"expected resource limit"
,
&
expectedConfig
);
const
std
::
string
realConfig
=
glslang
::
GetDefaultTBuiltInResourceString
();
const
std
::
string
realConfig
=
glslang
::
GetDefaultTBuiltInResourceString
();
...
...
gtests/CMakeLists.txt
View file @
9065ed83
...
@@ -29,8 +29,12 @@ if (TARGET gmock)
...
@@ -29,8 +29,12 @@ if (TARGET gmock)
install
(
TARGETS glslangtests
install
(
TARGETS glslangtests
RUNTIME DESTINATION bin
)
RUNTIME DESTINATION bin
)
set
(
GLSLANG_TEST_DIRECTORY
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../Test"
)
# Supply a default test root directory, so that manual testing
# doesn't have to specify the --test-root option in the normal
# case that you want to use the tests from the same source tree.
target_compile_definitions
(
glslangtests
target_compile_definitions
(
glslangtests
PRIVATE GLSLANG_TEST_DIRECTORY=
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../Test
"
)
PRIVATE GLSLANG_TEST_DIRECTORY=
"
${
GLSLANG_TEST_DIRECTORY
}
"
)
target_include_directories
(
glslangtests PRIVATE
target_include_directories
(
glslangtests PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
${
CMAKE_CURRENT_SOURCE_DIR
}
${
PROJECT_SOURCE_DIR
}
${
PROJECT_SOURCE_DIR
}
...
@@ -39,5 +43,6 @@ if (TARGET gmock)
...
@@ -39,5 +43,6 @@ if (TARGET gmock)
target_link_libraries
(
glslangtests PRIVATE
target_link_libraries
(
glslangtests PRIVATE
SPVRemapper glslang OSDependent OGLCompiler HLSL glslang
SPVRemapper glslang OSDependent OGLCompiler HLSL glslang
SPIRV glslang-default-resource-limits gmock
)
SPIRV glslang-default-resource-limits gmock
)
add_test
(
NAME glslang-gtests COMMAND glslangtests
)
add_test
(
NAME glslang-gtests
COMMAND glslangtests --test-root
"
${
GLSLANG_TEST_DIRECTORY
}
"
)
endif
()
endif
()
gtests/Config.FromFile.cpp
View file @
9065ed83
...
@@ -54,8 +54,8 @@ TEST_P(ConfigTest, FromFile)
...
@@ -54,8 +54,8 @@ TEST_P(ConfigTest, FromFile)
// Get the contents for input shader and limit configurations.
// Get the contents for input shader and limit configurations.
std
::
string
shaderContents
,
configContents
;
std
::
string
shaderContents
,
configContents
;
tryLoadFile
(
G
LSLANG_TEST_DIRECTORY
"/"
+
testCase
.
input
,
"input"
,
&
shaderContents
);
tryLoadFile
(
G
lobalTestSettings
.
testRoot
+
"/"
+
testCase
.
input
,
"input"
,
&
shaderContents
);
tryLoadFile
(
G
LSLANG_TEST_DIRECTORY
"/"
+
testCase
.
config
,
"limits config"
,
&
configContents
);
tryLoadFile
(
G
lobalTestSettings
.
testRoot
+
"/"
+
testCase
.
config
,
"limits config"
,
&
configContents
);
// Decode limit configurations.
// Decode limit configurations.
TBuiltInResource
resources
=
{};
TBuiltInResource
resources
=
{};
...
@@ -86,7 +86,7 @@ TEST_P(ConfigTest, FromFile)
...
@@ -86,7 +86,7 @@ TEST_P(ConfigTest, FromFile)
// Check with expected results.
// Check with expected results.
const
std
::
string
expectedOutputFname
=
const
std
::
string
expectedOutputFname
=
G
LSLANG_TEST_DIRECTORY
"/baseResults/"
+
testCase
.
output
;
G
lobalTestSettings
.
testRoot
+
"/baseResults/"
+
testCase
.
output
;
std
::
string
expectedOutput
;
std
::
string
expectedOutput
;
tryLoadFile
(
expectedOutputFname
,
"expected output"
,
&
expectedOutput
);
tryLoadFile
(
expectedOutputFname
,
"expected output"
,
&
expectedOutput
);
...
...
gtests/Hlsl.FromFile.cpp
View file @
9065ed83
...
@@ -64,14 +64,14 @@ using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameE
...
@@ -64,14 +64,14 @@ using HlslCompileAndFlattenTest = GlslangTest<::testing::TestWithParam<FileNameE
// generate both AST and SPIR-V.
// generate both AST and SPIR-V.
TEST_P
(
HlslCompileTest
,
FromFile
)
TEST_P
(
HlslCompileTest
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
().
fileName
,
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
().
fileName
,
Source
::
HLSL
,
Semantics
::
Vulkan
,
Source
::
HLSL
,
Semantics
::
Vulkan
,
Target
::
BothASTAndSpv
,
GetParam
().
entryPoint
);
Target
::
BothASTAndSpv
,
GetParam
().
entryPoint
);
}
}
TEST_P
(
HlslCompileAndFlattenTest
,
FromFile
)
TEST_P
(
HlslCompileAndFlattenTest
,
FromFile
)
{
{
loadFileCompileFlattenUniformsAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
().
fileName
,
loadFileCompileFlattenUniformsAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
().
fileName
,
Source
::
HLSL
,
Semantics
::
Vulkan
,
Source
::
HLSL
,
Semantics
::
Vulkan
,
Target
::
BothASTAndSpv
,
GetParam
().
entryPoint
);
Target
::
BothASTAndSpv
,
GetParam
().
entryPoint
);
}
}
...
...
gtests/Link.FromFile.cpp
View file @
9065ed83
...
@@ -55,7 +55,7 @@ TEST_P(LinkTest, FromFile)
...
@@ -55,7 +55,7 @@ TEST_P(LinkTest, FromFile)
std
::
vector
<
std
::
unique_ptr
<
glslang
::
TShader
>>
shaders
;
std
::
vector
<
std
::
unique_ptr
<
glslang
::
TShader
>>
shaders
;
for
(
size_t
i
=
0
;
i
<
fileCount
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
fileCount
;
++
i
)
{
std
::
string
contents
;
std
::
string
contents
;
tryLoadFile
(
G
LSLANG_TEST_DIRECTORY
"/"
+
fileNames
[
i
],
tryLoadFile
(
G
lobalTestSettings
.
testRoot
+
"/"
+
fileNames
[
i
],
"input"
,
&
contents
);
"input"
,
&
contents
);
shaders
.
emplace_back
(
shaders
.
emplace_back
(
new
glslang
::
TShader
(
GetShaderStage
(
GetSuffix
(
fileNames
[
i
]))));
new
glslang
::
TShader
(
GetShaderStage
(
GetSuffix
(
fileNames
[
i
]))));
...
@@ -77,7 +77,7 @@ TEST_P(LinkTest, FromFile)
...
@@ -77,7 +77,7 @@ TEST_P(LinkTest, FromFile)
// Check with expected results.
// Check with expected results.
const
std
::
string
expectedOutputFname
=
const
std
::
string
expectedOutputFname
=
G
LSLANG_TEST_DIRECTORY
"/baseResults/"
+
fileNames
.
front
()
+
".out"
;
G
lobalTestSettings
.
testRoot
+
"/baseResults/"
+
fileNames
.
front
()
+
".out"
;
std
::
string
expectedOutput
;
std
::
string
expectedOutput
;
tryLoadFile
(
expectedOutputFname
,
"expected output"
,
&
expectedOutput
);
tryLoadFile
(
expectedOutputFname
,
"expected output"
,
&
expectedOutput
);
...
...
gtests/Pp.FromFile.cpp
View file @
9065ed83
...
@@ -43,7 +43,7 @@ using PreprocessingTest = GlslangTest<::testing::TestWithParam<std::string>>;
...
@@ -43,7 +43,7 @@ using PreprocessingTest = GlslangTest<::testing::TestWithParam<std::string>>;
TEST_P
(
PreprocessingTest
,
FromFile
)
TEST_P
(
PreprocessingTest
,
FromFile
)
{
{
loadFilePreprocessAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
());
loadFilePreprocessAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
());
}
}
// clang-format off
// clang-format off
...
...
gtests/Remap.FromFile.cpp
View file @
9065ed83
...
@@ -60,17 +60,17 @@ std::string FileNameAsCustomTestSuffix(
...
@@ -60,17 +60,17 @@ std::string FileNameAsCustomTestSuffix(
using
RemapTest
=
GlslangTest
<::
testing
::
TestWithParam
<
RemapTestArgs
>>
;
using
RemapTest
=
GlslangTest
<::
testing
::
TestWithParam
<
RemapTestArgs
>>
;
// Remapping SPIR-V modules.
// Remapping SPIR-V modules.
TEST_P
(
RemapTest
,
FromFile
)
TEST_P
(
RemapTest
,
FromFile
)
{
{
if
(
GetSuffix
(
GetParam
().
fileName
)
==
"spv"
)
{
if
(
GetSuffix
(
GetParam
().
fileName
)
==
"spv"
)
{
loadFileRemapAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
().
fileName
,
loadFileRemapAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
().
fileName
,
GetParam
().
sourceLanguage
,
GetParam
().
sourceLanguage
,
Semantics
::
Vulkan
,
Semantics
::
Vulkan
,
Target
::
Spv
,
Target
::
Spv
,
GetParam
().
remapOpts
);
GetParam
().
remapOpts
);
}
else
{
}
else
{
loadFileCompileRemapAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
().
fileName
,
loadFileCompileRemapAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
().
fileName
,
GetParam
().
sourceLanguage
,
GetParam
().
sourceLanguage
,
Semantics
::
Vulkan
,
Semantics
::
Vulkan
,
Target
::
Spv
,
Target
::
Spv
,
...
...
gtests/Settings.cpp
View file @
9065ed83
...
@@ -36,6 +36,16 @@
...
@@ -36,6 +36,16 @@
namespace
glslangtest
{
namespace
glslangtest
{
GTestSettings
GlobalTestSettings
=
{
nullptr
,
false
};
// We need CMake to provide us the absolute path to the directory containing
// test files, so we are certain to find those files no matter where the test
// harness binary is generated. This provides out-of-source build capability.
// This will be used as the default test root, but can be overridden with
// the --test-root argument.
#ifndef GLSLANG_TEST_DIRECTORY
#error \
"GLSLANG_TEST_DIRECTORY needs to be defined for gtest to locate test files."
#endif
GTestSettings
GlobalTestSettings
=
{
nullptr
,
false
,
GLSLANG_TEST_DIRECTORY
};
}
// namespace glslangtest
}
// namespace glslangtest
gtests/Settings.h
View file @
9065ed83
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
#ifndef GLSLANG_GTESTS_SETTINGS_H
#ifndef GLSLANG_GTESTS_SETTINGS_H
#define GLSLANG_GTESTS_SETTINGS_H
#define GLSLANG_GTESTS_SETTINGS_H
#include <string>
namespace
glslangtest
{
namespace
glslangtest
{
class
GlslangInitializer
;
class
GlslangInitializer
;
...
@@ -45,6 +47,8 @@ struct GTestSettings {
...
@@ -45,6 +47,8 @@ struct GTestSettings {
// An indicator of whether GTest should write real output to the file for
// An indicator of whether GTest should write real output to the file for
// the expected output.
// the expected output.
bool
updateMode
;
bool
updateMode
;
// The root directory for test files.
std
::
string
testRoot
;
};
};
extern
GTestSettings
GlobalTestSettings
;
extern
GTestSettings
GlobalTestSettings
;
...
...
gtests/Spv.FromFile.cpp
View file @
9065ed83
...
@@ -75,7 +75,7 @@ using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::st
...
@@ -75,7 +75,7 @@ using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::st
// generate SPIR-V.
// generate SPIR-V.
TEST_P
(
CompileVulkanToSpirvTest
,
FromFile
)
TEST_P
(
CompileVulkanToSpirvTest
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
(),
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
(),
Source
::
GLSL
,
Semantics
::
Vulkan
,
Source
::
GLSL
,
Semantics
::
Vulkan
,
Target
::
Spv
);
Target
::
Spv
);
}
}
...
@@ -84,7 +84,7 @@ TEST_P(CompileVulkanToSpirvTest, FromFile)
...
@@ -84,7 +84,7 @@ TEST_P(CompileVulkanToSpirvTest, FromFile)
// generate SPIR-V.
// generate SPIR-V.
TEST_P
(
CompileOpenGLToSpirvTest
,
FromFile
)
TEST_P
(
CompileOpenGLToSpirvTest
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
(),
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
(),
Source
::
GLSL
,
Semantics
::
OpenGL
,
Source
::
GLSL
,
Semantics
::
OpenGL
,
Target
::
Spv
);
Target
::
Spv
);
}
}
...
@@ -93,7 +93,7 @@ TEST_P(CompileOpenGLToSpirvTest, FromFile)
...
@@ -93,7 +93,7 @@ TEST_P(CompileOpenGLToSpirvTest, FromFile)
// SPIR-V.
// SPIR-V.
TEST_P
(
VulkanSemantics
,
FromFile
)
TEST_P
(
VulkanSemantics
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
(),
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
(),
Source
::
GLSL
,
Semantics
::
Vulkan
,
Source
::
GLSL
,
Semantics
::
Vulkan
,
Target
::
Spv
);
Target
::
Spv
);
}
}
...
@@ -102,7 +102,7 @@ TEST_P(VulkanSemantics, FromFile)
...
@@ -102,7 +102,7 @@ TEST_P(VulkanSemantics, FromFile)
// SPIR-V.
// SPIR-V.
TEST_P
(
OpenGLSemantics
,
FromFile
)
TEST_P
(
OpenGLSemantics
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
(),
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
(),
Source
::
GLSL
,
Semantics
::
OpenGL
,
Source
::
GLSL
,
Semantics
::
OpenGL
,
Target
::
Spv
);
Target
::
Spv
);
}
}
...
@@ -110,7 +110,7 @@ TEST_P(OpenGLSemantics, FromFile)
...
@@ -110,7 +110,7 @@ TEST_P(OpenGLSemantics, FromFile)
// GLSL-level Vulkan semantics test that need to see the AST for validation.
// GLSL-level Vulkan semantics test that need to see the AST for validation.
TEST_P
(
VulkanAstSemantics
,
FromFile
)
TEST_P
(
VulkanAstSemantics
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
(),
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
(),
Source
::
GLSL
,
Semantics
::
Vulkan
,
Source
::
GLSL
,
Semantics
::
Vulkan
,
Target
::
AST
);
Target
::
AST
);
}
}
...
@@ -118,7 +118,7 @@ TEST_P(VulkanAstSemantics, FromFile)
...
@@ -118,7 +118,7 @@ TEST_P(VulkanAstSemantics, FromFile)
// HLSL-level Vulkan semantics tests.
// HLSL-level Vulkan semantics tests.
TEST_P
(
HlslIoMap
,
FromFile
)
TEST_P
(
HlslIoMap
,
FromFile
)
{
{
loadFileCompileIoMapAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
().
fileName
,
loadFileCompileIoMapAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
().
fileName
,
Source
::
HLSL
,
Semantics
::
Vulkan
,
Source
::
HLSL
,
Semantics
::
Vulkan
,
Target
::
Spv
,
GetParam
().
entryPoint
,
Target
::
Spv
,
GetParam
().
entryPoint
,
GetParam
().
baseSamplerBinding
,
GetParam
().
baseSamplerBinding
,
...
@@ -131,7 +131,7 @@ TEST_P(HlslIoMap, FromFile)
...
@@ -131,7 +131,7 @@ TEST_P(HlslIoMap, FromFile)
// GLSL-level Vulkan semantics tests.
// GLSL-level Vulkan semantics tests.
TEST_P
(
GlslIoMap
,
FromFile
)
TEST_P
(
GlslIoMap
,
FromFile
)
{
{
loadFileCompileIoMapAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
().
fileName
,
loadFileCompileIoMapAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
().
fileName
,
Source
::
GLSL
,
Semantics
::
Vulkan
,
Source
::
GLSL
,
Semantics
::
Vulkan
,
Target
::
Spv
,
GetParam
().
entryPoint
,
Target
::
Spv
,
GetParam
().
entryPoint
,
GetParam
().
baseSamplerBinding
,
GetParam
().
baseSamplerBinding
,
...
@@ -146,7 +146,7 @@ TEST_P(GlslIoMap, FromFile)
...
@@ -146,7 +146,7 @@ TEST_P(GlslIoMap, FromFile)
// Expected to successfully generate SPIR-V.
// Expected to successfully generate SPIR-V.
TEST_P
(
CompileVulkanToSpirvTestAMD
,
FromFile
)
TEST_P
(
CompileVulkanToSpirvTestAMD
,
FromFile
)
{
{
loadFileCompileAndCheck
(
G
LSLANG_TEST_DIRECTORY
,
GetParam
(),
loadFileCompileAndCheck
(
G
lobalTestSettings
.
testRoot
,
GetParam
(),
Source
::
GLSL
,
Semantics
::
Vulkan
,
Source
::
GLSL
,
Semantics
::
Vulkan
,
Target
::
Spv
);
Target
::
Spv
);
}
}
...
...
gtests/TestFixture.h
View file @
9065ed83
...
@@ -54,14 +54,6 @@
...
@@ -54,14 +54,6 @@
#include "Initializer.h"
#include "Initializer.h"
#include "Settings.h"
#include "Settings.h"
// We need CMake to provide us the absolute path to the directory containing
// test files, so we are certain to find those files no matter where the test
// harness binary is generated. This provides out-of-source build capability.
#ifndef GLSLANG_TEST_DIRECTORY
#error \
"GLSLANG_TEST_DIRECTORY needs to be defined for gtest to locate test files."
#endif
namespace
glslangtest
{
namespace
glslangtest
{
// This function is used to provide custom test name suffixes based on the
// This function is used to provide custom test name suffixes based on the
...
...
gtests/main.cpp
View file @
9065ed83
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
// POSSIBILITY OF SUCH DAMAGE.
#include <memory>
#include <memory>
#include <string>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
...
@@ -49,9 +50,19 @@ int main(int argc, char** argv)
...
@@ -49,9 +50,19 @@ int main(int argc, char** argv)
glslangtest
::
GlobalTestSettings
.
initializer
=
initializer
.
get
();
glslangtest
::
GlobalTestSettings
.
initializer
=
initializer
.
get
();
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
!
strncmp
(
"--update-mode"
,
argv
[
i
],
13
)
)
{
if
(
std
::
string
(
"--update-mode"
)
==
argv
[
i
]
)
{
glslangtest
::
GlobalTestSettings
.
updateMode
=
true
;
glslangtest
::
GlobalTestSettings
.
updateMode
=
true
;
break
;
}
if
(
std
::
string
(
"--test-root"
)
==
argv
[
i
])
{
// Allow the user set the tets root directory. This is useful
// for testing with files from another source tree.
if
(
i
+
1
<
argc
)
{
glslangtest
::
GlobalTestSettings
.
testRoot
=
argv
[
i
+
1
];
i
++
;
}
else
{
printf
(
"error: --test-root requires an argument
\n
"
);
return
1
;
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment