-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CLI parameters to test runner, build WinML in ARM and x86 CI #2479
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8c7ea17
Support test parameters through CLI arguments
tiagoshibata 31f8884
Add WinML do Windows x86/ARM CI builds
tiagoshibata e8f9391
Code style fixes
tiagoshibata 53d0b25
Update googletest
tiagoshibata c87df32
Refactor main.cpp
tiagoshibata 8e82af1
Build scenario tests without DML
tiagoshibata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule googletest
updated
329 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <iostream> | ||
#include <unordered_map> | ||
#include <gtest/gtest.h> | ||
|
||
#include "runtimeParameters.h" | ||
|
||
namespace RuntimeParameters | ||
{ | ||
std::unordered_map<std::string, std::string> Parameters; | ||
} | ||
|
||
namespace | ||
{ | ||
void usage(char **argv, int failedArgument) | ||
{ | ||
std::cerr << "Unrecognized argument: " << argv[failedArgument] << "\n" | ||
<< "Usage:\n\t" | ||
<< argv[0] << " [/p:parameterName=parameterValue ...]\n"; | ||
} | ||
|
||
bool parseArgument(const std::string& argument) | ||
{ | ||
if (argument.rfind("/p:", 0) == 0) | ||
{ | ||
// Parse argument in the form of /p:parameterName=parameterValue | ||
auto separatorIndex = argument.find('='); | ||
if (separatorIndex == std::string::npos || separatorIndex == 3) | ||
{ | ||
return false; | ||
} | ||
auto parameterName = argument.substr(3, separatorIndex - 3); | ||
auto parameterValue = argument.substr(separatorIndex + 1); | ||
RuntimeParameters::Parameters[parameterName] = parameterValue; | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
::testing::InitGoogleTest(&argc, argv); | ||
for (int i = 1; i < argc; i++) | ||
{ | ||
if (!parseArgument(argv[i])) | ||
{ | ||
usage(argv, i); | ||
return -1; | ||
} | ||
} | ||
return RUN_ALL_TESTS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
#pragma once | ||
namespace RuntimeParameters | ||
{ | ||
// Runtime parameters passed through CLI arguments | ||
extern std::unordered_map<std::string, std::string> Parameters; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just confirming - we won't run scenario tests without DML?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that it's not possible in its current state, right? Scenario tests don't compile without DML.
I'll change the tests to skip compilation of tests that depend on DML when it's disabled (add some
#ifdef
), but I think this PR could be merged as-is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
In reply to: 351031299 [](ancestors = 351031299)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it yesterday to build scenario tests except CustomOps.cpp but forgot to push the changes, pushed them now.