@@ -85,62 +85,66 @@ struct TestRequirements
85
85
Slang::RenderApiFlags usedRenderApiFlags = 0 ; // /< Used render api flags (some might be implied)
86
86
};
87
87
88
+ struct FileTestInfo : public Slang ::RefObject
89
+ {
90
+ };
91
+
88
92
class TestContext
89
93
{
90
- public:
94
+ public:
91
95
92
96
typedef Slang::TestToolUtil::InnerMainFunc InnerMainFunc;
93
97
94
- // / Get the slang session
95
- SlangSession* getSession () const { return m_session; }
98
+ // / Get the slang session
99
+ SlangSession* getSession () const { return m_session; }
96
100
97
101
SlangResult init (const char * exePath);
98
102
99
- // / Get the inner main function (from shared library)
103
+ // / Get the inner main function (from shared library)
100
104
InnerMainFunc getInnerMainFunc (const Slang::String& dirPath, const Slang::String& name);
101
- // / Set the function for the shared library
105
+ // / Set the function for the shared library
102
106
void setInnerMainFunc (const Slang::String& name, InnerMainFunc func);
103
107
104
108
void setTestRequirements (TestRequirements* req);
105
109
106
110
TestRequirements* getTestRequirements () const ;
107
111
108
- // / If true tests aren't being run just the information on testing is being accumulated
112
+ // / If true tests aren't being run just the information on testing is being accumulated
109
113
bool isCollectingRequirements () const { return getTestRequirements () != nullptr ; }
110
- // / If set, then tests are executed
114
+ // / If set, then tests are executed
111
115
bool isExecuting () const { return getTestRequirements () == nullptr ; }
112
116
113
- // / True if a render API filter is enabled
117
+ // / True if a render API filter is enabled
114
118
bool isRenderApiFilterEnabled () const { return options.enabledApis != Slang::RenderApiFlag::AllOf && options.enabledApis != 0 ; }
115
119
116
- // / True if a test with the requiredFlags can in principal run (it may not be possible if the API is not available though)
120
+ // / True if a test with the requiredFlags can in principal run (it may not be possible if the API is not available though)
117
121
bool canRunTestWithRenderApiFlags (Slang::RenderApiFlags requiredFlags);
118
122
119
- // / True if can run unit tests
123
+ // / True if can run unit tests
120
124
bool canRunUnitTests () const { return options.apiOnly == false ; }
121
125
122
- // / Given a spawn type, return the final spawn type.
123
- // / In particular we want 'Default' spawn type to vary by the environment (for example running on test server on CI)
126
+ // / Given a spawn type, return the final spawn type.
127
+ // / In particular we want 'Default' spawn type to vary by the environment (for example running on test server on CI)
124
128
SpawnType getFinalSpawnType (SpawnType spawnType);
125
129
126
130
SpawnType getFinalSpawnType ();
127
131
128
- // / Get compiler set
132
+ // / Get compiler set
129
133
Slang::DownstreamCompilerSet* getCompilerSet ();
130
134
Slang::IDownstreamCompiler* getDefaultCompiler (SlangSourceLanguage sourceLanguage);
131
135
132
136
Slang::JSONRPCConnection* getOrCreateJSONRPCConnection ();
133
137
void destroyRPCConnection ();
134
138
135
- // / Ctor
139
+ // / Ctor
136
140
TestContext ();
137
- // / Dtor
141
+ // / Dtor
138
142
~TestContext ();
139
143
140
144
Options options;
141
145
TestCategorySet categorySet;
142
146
143
- // / If set then tests are not run, but their requirements are set
147
+ // / If set then tests are not run, but their requirements are set
144
148
145
149
PassThroughFlags availableBackendFlags = 0 ;
146
150
Slang::RenderApiFlags availableRenderApiFlags = 0 ;
@@ -152,17 +156,17 @@ class TestContext
152
156
Slang::String dllDirectoryPath;
153
157
Slang::String exePath;
154
158
155
- // / Timeout time for communication over connection.
156
- // / NOTE! If the timeout is hit, the connection will be destroyed, and then recreated.
157
- // / For tests that compile the stdlib, if that takes this time, the stdlib will be
158
- // / repeatedly compiled and each time fail.
159
- // / NOTE! This timeout may be altered in the ctor for a specific target, the initializatoin
160
- // / value is just the default.
161
- // /
162
- // / TODO(JS): We could split the stdlib compilation from other actions, and have timeout specific for
163
- // / that. To do this we could have a 'compileStdLib' RPC method.
164
- // /
165
- // / Current default is 60 seconds.
159
+ // / Timeout time for communication over connection.
160
+ // / NOTE! If the timeout is hit, the connection will be destroyed, and then recreated.
161
+ // / For tests that compile the stdlib, if that takes this time, the stdlib will be
162
+ // / repeatedly compiled and each time fail.
163
+ // / NOTE! This timeout may be altered in the ctor for a specific target, the initializatoin
164
+ // / value is just the default.
165
+ // /
166
+ // / TODO(JS): We could split the stdlib compilation from other actions, and have timeout specific for
167
+ // / that. To do this we could have a 'compileStdLib' RPC method.
168
+ // /
169
+ // / Current default is 60 seconds.
166
170
Slang::Int connectionTimeOutInMs = 60 * 1000 ;
167
171
168
172
void setThreadIndex (int index);
@@ -175,6 +179,10 @@ class TestContext
175
179
std::mutex mutex;
176
180
Slang::RefPtr<Slang::JSONRPCConnection> m_languageServerConnection;
177
181
182
+
183
+ std::mutex mutexFailedFileTests;
184
+ Slang::List<Slang::RefPtr<FileTestInfo>> failedFileTests;
185
+
178
186
Slang::IFileCheck* getFileCheck () { return m_fileCheck; };
179
187
180
188
protected:
0 commit comments