-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61c70ba
commit 0305eaf
Showing
12 changed files
with
206 additions
and
115 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,39 +1,33 @@ | ||
#include "IO_Tester.hpp" | ||
#include <unistd.h> | ||
|
||
void IOTester::VSCodeDiff(const Test &t, const Utils::CMD &c) | ||
void IOTester::VSCodeDiff(const Test &t, const std::string &output) | ||
{ | ||
std::string filename1 = "\"/tmp/GOT(" + t.m_name + ")\""; | ||
std::string filename2 = "\"/tmp/EXPECTED(" + t.m_name + ")\""; | ||
std::string s1 = "echo \"" + c.output + "\" > " + filename1; | ||
std::string s1 = "echo \"" + output + "\" > " + filename1; | ||
std::string s2 = "echo \"" + t.m_output + "\" > " + filename2; | ||
|
||
system(std::string(s1 + " ; " + s2).c_str()); | ||
system(std::string(VSCodePath + filename1 + " " + filename2).c_str()); | ||
} | ||
|
||
void IOTester::checkVSCodeBin() | ||
bool IOTester::checkVSCodeBin() | ||
{ | ||
#ifdef __APPLE__ | ||
if (access("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code", X_OK) != -1) { | ||
m_VSCodeBin = OK; | ||
return; | ||
} | ||
m_VSCodeBin = KO; | ||
if (access("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code", X_OK) != -1) | ||
return true; | ||
return false; | ||
#else | ||
char* env_p = std::getenv("PATH"); | ||
if (env_p == NULL) { | ||
m_VSCodeBin = KO; | ||
return; | ||
} | ||
if (env_p == NULL) | ||
return false; | ||
auto PATHList = Utils::string_to_vector(env_p, ':'); | ||
|
||
for (auto &path : PATHList) { | ||
if (access((std::string(path + "/code").c_str()), X_OK) != -1) { | ||
m_VSCodeBin = OK; | ||
return; | ||
} | ||
if (access((std::string(path + "/code").c_str()), X_OK) != -1) | ||
return true; | ||
} | ||
m_VSCodeBin = KO; | ||
return false; | ||
#endif | ||
} |
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.