Skip to content

Commit

Permalink
Merge pull request #306 from ngageoint/path_checking
Browse files Browse the repository at this point in the history
Fix Jenkins build
  • Loading branch information
christianwhite1193 authored Jan 23, 2020
2 parents 9be5e27 + 75ca138 commit 65cd8a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ std::string findSixHome(const sys::Path& exePath)
sys::Path sixHome = exePath.join("..");
do
{
if (sixHome.join("croppedNitfs").isDirectory())
const sys::Path croppedNitfs = sixHome.join("croppedNitfs");
if (sys::OS().isDirectory(croppedNitfs.getAbsolutePath()))
{
return sixHome;
}
Expand Down Expand Up @@ -146,7 +147,15 @@ int main(int argc, char** argv)
return 1;
}
// Making this global so we don't have to re-read the file every test
globalFitter = loadPolynomialFitter(std::string(argv[0]));
try
{
globalFitter = loadPolynomialFitter(std::string(argv[0]));
}
catch (const except::Exception& ex)
{
std::cerr << ex.toString() << "\n";
return 1;
}
TEST_CHECK(testProjectOutputToSlant);
TEST_CHECK(testProjectSlantToOutput);
return 0;
Expand Down
13 changes: 8 additions & 5 deletions six/modules/python/six/tests/runUnitTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,29 @@

import os
from subprocess import call
import sys

import utils

def run():
install = utils.installPath()
unitTestDir = os.path.join(install, 'unittests')
childDirs = os.listdir(unitTestDir)
success = True
for childDir in childDirs:
for test in os.listdir(os.path.join(unitTestDir, childDir)):
print(os.path.join(unitTestDir, childDir, test))
testPathname = os.path.join(unitTestDir, childDir, test)
command = [utils.executableName(testPathname)]
if test.endswith('.py'):
command = ['python'] + command
command = ['python', testPathname]
else:
command = [utils.executableName(testPathname)]
if call(command) != 0:
success = False
print('{} failed'.format(testPathname))
return False

return success
return True

if __name__ == '__main__':
utils.setPaths()
run()

0 comments on commit 65cd8a2

Please sign in to comment.