Skip to content
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

TIMOB-8944: BlackBerry: BlackBerry: Connect drillbit to BB simulator or device #64

Merged
merged 4 commits into from May 31, 2012

Conversation

dlifshitz-maca
Copy link

Reviewers: Alex, David C
Note: only review from 6f2d4fa

[Issues Fixed]
TIMOB-8944: BlackBerry: BlackBerry: Connect drillbit to BB simulator or device

[Changes]
blackberry.js

  • function run
    • removed useless blackberrySimulatorProcess
    • remember readLineCb
  • function launchTestHarness
    • when finished starting up the test harness, capture the logs and check the exit code
  • added stub function handleCompleteBlackBerryEvent

blackberryndk.py

  • added functions printExitCode, _isAppRunning, _printAppLog, appLog

devicemanagement.py

  • added commands and functions printExitCode, appLog

[Tests]
Test 1: Run drillbit

  1. Run scons to build the mobile sdk
  2. Run the following command:
    drillbit\drillbit.py --platforms=blackberry
  3. Click "run tests"
  4. Verify the test_harness app is built, deployed, and run
  5. Close the app on the simulator
  6. Verify the logs are printed
    Note: The test will not finish because the app was closed manually (not what should happen) and the framework doesn't yet output the Ti logging.
    If you want to see the test fail when the app crashes, put a return -1; in tibbapp/main.cpp.

…or device

[Issues Fixed]
TIMOB-8944: BlackBerry: BlackBerry: Connect drillbit to BB simulator or device

[Changes]
blackberry.js
- function run
  - removed useless blackberrySimulatorProcess
  - remember readLineCb
- function launchTestHarness
  - when finished starting up the test harness, capture the logs and check the exit code
- added stub function handleCompleteBlackBerryEvent

blackberryndk.py
- added functions printExitCode, _isAppRunning, _printAppLog, appLog

devicemanagement.py
- added commands and functions printExitCode, appLog

[Tests]
Test 1: Run drillbit
1) Run scons to build the mobile sdk
2) Run the following command:
drillbit\drillbit.py --platforms=blackberry
3) Click "run tests"
4) Verify the test_harness app is built, deployed, and run
5) Close the app on the simulator
6) Verify the logs are printed
Note: The test will not finish because the app was closed manually (not what should happen) and the framework doesn't yet output the Ti logging.
If you want to see the test fail when the app crashes, put a return -1; in tibbapp/main.cpp.
@alexandergalstyan
Copy link

Got following error while run tests:
Traceback (most recent call last):
File "D:\Projects\Appcelerator\tisdk\titanium_mobile\dist\mobilesdk\win32\2.0.0\blackberry\builder.py", line 102, in
builder = Builder(args.project_path.decode('utf-8'), args.type.decode('utf-8'), bbndk)
File "D:\Projects\Appcelerator\tisdk\titanium_mobile\dist\mobilesdk\win32\2.0.0\blackberry\builder.py", line 34, in init
tiappxml = TiAppXML(project_tiappxml)
File "D:\Projects\Appcelerator\tisdk\titanium_mobile\dist\mobilesdk\win32\2.0.0\tiapp.py", line 54, in init
self.dom = parseString(data.read().encode('utf-8'))
File "C:\bbndk-10.0.4\host\win32\x86\usr\bin\lib\xml\dom\minidom.py", line 1923, in parseString
from xml.dom import expatbuilder
File "C:\bbndk-10.0.4\host\win32\x86\usr\bin\lib\xml\dom\expatbuilder.py", line 32, in
from xml.parsers import expat
File "C:\bbndk-10.0.4\host\win32\x86\usr\bin\lib\xml\parsers\expat.py", line 4, in
from pyexpat import *
ImportError: No module named pyexpat

@alexandergalstyan
Copy link

Tries to install pyxml, but that doesn't help

@dlifshitz-maca
Copy link
Author

That is very odd, but I don't see how my patch could have caused it. Can you try without this patch and check if the problem still exists?

@alexandergalstyan
Copy link

The same on clean branch for me.

process.setOnReadLine(function(data) {
var lines = data.split("\n");
lines.forEach(function(line) {
if (line.indexOf("result::") === 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=== ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Javascript, the == operator is a loose comparison so "0" == 0 is true. The === operator forces a stricter comparison so "0" === 0 is false. It's the same with !== below. Appcelerator's convention is to use === and !== when possible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, ignore then

@alexandergalstyan
Copy link

approved

dlifshitz-maca added a commit that referenced this pull request May 31, 2012
TIMOB-8944: BlackBerry: BlackBerry: Connect drillbit to BB simulator or device
@dlifshitz-maca dlifshitz-maca merged commit 05f5605 into Macadamian:blackberry May 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants