Skip to content

Commit 0279390

Browse files
authored
Reg-test python scripts: fix issue where directory returned is empty (#1021)
When the string is empty, we had been adding "/lib" to the path instead of "./lib", which then causes the scripts to fail to find the library files.
1 parent 36244ba commit 0279390

12 files changed

+12
-12
lines changed

reg_tests/executeAerodynRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.dirname(__file__)
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

reg_tests/executeBeamdynRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.dirname(__file__)
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

reg_tests/executeFASTFarmRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.sep.join(sys.argv[0].split(os.path.sep)[:-1]) if os.path.sep in sys.argv[0] else "."
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

reg_tests/executeHydrodynRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.dirname(__file__)
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

reg_tests/executeInflowwindPyRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.sep.join(sys.argv[0].split(os.path.sep)[:-1]) if os.path.sep in sys.argv[0] else "."
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

reg_tests/executeInflowwindRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.sep.join(sys.argv[0].split(os.path.sep)[:-1]) if os.path.sep in sys.argv[0] else "."
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

reg_tests/executeOpenfastAeroAcousticRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import os
2727
import sys
28-
basepath = os.path.dirname(__file__)
28+
basepath = os.path.dirname(os.path.abspath(__file__))
2929
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
3030
import argparse
3131
import shutil

reg_tests/executeOpenfastCppRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import os
1818
import sys
19-
basepath = os.path.dirname(__file__)
19+
basepath = os.path.dirname(os.path.abspath(__file__))
2020
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2121
import argparse
2222
import shutil

reg_tests/executeOpenfastLinearRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.dirname(__file__)
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

reg_tests/executeOpenfastRegressionCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import os
2626
import sys
27-
basepath = os.path.dirname(__file__)
27+
basepath = os.path.dirname(os.path.abspath(__file__))
2828
sys.path.insert(0, os.path.sep.join([basepath, "lib"]))
2929
import argparse
3030
import shutil

0 commit comments

Comments
 (0)