-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Fix run-unit-tests issue with finding acroname #8444
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,9 @@ | |
| # otherwise pyrs other than what we compiled might be found... | ||
| sys.path = list() | ||
| sys.path.append( '' ) # directs Python to search modules in the current directory first | ||
| sys.path.append( os.path.dirname( sys.executable )) | ||
| sys.path.append( os.path.join( os.path.dirname( sys.executable ), 'DLLs' )) | ||
| sys.path.append( os.path.join( os.path.dirname( sys.executable ), 'lib' )) | ||
| # Add our py/ module directory | ||
| current_dir = os.path.dirname( os.path.abspath( __file__ )) | ||
| sys.path.append( current_dir + os.sep + "py" ) | ||
|
|
@@ -194,7 +197,7 @@ def grep( expr, *args ): | |
| context['filename'] = filename | ||
| with open( filename, errors = 'ignore' ) as file: | ||
| for line in grep_( pattern, remove_newlines( file ), context ): | ||
| yield context | ||
| yield line | ||
|
|
||
| def cat( filename ): | ||
| with open( filename, errors = 'ignore' ) as file: | ||
|
|
@@ -279,16 +282,16 @@ def __init__( self, source, line_prefix ): | |
| if directive == 'device': | ||
| log.d( ' configuration:', params ) | ||
| if not params: | ||
| log.e( source + '+' + str(context.index) + ': device directive with no devices listed' ) | ||
| log.e( source + '+' + str(context['index']) + ': device directive with no devices listed' ) | ||
| else: | ||
| self._configurations.append( params ) | ||
| elif directive == 'priority': | ||
| if len(params) == 1 and params[0].isdigit(): | ||
| self._priority = int( params[0] ) | ||
| else: | ||
| log.e( source + '+' + str(context.index) + ': priority directive with invalid parameters:', params ) | ||
| log.e( source + '+' + str(context['index']) + ': priority directive with invalid parameters:', params ) | ||
| else: | ||
| log.e( source + '+' + str(context.index) + ': invalid directive "' + directive + '"; ignoring' ) | ||
| log.e( source + '+' + str(context['index']) + ': invalid directive "' + directive + '"; ignoring' ) | ||
|
|
||
|
|
||
| class Test(ABC): # Abstract Base Class | ||
|
|
@@ -503,10 +506,11 @@ def devices_by_test_config( test ): | |
| def test_wrapper( test, configuration = None ): | ||
| global n_tests | ||
| n_tests += 1 | ||
| if configuration: | ||
| log.progress( '[' + ' '.join( configuration ) + ']', test.name, '...' ) | ||
| else: | ||
| log.progress( test.name, '...' ) | ||
| if not log.is_debug_on() or log.is_color_on(): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add the color check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If color is on, then the terminal supports advanced controls and progress will not stay on-screen. I wanted to avoid the progress since debug includes the same information, for readability on the libci logs. But when I run it locally, I run with debug and I have color, so it still shows progress... |
||
| if configuration: | ||
| log.progress( '[' + ' '.join( configuration ) + ']', test.name, '...' ) | ||
| else: | ||
| log.progress( test.name, '...' ) | ||
| test.run_test() | ||
|
|
||
|
|
||
|
|
||
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.
If we want to use a third party lib like numpy in our test it will not work right?
If yes, than we need to think of another way to solve this.
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.
Right, it won't work (unless numpy isn't in site-packages) unless the module is in lib/.
One thing I can do is remove site-packages before loading librealsense, but it's hard to control when a script imports pyrs.
For now, it'll work.