mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-20 10:28:05 +00:00
upgrade RN in test app + fix simulators handling + fix test app to run tests immediatelly and exit afterwards
This commit is contained in:
parent
92ab314ba5
commit
7e8b7d7bab
9
scripts/find-ios-runtime.rb
Normal file
9
scripts/find-ios-runtime.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/ruby
|
||||||
|
|
||||||
|
require 'json'
|
||||||
|
|
||||||
|
runtime = JSON.parse(%x{xcrun simctl list devices --json})['runtimes']
|
||||||
|
.select{|x| (x['identifier'].include? 'com.apple.CoreSimulator.SimRuntime.iOS') &&
|
||||||
|
(x['availability'] == "(available)")}[0]["identifier"]
|
||||||
|
|
||||||
|
puts runtime
|
142
scripts/test.sh
142
scripts/test.sh
@ -23,6 +23,8 @@ if [ -n "${JENKINS_HOME}" ]; then
|
|||||||
CI_RUN=true
|
CI_RUN=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SIM_DEVICE_NAME=realm-js-test
|
||||||
|
|
||||||
# Start current working directory at the root of the project.
|
# Start current working directory at the root of the project.
|
||||||
cd "$SRCROOT"
|
cd "$SRCROOT"
|
||||||
|
|
||||||
@ -98,6 +100,10 @@ cleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open_chrome() {
|
open_chrome() {
|
||||||
|
if [ $CONFIGURATION == 'Release' ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
local dir
|
local dir
|
||||||
for dir in "$HOME/Applications" "/Applications"; do
|
for dir in "$HOME/Applications" "/Applications"; do
|
||||||
if [ -d "$dir/Google Chrome.app" ]; then
|
if [ -d "$dir/Google Chrome.app" ]; then
|
||||||
@ -124,122 +130,52 @@ start_packager() {
|
|||||||
xctest() {
|
xctest() {
|
||||||
setup_ios_simulator
|
setup_ios_simulator
|
||||||
|
|
||||||
# - Wait until the simulator is fully booted by waiting for it to launch SpringBoard
|
|
||||||
printf "Waiting for springboard to ensure device is ready..."
|
|
||||||
xcrun simctl launch "$IOS_SIM_DEVICE" com.apple.springboard 1>/dev/null 2>/dev/null || true
|
|
||||||
echo " done"
|
|
||||||
|
|
||||||
# - Run the build and test
|
# - Run the build and test
|
||||||
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$IOS_SIM_DEVICE" build || {
|
echo "Building application"
|
||||||
|
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="${IOS_SIM_DEVICE_ID}" -derivedDataPath ./build build || {
|
||||||
EXITCODE=$?
|
EXITCODE=$?
|
||||||
echo "*** Failure (exit code $EXITCODE). ***"
|
echo "*** Failure (exit code $EXITCODE). ***"
|
||||||
exit $EXITCODE
|
exit $EXITCODE
|
||||||
}
|
}
|
||||||
if [ -n "$XCPRETTY" ]; then
|
|
||||||
log_temp=$(mktemp build.log.XXXXXX)
|
echo "Installing application on ${SIM_DEVICE_NAME}"
|
||||||
if [ -e "$log_temp" ]; then
|
echo "Application Path" $(pwd)/build/Build/Products/$CONFIGURATION-iphonesimulator/ReactTests.app
|
||||||
rm "$log_temp"
|
xcrun simctl install ${SIM_DEVICE_NAME} $(pwd)/build/Build/Products/$CONFIGURATION-iphonesimulator/ReactTests.app
|
||||||
fi
|
|
||||||
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination name="iPhone 5s" test 2>&1 | tee "$log_temp" | "$XCPRETTY" -c --no-utf --report junit --output build/reports/junit.xml || {
|
|
||||||
EXITCODE=$?
|
echo "Launching application"
|
||||||
printf "*** Xcode Failure (exit code %s). The full xcode log follows: ***\n\n" "$EXITCODE"
|
xcrun simctl launch --console ${SIM_DEVICE_NAME} io.realm.ReactTests | tee out.txt
|
||||||
cat "$log_temp"
|
|
||||||
printf "\n\n*** End Xcode Failure ***\n"
|
echo "Shuttting down ${SIM_DEVICE_NAME} simulator. (device is not deleted. you can use it to debug the app)"
|
||||||
exit $EXITCODE
|
xcrun simctl shutdown ${SIM_DEVICE_NAME} || true
|
||||||
}
|
|
||||||
rm "$log_temp"
|
echo "Checking tests results"
|
||||||
|
if grep -q "REALM_FAILING_TESTS" out.txt; then
|
||||||
|
echo "*** REALM JS TESTS FAILED. See tests results above ***"
|
||||||
|
exit 20
|
||||||
else
|
else
|
||||||
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$IOS_SIM_DEVICE" test || {
|
echo "*** REALM JS TESTS SUCCESS ***"
|
||||||
EXITCODE=$?
|
|
||||||
echo "*** Failure (exit code $EXITCODE). ***"
|
|
||||||
exit $EXITCODE
|
|
||||||
}
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_ios_simulator() {
|
setup_ios_simulator() {
|
||||||
# - Ensure one version of xcode is chosen by all tools
|
shutdown_ios_simulator
|
||||||
if [[ -z "$DEVELOPER_DIR" ]]; then
|
|
||||||
DEV_DIR="$(xcode-select -p)"
|
|
||||||
export DEVELOPER_DIR=$DEV_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -- Ensure that the simulator is ready
|
#parse devices
|
||||||
|
IOS_RUNTIME=$(xcrun simctl list runtimes | grep -m1 -o '(com.apple.CoreSimulator.SimRuntime.iOS.*)' | sed 's/[()]//g')
|
||||||
|
echo using iOS Runtime ${IOS_RUNTIME} to create new simulator ${SIM_DEVICE_NAME}
|
||||||
|
|
||||||
if [ $CI_RUN == true ]; then
|
#create new test simulator
|
||||||
# - Kill the Simulator to ensure we are running the correct one, only when running in CI
|
IOS_SIM_DEVICE_ID=$(xcrun simctl create ${SIM_DEVICE_NAME} com.apple.CoreSimulator.SimDeviceType.iPhone-SE ${IOS_RUNTIME})
|
||||||
echo "Resetting simulator using toolchain from: $DEVELOPER_DIR"
|
#boot new test simulator
|
||||||
|
xcrun simctl boot ${SIM_DEVICE_NAME}
|
||||||
|
}
|
||||||
|
|
||||||
# Quit Simulator.app to give it a chance to go down gracefully
|
shutdown_ios_simulator() {
|
||||||
local deadline=$((SECONDS+5))
|
#shutdown test simulator
|
||||||
while pgrep -qx Simulator && [ $SECONDS -lt $deadline ]; do
|
xcrun simctl shutdown ${SIM_DEVICE_NAME} || true
|
||||||
osascript -e 'tell app "Simulator" to quit without saving' || true
|
#delete test simulator
|
||||||
sleep 0.25 # otherwise the pkill following will get it too early
|
xcrun simctl delete ${SIM_DEVICE_NAME} || true
|
||||||
done
|
|
||||||
|
|
||||||
# stop CoreSimulatorService
|
|
||||||
launchctl remove com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null || true
|
|
||||||
sleep 0.25 # launchtl can take a small moment to kill services
|
|
||||||
|
|
||||||
# kill them with fire
|
|
||||||
while pgrep -qx Simulator com.apple.CoreSimulator.CoreSimulatorService; do
|
|
||||||
pkill -9 -x Simulator com.apple.CoreSimulator.CoreSimulatorService || true
|
|
||||||
sleep 0.05
|
|
||||||
done
|
|
||||||
|
|
||||||
# - Prod `simctl` a few times as sometimes it fails the first couple of times after switching XCode vesions
|
|
||||||
local deadline=$((SECONDS+5))
|
|
||||||
while [ -z "$(xcrun simctl list devices 2>/dev/null)" ] && [ $SECONDS -lt $deadline ]; do
|
|
||||||
: # nothing to see here, will stop cycling on the first successful run
|
|
||||||
done
|
|
||||||
|
|
||||||
# - Choose a device, if it has not already been chosen
|
|
||||||
local deadline=$((SECONDS+5))
|
|
||||||
IOS_DEVICE=""
|
|
||||||
while [ -z "$IOS_DEVICE" ] && [ $SECONDS -lt $deadline ]; do
|
|
||||||
IOS_DEVICE="$(ruby $SRCROOT/scripts/find-ios-device.rb best)"
|
|
||||||
done
|
|
||||||
if [ -z "$IOS_DEVICE" ]; then
|
|
||||||
echo "*** Failed to determine the iOS Simulator device to use ***"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
export IOS_SIM_DEVICE=$IOS_DEVICE
|
|
||||||
|
|
||||||
# - Reset the device we will be using if running in CI
|
|
||||||
xcrun simctl shutdown "$IOS_SIM_DEVICE" 1>/dev/null 2>/dev/null || true # sometimes simctl gets confused
|
|
||||||
xcrun simctl erase "$IOS_SIM_DEVICE"
|
|
||||||
|
|
||||||
# - Start the target in Simulator.app
|
|
||||||
# Note: as of Xcode 7.3.1 `simctl` can not completely boot a simulator, specifically it can not bring up backboard, so GUI apps can not run.
|
|
||||||
# This is fixed in version 8 of Xcode, but we still need the compatibility
|
|
||||||
|
|
||||||
"$DEVELOPER_DIR/Applications/Simulator.app/Contents/MacOS/Simulator" -CurrentDeviceUDID "$IOS_SIM_DEVICE" & # will get killed with all other children at exit
|
|
||||||
startedSimulator=true
|
|
||||||
|
|
||||||
else
|
|
||||||
# - ensure that the simulator is running on a developer's workstation
|
|
||||||
open "$DEVELOPER_DIR/Applications/Simulator.app"
|
|
||||||
|
|
||||||
# - Select the first device booted in the simulator, since it will boot something for us
|
|
||||||
local deadline=$((SECONDS+10))
|
|
||||||
IOS_DEVICE=""
|
|
||||||
while [ -z "$IOS_DEVICE" ] && [ $SECONDS -lt $deadline ]; do
|
|
||||||
IOS_DEVICE="$(ruby $SRCROOT/scripts/find-ios-device.rb booted)"
|
|
||||||
done
|
|
||||||
if [ -z "$IOS_DEVICE" ]; then
|
|
||||||
echo "*** Failed to determine the iOS Simulator device in use ***"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
export IOS_SIM_DEVICE=$IOS_DEVICE
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Wait until the boot completes
|
|
||||||
printf " waiting for simulator (%s) to boot..." "$IOS_SIM_DEVICE"
|
|
||||||
until ruby -rjson -e "exit JSON.parse(%x{xcrun simctl list devices --json})['devices'].flat_map { |d| d[1] }.any? { |d| d['availability'] == '(available)' && d['state'] == 'Booted' }"; do
|
|
||||||
sleep 0.25
|
|
||||||
done
|
|
||||||
echo " done"
|
|
||||||
echo "It will take some time before the simulator is fully ready, continuing on to other work"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cleanup now and also cleanup when this script exits.
|
# Cleanup now and also cleanup when this script exits.
|
||||||
|
@ -56,7 +56,7 @@ function runTests() {
|
|||||||
|
|
||||||
return Object.keys(testNames).reduce((suitePromiseChain, suiteName) => {
|
return Object.keys(testNames).reduce((suitePromiseChain, suiteName) => {
|
||||||
return suitePromiseChain.then(() => {
|
return suitePromiseChain.then(() => {
|
||||||
console.log('Starting ' + suiteName);
|
console.warn('Starting ' + suiteName);
|
||||||
|
|
||||||
return testNames[suiteName].reduce((testPromiseChain, testName) => {
|
return testNames[suiteName].reduce((testPromiseChain, testName) => {
|
||||||
return testPromiseChain.then(() => {
|
return testPromiseChain.then(() => {
|
||||||
@ -64,7 +64,7 @@ function runTests() {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
return RealmTests.runTest(suiteName, testName);
|
return RealmTests.runTest(suiteName, testName);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.log('+ ' + testName);
|
console.warn('+ ' + testName);
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
console.warn('- ' + testName);
|
console.warn('- ' + testName);
|
||||||
console.warn(err.message || err);
|
console.warn(err.message || err);
|
||||||
|
@ -203,7 +203,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
assertType: function(value, type, depth) {
|
assertType: function(value, type, depth) {
|
||||||
this.assertEqual(typeof value, type, `Value ${value} expected to be of type ${type}`, 1 + depth || 0);
|
try {
|
||||||
|
this.assertEqual(typeof value, type, "", 1 + depth || 0);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
throw new Error(`Value ${value} expected to be of type ${type}`)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
assertDefined: function(value, errorMessage, depth) {
|
assertDefined: function(value, errorMessage, depth) {
|
||||||
|
@ -114,7 +114,7 @@ exports.runTest = function(suiteName, testName) {
|
|||||||
if (testMethod) {
|
if (testMethod) {
|
||||||
// Start fresh in case of a crash in a previous run.
|
// Start fresh in case of a crash in a previous run.
|
||||||
Realm.clearTestState();
|
Realm.clearTestState();
|
||||||
console.log("Starting test " + testName);
|
console.warn("Starting test " + testName);
|
||||||
var promise;
|
var promise;
|
||||||
try {
|
try {
|
||||||
promise = testMethod.call(testSuite);
|
promise = testMethod.call(testSuite);
|
||||||
|
@ -32,7 +32,6 @@ const DATE3 = new Date(3);
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
testListConstructor: function() {
|
testListConstructor: function() {
|
||||||
const realm = new Realm({schema: [schemas.PersonObject, schemas.PersonList]});
|
const realm = new Realm({schema: [schemas.PersonObject, schemas.PersonList]});
|
||||||
|
|
||||||
realm.write(() => {
|
realm.write(() => {
|
||||||
let obj = realm.create('PersonList', {list: []});
|
let obj = realm.create('PersonList', {list: []});
|
||||||
TestCase.assertInstanceOf(obj.list, Realm.List);
|
TestCase.assertInstanceOf(obj.list, Realm.List);
|
||||||
@ -40,7 +39,6 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
TestCase.assertThrowsContaining(() => new Realm.List(), 'constructor');
|
TestCase.assertThrowsContaining(() => new Realm.List(), 'constructor');
|
||||||
|
|
||||||
TestCase.assertType(Realm.List, 'function');
|
TestCase.assertType(Realm.List, 'function');
|
||||||
TestCase.assertInstanceOf(Realm.List, Function);
|
TestCase.assertInstanceOf(Realm.List, Function);
|
||||||
},
|
},
|
||||||
|
@ -415,6 +415,7 @@ module.exports = {
|
|||||||
realm2.write(function() {
|
realm2.write(function() {
|
||||||
object4 = realm2.create('TestObject', {doubleCol: 1});
|
object4 = realm2.create('TestObject', {doubleCol: 1});
|
||||||
});
|
});
|
||||||
|
|
||||||
TestCase.assertThrows(function() {
|
TestCase.assertThrows(function() {
|
||||||
objects.indexOf(object4);
|
objects.indexOf(object4);
|
||||||
});
|
});
|
||||||
@ -423,7 +424,7 @@ module.exports = {
|
|||||||
testAddListener: function() {
|
testAddListener: function() {
|
||||||
if (typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent)) { // eslint-disable-line no-undef
|
if (typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent)) { // eslint-disable-line no-undef
|
||||||
// FIXME: async callbacks do not work correctly in Chrome debugging mode
|
// FIXME: async callbacks do not work correctly in Chrome debugging mode
|
||||||
return;
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
const realm = new Realm({ schema: [schemas.TestObject] });
|
const realm = new Realm({ schema: [schemas.TestObject] });
|
||||||
@ -433,29 +434,28 @@ module.exports = {
|
|||||||
realm.create('TestObject', { doubleCol: 3 });
|
realm.create('TestObject', { doubleCol: 3 });
|
||||||
});
|
});
|
||||||
|
|
||||||
let resolve, first = true;
|
let resolve = () => {};
|
||||||
|
let first = true;
|
||||||
|
|
||||||
|
realm.objects('TestObject').addListener((testObjects, changes) => {
|
||||||
|
if (first) {
|
||||||
|
TestCase.assertEqual(testObjects.length, 3);
|
||||||
|
TestCase.assertEqual(changes.insertions.length, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TestCase.assertEqual(testObjects.length, 4);
|
||||||
|
TestCase.assertEqual(changes.insertions.length, 1);
|
||||||
|
}
|
||||||
|
first = false;
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
|
||||||
return new Promise((r, _reject) => {
|
return new Promise((r, _reject) => {
|
||||||
resolve = r;
|
resolve = r;
|
||||||
realm.objects('TestObject').addListener((testObjects, changes) => {
|
|
||||||
if (first) {
|
|
||||||
TestCase.assertEqual(testObjects.length, 3);
|
|
||||||
TestCase.assertEqual(changes.insertions.length, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
TestCase.assertEqual(testObjects.length, 4);
|
|
||||||
TestCase.assertEqual(changes.insertions.length, 1);
|
|
||||||
}
|
|
||||||
first = false;
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}).then(() => {
|
|
||||||
return new Promise((r, _reject) => {
|
|
||||||
realm.write(() => {
|
realm.write(() => {
|
||||||
realm.create('TestObject', { doubleCol: 1 });
|
realm.create('TestObject', { doubleCol: 1 });
|
||||||
});
|
});
|
||||||
resolve = r;
|
|
||||||
});
|
});
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
testResultsAggregateFunctions: function() {
|
testResultsAggregateFunctions: function() {
|
||||||
|
@ -137,6 +137,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
compile project(':react-native-exception-handler')
|
||||||
|
compile project(':react-native-exit-app-no-history')
|
||||||
compile fileTree(dir: "libs", include: ["*.jar"])
|
compile fileTree(dir: "libs", include: ["*.jar"])
|
||||||
compile "com.android.support:appcompat-v7:23.0.1"
|
compile "com.android.support:appcompat-v7:23.0.1"
|
||||||
compile "com.facebook.react:react-native:+" // From node_modules
|
compile "com.facebook.react:react-native:+" // From node_modules
|
||||||
|
@ -4,6 +4,8 @@ import android.app.Application;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.facebook.react.ReactApplication;
|
import com.facebook.react.ReactApplication;
|
||||||
|
import com.masteratul.exceptionhandler.ReactNativeExceptionHandlerPackage;
|
||||||
|
import com.github.wumke.RNExitApp.RNExitAppPackage;
|
||||||
import com.facebook.react.ReactInstanceManager;
|
import com.facebook.react.ReactInstanceManager;
|
||||||
import com.facebook.react.ReactNativeHost;
|
import com.facebook.react.ReactNativeHost;
|
||||||
import com.facebook.react.ReactPackage;
|
import com.facebook.react.ReactPackage;
|
||||||
@ -28,6 +30,8 @@ public class MainApplication extends Application implements ReactApplication {
|
|||||||
protected List<ReactPackage> getPackages() {
|
protected List<ReactPackage> getPackages() {
|
||||||
return Arrays.<ReactPackage>asList(
|
return Arrays.<ReactPackage>asList(
|
||||||
new MainReactPackage(),
|
new MainReactPackage(),
|
||||||
|
new ReactNativeExceptionHandlerPackage(),
|
||||||
|
new RNExitAppPackage(),
|
||||||
new RNFSPackage(),
|
new RNFSPackage(),
|
||||||
new RealmReactPackage()
|
new RealmReactPackage()
|
||||||
);
|
);
|
||||||
|
@ -7,3 +7,8 @@ project(':realm').projectDir = new File(settingsDir, '../node_modules/realm/andr
|
|||||||
|
|
||||||
include ':react-native-fs'
|
include ':react-native-fs'
|
||||||
project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android')
|
project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android')
|
||||||
|
|
||||||
|
include ':react-native-exception-handler'
|
||||||
|
project(':react-native-exception-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exception-handler/android')
|
||||||
|
include ':react-native-exit-app-no-history'
|
||||||
|
project(':react-native-exit-app-no-history').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exit-app-no-history/android')
|
||||||
|
@ -19,23 +19,109 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
Alert,
|
||||||
AppRegistry,
|
AppRegistry,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
|
|
||||||
|
import builder from 'xmlbuilder';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { runTests } from './tests';
|
import { getTestNames, runTest } from './tests';
|
||||||
|
import RNFS from 'react-native-fs';
|
||||||
|
import RNExitApp from 'react-native-exit-app-no-history';
|
||||||
|
|
||||||
|
// import {setJSExceptionHandler} from 'react-native-exception-handler';
|
||||||
|
// import {setNativeExceptionHandler} from 'react-native-exception-handler/index';
|
||||||
|
|
||||||
|
// setNativeExceptionHandler((exceptionString) => {
|
||||||
|
// console.error("\nRealm Tests App FAILED. NATIVE ERROR\n");
|
||||||
|
// console.error(`\n${exceptionString}\n`);
|
||||||
|
// RNExitApp.exitApp();
|
||||||
|
// });
|
||||||
|
|
||||||
|
// //unhandled JS exceptions handler
|
||||||
|
// setJSExceptionHandler((error, isFatal) => {
|
||||||
|
// console.error("\nRealm Tests App FAILED. JS ERROR\n");
|
||||||
|
// console.error(`\n${error}\n`);
|
||||||
|
// RNExitApp.exitApp();
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async function runTests() {
|
||||||
|
try {
|
||||||
|
let testNames = getTestNames();
|
||||||
|
let rootXml = builder.create('testsuites');
|
||||||
|
let failingTests = [];
|
||||||
|
for (let suiteName in testNames) {
|
||||||
|
let itemTestsuite = rootXml.ele('testsuite');
|
||||||
|
let nbrTests = 0;
|
||||||
|
let nbrFailures = 0;
|
||||||
|
|
||||||
|
console.error('Starting ' + suiteName);
|
||||||
|
|
||||||
|
for (let testName of testNames[suiteName]) {
|
||||||
|
nbrTests++;
|
||||||
|
|
||||||
|
let itemTest = itemTestsuite.ele('testcase');
|
||||||
|
itemTest.att('name', testName);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await runTest(suiteName, testName);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
failingTests.push(`${suiteName}: ${testName} : Error ${e.message}`);
|
||||||
|
itemTest.ele('error', {'message': e.message, 'stacktrace': e.stack}, e.toString());
|
||||||
|
nbrFailures++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update Junit XML report
|
||||||
|
itemTestsuite.att('name', suiteName);
|
||||||
|
itemTestsuite.att('tests', nbrTests);
|
||||||
|
itemTestsuite.att('failures', nbrFailures);
|
||||||
|
itemTestsuite.att('timestamp', "2016-01-22T14:40:44.874443-05:00");//TODO use real timestamp
|
||||||
|
|
||||||
|
}
|
||||||
|
// export unit tests results
|
||||||
|
let xmlString = rootXml.end({
|
||||||
|
pretty: true,
|
||||||
|
indent: ' ',
|
||||||
|
newline: '\n',
|
||||||
|
});
|
||||||
|
|
||||||
|
// write the unit tests reports
|
||||||
|
const path = RNFS.MainBundlePath + "/tests.xml";
|
||||||
|
await RNFS.writeFile(path, xmlString, 'utf8');
|
||||||
|
|
||||||
|
//using console.log output is not shown in Release builds. using console.warn
|
||||||
|
console.warn(xmlString);
|
||||||
|
console.warn('__REALM_REACT_IOS_TESTS_COMPLETED__');
|
||||||
|
if (failingTests.length !== 0) {
|
||||||
|
console.error('\n\nREALM_FAILING_TESTS\n');
|
||||||
|
console.error(failingTests);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
console.warn("Realm iOS Tests App finished. Exiting. Disable this to debug the app locally");
|
||||||
|
RNExitApp.exitApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ReactTests extends React.Component {
|
class ReactTests extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
|
runTests();
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.button} onPress={runTests}>
|
|
||||||
Tap to Run Tests
|
|
||||||
</Text>
|
|
||||||
<Text style={styles.instructions}>
|
<Text style={styles.instructions}>
|
||||||
|
{'\n'}REALM-JS TESTS{'\n'}
|
||||||
|
|
||||||
Press Cmd+R to reload,{'\n'}
|
Press Cmd+R to reload,{'\n'}
|
||||||
Cmd+D or shake for dev menu
|
Cmd+D or shake for dev menu
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -21,7 +21,9 @@
|
|||||||
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||||
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
|
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
|
||||||
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
|
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
|
||||||
|
1A31425AAD0B4731BDD7361C /* libReactNativeExceptionHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BDA39DE0BF646F2AF670F18 /* libReactNativeExceptionHandler.a */; };
|
||||||
1A9D2B80E7D649D2B5D8FE09 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E45185577984C00AA740BFE /* libz.tbd */; };
|
1A9D2B80E7D649D2B5D8FE09 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E45185577984C00AA740BFE /* libz.tbd */; };
|
||||||
|
1C2471A6B2544BF3BD9D9C10 /* libRNExitApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DAA9FCB85294F77873D2769 /* libRNExitApp.a */; };
|
||||||
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
|
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
|
||||||
66DA50ADC4F24D88856B9051 /* libRealmReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 629FEF95D64747E9A56D4D0C /* libRealmReact.a */; };
|
66DA50ADC4F24D88856B9051 /* libRealmReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 629FEF95D64747E9A56D4D0C /* libRealmReact.a */; };
|
||||||
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
|
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
|
||||||
@ -31,6 +33,7 @@
|
|||||||
855301D31E2006F700FF108E /* RealmReactTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 855301D11E2006F400FF108E /* RealmReactTests.m */; };
|
855301D31E2006F700FF108E /* RealmReactTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 855301D11E2006F400FF108E /* RealmReactTests.m */; };
|
||||||
A4CEF4BB1F7F862D00BA3B26 /* sync-v1.realm in Resources */ = {isa = PBXBuildFile; fileRef = A4CEF4BA1F7F862D00BA3B26 /* sync-v1.realm */; };
|
A4CEF4BB1F7F862D00BA3B26 /* sync-v1.realm in Resources */ = {isa = PBXBuildFile; fileRef = A4CEF4BA1F7F862D00BA3B26 /* sync-v1.realm */; };
|
||||||
E2050A7A5BE14CEA9A9E0722 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B37A7097A134D5CBB4C462A /* libc++.tbd */; };
|
E2050A7A5BE14CEA9A9E0722 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B37A7097A134D5CBB4C462A /* libc++.tbd */; };
|
||||||
|
FD7EF00801C34983A6188E6E /* libRNFS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EBE9BC51D4A4EF79B40A51A /* libRNFS.a */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@ -223,6 +226,90 @@
|
|||||||
remoteGlobalIDString = F60690131CA2766F0003FB26;
|
remoteGlobalIDString = F60690131CA2766F0003FB26;
|
||||||
remoteInfo = RealmReact;
|
remoteInfo = RealmReact;
|
||||||
};
|
};
|
||||||
|
A474395F1FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
|
||||||
|
remoteInfo = fishhook;
|
||||||
|
};
|
||||||
|
A47439611FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
|
||||||
|
remoteInfo = "fishhook-tvOS";
|
||||||
|
};
|
||||||
|
A47439711FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
|
||||||
|
remoteInfo = "third-party";
|
||||||
|
};
|
||||||
|
A47439731FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
|
||||||
|
remoteInfo = "third-party-tvOS";
|
||||||
|
};
|
||||||
|
A47439751FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 139D7E881E25C6D100323FB7;
|
||||||
|
remoteInfo = "double-conversion";
|
||||||
|
};
|
||||||
|
A47439771FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
|
||||||
|
remoteInfo = "double-conversion-tvOS";
|
||||||
|
};
|
||||||
|
A47439791FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
|
||||||
|
remoteInfo = privatedata;
|
||||||
|
};
|
||||||
|
A474397B1FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
|
||||||
|
remoteInfo = "privatedata-tvOS";
|
||||||
|
};
|
||||||
|
A47439801FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = FC81504B0B8B47808E93B553 /* RNFS.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = F12AFB9B1ADAF8F800E0535D;
|
||||||
|
remoteInfo = RNFS;
|
||||||
|
};
|
||||||
|
A47439821FCF49A00034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = FC81504B0B8B47808E93B553 /* RNFS.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 6456441F1EB8DA9100672408;
|
||||||
|
remoteInfo = "RNFS-tvOS";
|
||||||
|
};
|
||||||
|
A47439BA1FCF55E80034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 5E54C8D078F84427A9DEE242 /* RNExitApp.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 15209BEF1D250F63000D0F44;
|
||||||
|
remoteInfo = RNExitApp;
|
||||||
|
};
|
||||||
|
A47439F11FCF586E0034D32F /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = E65B8206DCD647B896F86688 /* ReactNativeExceptionHandler.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 134814201AA4EA6300B7C361;
|
||||||
|
remoteInfo = ReactNativeExceptionHandler;
|
||||||
|
};
|
||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
@ -245,8 +332,10 @@
|
|||||||
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
|
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
|
||||||
193A0C4F1D2C485DBE5ACC72 /* RealmReact.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RealmReact.xcodeproj; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = "<group>"; };
|
193A0C4F1D2C485DBE5ACC72 /* RealmReact.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RealmReact.xcodeproj; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = "<group>"; };
|
||||||
4E45185577984C00AA740BFE /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
|
4E45185577984C00AA740BFE /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
|
||||||
|
5E54C8D078F84427A9DEE242 /* RNExitApp.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNExitApp.xcodeproj; path = "../node_modules/react-native-exit-app-no-history/ios/RNExitApp.xcodeproj"; sourceTree = "<group>"; };
|
||||||
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
|
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
|
||||||
629FEF95D64747E9A56D4D0C /* libRealmReact.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRealmReact.a; sourceTree = "<group>"; };
|
629FEF95D64747E9A56D4D0C /* libRealmReact.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRealmReact.a; sourceTree = "<group>"; };
|
||||||
|
6EBE9BC51D4A4EF79B40A51A /* libRNFS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFS.a; sourceTree = "<group>"; };
|
||||||
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
|
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
|
||||||
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
|
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
|
||||||
8553016A1E1FF6D500FF108E /* RealmJSTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RealmJSTests.mm; path = ../../ios/RealmJSTests.mm; sourceTree = "<group>"; };
|
8553016A1E1FF6D500FF108E /* RealmJSTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RealmJSTests.mm; path = ../../ios/RealmJSTests.mm; sourceTree = "<group>"; };
|
||||||
@ -254,7 +343,11 @@
|
|||||||
855301CE1E20069D00FF108E /* dates-v5.realm */ = {isa = PBXFileReference; lastKnownFileType = file; path = "dates-v5.realm"; sourceTree = "<group>"; };
|
855301CE1E20069D00FF108E /* dates-v5.realm */ = {isa = PBXFileReference; lastKnownFileType = file; path = "dates-v5.realm"; sourceTree = "<group>"; };
|
||||||
855301D11E2006F400FF108E /* RealmReactTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RealmReactTests.m; path = ReactTests/RealmReactTests.m; sourceTree = "<group>"; };
|
855301D11E2006F400FF108E /* RealmReactTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RealmReactTests.m; path = ReactTests/RealmReactTests.m; sourceTree = "<group>"; };
|
||||||
8B37A7097A134D5CBB4C462A /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
|
8B37A7097A134D5CBB4C462A /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
|
||||||
|
9BDA39DE0BF646F2AF670F18 /* libReactNativeExceptionHandler.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libReactNativeExceptionHandler.a; sourceTree = "<group>"; };
|
||||||
|
9DAA9FCB85294F77873D2769 /* libRNExitApp.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNExitApp.a; sourceTree = "<group>"; };
|
||||||
A4CEF4BA1F7F862D00BA3B26 /* sync-v1.realm */ = {isa = PBXFileReference; lastKnownFileType = file; path = "sync-v1.realm"; sourceTree = "<group>"; };
|
A4CEF4BA1F7F862D00BA3B26 /* sync-v1.realm */ = {isa = PBXFileReference; lastKnownFileType = file; path = "sync-v1.realm"; sourceTree = "<group>"; };
|
||||||
|
E65B8206DCD647B896F86688 /* ReactNativeExceptionHandler.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeExceptionHandler.xcodeproj; path = "../node_modules/react-native-exception-handler/ios/ReactNativeExceptionHandler.xcodeproj"; sourceTree = "<group>"; };
|
||||||
|
FC81504B0B8B47808E93B553 /* RNFS.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFS.xcodeproj; path = "../node_modules/react-native-fs/RNFS.xcodeproj"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -284,6 +377,9 @@
|
|||||||
66DA50ADC4F24D88856B9051 /* libRealmReact.a in Frameworks */,
|
66DA50ADC4F24D88856B9051 /* libRealmReact.a in Frameworks */,
|
||||||
E2050A7A5BE14CEA9A9E0722 /* libc++.tbd in Frameworks */,
|
E2050A7A5BE14CEA9A9E0722 /* libc++.tbd in Frameworks */,
|
||||||
1A9D2B80E7D649D2B5D8FE09 /* libz.tbd in Frameworks */,
|
1A9D2B80E7D649D2B5D8FE09 /* libz.tbd in Frameworks */,
|
||||||
|
FD7EF00801C34983A6188E6E /* libRNFS.a in Frameworks */,
|
||||||
|
1C2471A6B2544BF3BD9D9C10 /* libRNExitApp.a in Frameworks */,
|
||||||
|
1A31425AAD0B4731BDD7361C /* libReactNativeExceptionHandler.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -346,6 +442,8 @@
|
|||||||
children = (
|
children = (
|
||||||
139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
|
139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
|
||||||
3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */,
|
3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */,
|
||||||
|
A47439601FCF49A00034D32F /* libfishhook.a */,
|
||||||
|
A47439621FCF49A00034D32F /* libfishhook-tvOS.a */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -375,6 +473,12 @@
|
|||||||
3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,
|
3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,
|
||||||
3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,
|
3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,
|
||||||
3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,
|
3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,
|
||||||
|
A47439721FCF49A00034D32F /* libthird-party.a */,
|
||||||
|
A47439741FCF49A00034D32F /* libthird-party.a */,
|
||||||
|
A47439761FCF49A00034D32F /* libdouble-conversion.a */,
|
||||||
|
A47439781FCF49A00034D32F /* libdouble-conversion.a */,
|
||||||
|
A474397A1FCF49A00034D32F /* libprivatedata.a */,
|
||||||
|
A474397C1FCF49A00034D32F /* libprivatedata-tvOS.a */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -400,7 +504,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,
|
5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,
|
||||||
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */,
|
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -429,6 +533,9 @@
|
|||||||
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
|
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
|
||||||
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
|
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
|
||||||
193A0C4F1D2C485DBE5ACC72 /* RealmReact.xcodeproj */,
|
193A0C4F1D2C485DBE5ACC72 /* RealmReact.xcodeproj */,
|
||||||
|
FC81504B0B8B47808E93B553 /* RNFS.xcodeproj */,
|
||||||
|
5E54C8D078F84427A9DEE242 /* RNExitApp.xcodeproj */,
|
||||||
|
E65B8206DCD647B896F86688 /* ReactNativeExceptionHandler.xcodeproj */,
|
||||||
);
|
);
|
||||||
name = Libraries;
|
name = Libraries;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -486,6 +593,31 @@
|
|||||||
path = ../../data;
|
path = ../../data;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
A474394A1FCF49A00034D32F /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
A47439811FCF49A00034D32F /* libRNFS.a */,
|
||||||
|
A47439831FCF49A00034D32F /* libRNFS.a */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
A47439951FCF55E80034D32F /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
A47439BB1FCF55E80034D32F /* libRNExitApp.a */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
A47439CD1FCF586E0034D32F /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
A47439F21FCF586E0034D32F /* libReactNativeExceptionHandler.a */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
@ -596,10 +728,22 @@
|
|||||||
ProductGroup = 146834001AC3E56700842450 /* Products */;
|
ProductGroup = 146834001AC3E56700842450 /* Products */;
|
||||||
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ProductGroup = A47439CD1FCF586E0034D32F /* Products */;
|
||||||
|
ProjectRef = E65B8206DCD647B896F86688 /* ReactNativeExceptionHandler.xcodeproj */;
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ProductGroup = 855301781E1FF78600FF108E /* Products */;
|
ProductGroup = 855301781E1FF78600FF108E /* Products */;
|
||||||
ProjectRef = 193A0C4F1D2C485DBE5ACC72 /* RealmReact.xcodeproj */;
|
ProjectRef = 193A0C4F1D2C485DBE5ACC72 /* RealmReact.xcodeproj */;
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ProductGroup = A47439951FCF55E80034D32F /* Products */;
|
||||||
|
ProjectRef = 5E54C8D078F84427A9DEE242 /* RNExitApp.xcodeproj */;
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ProductGroup = A474394A1FCF49A00034D32F /* Products */;
|
||||||
|
ProjectRef = FC81504B0B8B47808E93B553 /* RNFS.xcodeproj */;
|
||||||
|
},
|
||||||
);
|
);
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
@ -764,10 +908,10 @@
|
|||||||
remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
|
remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
|
||||||
sourceTree = BUILT_PRODUCTS_DIR;
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
};
|
};
|
||||||
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = {
|
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
|
||||||
isa = PBXReferenceProxy;
|
isa = PBXReferenceProxy;
|
||||||
fileType = archive.ar;
|
fileType = archive.ar;
|
||||||
path = "libRCTAnimation-tvOS.a";
|
path = libRCTAnimation.a;
|
||||||
remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
|
remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
|
||||||
sourceTree = BUILT_PRODUCTS_DIR;
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
};
|
};
|
||||||
@ -792,6 +936,90 @@
|
|||||||
remoteRef = 855301941E1FF78600FF108E /* PBXContainerItemProxy */;
|
remoteRef = 855301941E1FF78600FF108E /* PBXContainerItemProxy */;
|
||||||
sourceTree = BUILT_PRODUCTS_DIR;
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
};
|
};
|
||||||
|
A47439601FCF49A00034D32F /* libfishhook.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = libfishhook.a;
|
||||||
|
remoteRef = A474395F1FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439621FCF49A00034D32F /* libfishhook-tvOS.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = "libfishhook-tvOS.a";
|
||||||
|
remoteRef = A47439611FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439721FCF49A00034D32F /* libthird-party.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = "libthird-party.a";
|
||||||
|
remoteRef = A47439711FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439741FCF49A00034D32F /* libthird-party.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = "libthird-party.a";
|
||||||
|
remoteRef = A47439731FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439761FCF49A00034D32F /* libdouble-conversion.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = "libdouble-conversion.a";
|
||||||
|
remoteRef = A47439751FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439781FCF49A00034D32F /* libdouble-conversion.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = "libdouble-conversion.a";
|
||||||
|
remoteRef = A47439771FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A474397A1FCF49A00034D32F /* libprivatedata.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = libprivatedata.a;
|
||||||
|
remoteRef = A47439791FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A474397C1FCF49A00034D32F /* libprivatedata-tvOS.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = "libprivatedata-tvOS.a";
|
||||||
|
remoteRef = A474397B1FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439811FCF49A00034D32F /* libRNFS.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = libRNFS.a;
|
||||||
|
remoteRef = A47439801FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439831FCF49A00034D32F /* libRNFS.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = libRNFS.a;
|
||||||
|
remoteRef = A47439821FCF49A00034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439BB1FCF55E80034D32F /* libRNExitApp.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = libRNExitApp.a;
|
||||||
|
remoteRef = A47439BA1FCF55E80034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
|
A47439F21FCF586E0034D32F /* libReactNativeExceptionHandler.a */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = archive.ar;
|
||||||
|
path = libReactNativeExceptionHandler.a;
|
||||||
|
remoteRef = A47439F11FCF586E0034D32F /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
/* End PBXReferenceProxy section */
|
/* End PBXReferenceProxy section */
|
||||||
|
|
||||||
/* Begin PBXResourcesBuildPhase section */
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
@ -889,6 +1117,9 @@
|
|||||||
LIBRARY_SEARCH_PATHS = (
|
LIBRARY_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
);
|
);
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactTests.app/ReactTests";
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactTests.app/ReactTests";
|
||||||
@ -907,6 +1138,9 @@
|
|||||||
LIBRARY_SEARCH_PATHS = (
|
LIBRARY_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
|
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||||
);
|
);
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactTests.app/ReactTests";
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactTests.app/ReactTests";
|
||||||
|
@ -3,19 +3,23 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-native start"
|
"start": "node node_modules/react-native/local-cli/cli.js start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "~16.0.0-beta.5",
|
"react": "16.0.0",
|
||||||
"react-native": "0.50.3",
|
"react-native": "0.50.4",
|
||||||
"react-native-fs": "^1.1.0",
|
"react-native-exception-handler": "^2.4.3",
|
||||||
|
"react-native-exit-app-no-history": "^1.0.2",
|
||||||
|
"react-native-fs": "^2.8.5",
|
||||||
"realm": "file:../..",
|
"realm": "file:../..",
|
||||||
"realm-tests": "file:../js",
|
"realm-tests": "file:../js",
|
||||||
"xmlbuilder": "^4.2.1"
|
"xmlbuilder": "^4.2.1"
|
||||||
},
|
},
|
||||||
"resolutions": { "moment": "2.19.1" },
|
"resolutions": {
|
||||||
|
"moment": "2.19.1"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-preset-react-native": "1.9.1",
|
"babel-preset-react-native": "4.0.0",
|
||||||
"invariant": "^2.2.2"
|
"invariant": "^2.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
tests/react-test-app/tests/index.js
vendored
8
tests/react-test-app/tests/index.js
vendored
@ -52,7 +52,7 @@ export async function runTests() {
|
|||||||
let passed = true;
|
let passed = true;
|
||||||
|
|
||||||
for (let suiteName in testNames) {
|
for (let suiteName in testNames) {
|
||||||
console.log('Starting ' + suiteName);
|
console.warn('Starting ' + suiteName);
|
||||||
|
|
||||||
for (let testName of testNames[suiteName]) {
|
for (let testName of testNames[suiteName]) {
|
||||||
try {
|
try {
|
||||||
@ -72,11 +72,11 @@ export async function runTest(suiteName, testName) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await RealmTests.runTest(suiteName, testName);
|
await RealmTests.runTest(suiteName, testName);
|
||||||
console.log('+ ' + testName);
|
console.warn('+ ' + testName);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.warn('- ' + testName);
|
console.error('- ' + testName);
|
||||||
console.warn(e.message || e);
|
console.error(e.message || e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user