File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,26 @@ module.exports = function () {
5151 } else {
5252 this . TERMSIGNAL = 'SIGTERM' ;
5353 this . EXE = '' ;
54- // TODO autodetect if this was build with shared or static libraries
55- this . LIB = process . env . BUILD_SHARED_LIBS && '.so' || '.a' ;
54+
55+ // heuristically detect .so/.a suffix
56+ this . LIB = null ;
57+
58+ try {
59+ const dot_a = util . format ( '%s/libosrm%s' , this . BIN_PATH , '.a' ) ;
60+ fs . accessSync ( dot_a , fs . F_OK ) ;
61+ this . LIB = '.a' ;
62+ } catch ( e ) { /*nop*/ }
63+
64+ try {
65+ const dot_so = util . format ( '%s/libosrm%s' , this . BIN_PATH , '.so' ) ;
66+ fs . accessSync ( dot_so , fs . F_OK ) ;
67+ this . LIB = '.so' ;
68+ } catch ( e ) { /*nop*/ }
69+
70+ if ( ! this . LIB ) {
71+ throw new Error ( '*** Unable to detect dynamic or static libosrm libraries' ) ;
72+ }
73+
5674 this . QQ = '' ;
5775 }
5876
@@ -65,7 +83,7 @@ module.exports = function () {
6583
6684 // eslint-disable-next-line no-console
6785 console . info ( util . format ( 'Node Version' , process . version ) ) ;
68- if ( parseInt ( process . version . match ( / v ( \d ) / ) [ 1 ] ) < 4 ) throw new Error ( '*** PLease upgrade to Node 4.+ to run OSRM cucumber tests' ) ;
86+ if ( parseInt ( process . version . match ( / v ( \d ) / ) [ 1 ] ) < 4 ) throw new Error ( '*** Please upgrade to Node 4.+ to run OSRM cucumber tests' ) ;
6987
7088 fs . exists ( this . TEST_PATH , ( exists ) => {
7189 if ( exists )
You can’t perform that action at this time.
0 commit comments