Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ To run base tests:
dart --checked test/io/all.dart

# Run expression extractor tests:
scripts/test-expression-extractor.sh
./scripts/test-expression-extractor.sh

# Run the Dart Analyzer:
./scripts/analyze.sh
Expand All @@ -146,7 +146,7 @@ tests proper by executing:

```shell
. ./scripts/env.sh
karma_run.sh
./scripts/karma_run.sh
```

**Note:**: If the dart analyzer fails with warnings, the tests will not run.
Expand Down
3 changes: 0 additions & 3 deletions analyze.sh

This file was deleted.

3 changes: 0 additions & 3 deletions genDocs.sh

This file was deleted.

3 changes: 0 additions & 3 deletions generate.sh

This file was deleted.

6 changes: 0 additions & 6 deletions perf.sh

This file was deleted.

49 changes: 0 additions & 49 deletions run-test.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/analyze.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand Down Expand Up @@ -27,6 +27,6 @@ do
echo export \'../$FILE\' hide main, NestedRouteInitializer\; >> $OUT
done

$(dirname $0)/generate-expressions.sh
$NGDART_SCRIPT_DIR/generate-expressions.sh

$DARTANALYZER $OUT
9 changes: 8 additions & 1 deletion scripts/env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e

if [ -n "$DART_SDK" ]; then
Expand Down Expand Up @@ -33,17 +33,24 @@ export DART_DOCGEN=${DART_DOCGEN:-"$DARTSDK/bin/docgen"}

export DARTIUM_BIN=${DARTIUM_BIN:-"$DARTIUM"}
export CHROME_BIN=${CHROME_BIN:-"google-chrome"}

export PATH=$PATH:$DARTSDK/bin

export NGDART_SCRIPT_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
export NGDART_BASE_DIR=$(dirname $NGDART_SCRIPT_DIR)

echo '*********'
echo '** ENV **'
echo '*********'
echo DART_SDK=$DART_SDK
echo DART=$DART
$DART --version
echo PUB=$PUB
echo DARTANALYZER=$DARTANALYZER
echo DARTDOC=$DARTDOC
echo DART_DOCGEN=$DART_DOCGEN
echo DARTIUM_BIN=$DARTIUM_BIN
echo CHROME_BIN=$CHROME_BIN
echo PATH=$PATH
echo NGDART_BASE_DIR=$NGDART_BASE_DIR
echo NGDART_SCRIPT_DIR=$NGDART_SCRIPT_DIR
12 changes: 8 additions & 4 deletions scripts/generate-expressions.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/bin/sh
#!/bin/bash

. $(dirname $0)/env.sh

echo '=========================='
echo '== GENERATE EXPRESSIONS =='
echo '=========================='

mkdir -p gen
mkdir -p $NGDART_SCRIPT_DIR/gen

cat test/core/parser/generated_getter_setter.dart | sed -e 's/_template;/_generated;/' | grep -v REMOVE > gen/generated_getter_setter.dart
$DART bin/parser_generator_for_spec.dart getter_setter >> gen/generated_getter_setter.dart
cat $NGDART_BASE_DIR/test/core/parser/generated_getter_setter.dart | \
sed -e 's/_template;/_generated;/' | \
grep -v REMOVE > $NGDART_SCRIPT_DIR/gen/generated_getter_setter.dart

$DART $NGDART_BASE_DIR/bin/parser_generator_for_spec.dart getter_setter >> \
$NGDART_SCRIPT_DIR/gen/generated_getter_setter.dart
2 changes: 1 addition & 1 deletion scripts/karma/snapshot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

rm -rf ../karma-snapshot
mkdir ../karma-snapshot
Expand Down
13 changes: 5 additions & 8 deletions karma_run.sh → scripts/karma_run.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/sh
#!/bin/bash

# OS-specific Dartium path defaults
case $( uname -s ) in
Darwin)
DARTIUM_BIN=${DARTIUM_BIN:-"/Applications/dart/chromium/Chromium.app/Contents/MacOS/Chromium"};;
esac
. $(dirname $0)/env.sh

# Check for node
if [ -z "$(which node)" ]; then
Expand All @@ -14,10 +10,11 @@ if [ -z "$(which node)" ]; then
fi

# Check for karma
KARMA_PATH="node_modules/karma/bin/karma"
KARMA_PATH="$NGDART_BASE_DIR/node_modules/karma/bin/karma"
if [ ! -e "$KARMA_PATH" ]; then
echo "karma does not appear to be installed. Installing:"
cd $NGDART_BASE_DIR
npm install
fi

dartanalyzer lib/angular.dart && node $KARMA_PATH run --port=8765
$DARTANALYZER $NGDART_BASE_DIR/lib/angular.dart && node $KARMA_PATH run --port=8765
17 changes: 17 additions & 0 deletions scripts/perf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

. $(dirname $0)/env.sh

# Check for node
if [ -z "$(which node)" ]; then
echo "node.js does not appear to be on the path."
echo "You can obtain it from http://nodejs.org"
exit 1;
fi

if dart2js $NGDART_BASE_DIR/perf/mirror_perf.dart -o $NGDART_BASE_DIR/perf/mirror_perf.dart.js > /dev/null ; then
echo DART:
$DART $NGDART_BASE_DIR/perf/mirror_perf.dart
echo JavaScript:
node $NGDART_BASE_DIR/perf/mirror_perf.dart.js
fi
35 changes: 35 additions & 0 deletions scripts/run-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -e

. $(dirname $0)/env.sh

# Check for node
if [ -z "$(which node)" ]; then
echo "node.js does not appear to be on the path."
echo "You can obtain it from http://nodejs.org"
exit 1;
fi

# Run npm install so we are up-to-date
cd $NGDART_BASE_DIR
npm install

# Print the dart VM version to the logs
dart --version

# run io tests
dart --checked $NGDART_BASE_DIR/test/io/all.dart

# run transformer tests
dart --checked $NGDART_BASE_DIR/test/tools/transformer/all.dart

# run expression extractor tests
dart --checked $NGDART_BASE_DIR/test/tools/symbol_inspector/symbol_inspector_spec.dart

$NGDART_SCRIPT_DIR/analyze.sh &&
$NGDART_BASE_DIR/node_modules/jasmine-node/bin/jasmine-node playback_middleware/spec/ &&
node "node_modules/karma/bin/karma" start karma.conf \
--reporters=junit,dots --port=8765 --runner-port=8766 \
--browsers=Dartium,Chrome,Firefox --single-run --no-colors

7 changes: 5 additions & 2 deletions scripts/test-expression-extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

set -e

(cd example; pub get)
. $(dirname $0)/env.sh

(cd $NGDART_BASE_DIR/example; pub get)

rm -rf xxx.dart

OUT=$(mktemp XXX.dart)

dart --package-root=example/packages bin/expression_extractor.dart example/web/todo.dart example /dev/null /dev/null $OUT
$DART --package-root=example/packages bin/expression_extractor.dart \
example/web/todo.dart example /dev/null /dev/null $OUT

if [[ -e $OUT ]]; then
echo "Expression extractor created an output file"
Expand Down
34 changes: 18 additions & 16 deletions scripts/travis/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -e
. ./scripts/env.sh
. "$(dirname $0)/../env.sh"

echo '==========='
echo '== BUILD =='
Expand All @@ -24,14 +24,15 @@ function checkSize() {
fi
}

# skip auxiliary tests if we are only running dart2js
if [[ $TESTS == "dart2js" ]]; then
# skip auxiliary tests if we are only running dart2js
echo '------------------------'
echo '-- BUILDING: examples --'
echo '------------------------'

if [[ $CHANNEL == "DEV" ]]; then
dart "bin/pub_build.dart" -p example -e "example/expected_warnings.json"
$DART "$NGDART_BASE_DIR/bin/pub_build.dart" -p example \
-e "$NGDART_BASE_DIR/example/expected_warnings.json"
else
( cd example; pub build )
fi
Expand All @@ -40,7 +41,7 @@ if [[ $TESTS == "dart2js" ]]; then
echo '-----------------------------------'
echo '-- BUILDING: verify dart2js size --'
echo '-----------------------------------'
cd example
cd $NGDART_BASE_DIR/example
checkSize build/web/animation.dart.js 208021
checkSize build/web/bouncing_balls.dart.js 202325
checkSize build/web/hello_world.dart.js 199919
Expand All @@ -55,33 +56,34 @@ else
echo '--------------'
echo '-- TEST: io --'
echo '--------------'
dart --checked test/io/all.dart
$DART --checked $NGDART_BASE_DIR/test/io/all.dart

echo '----------------------------'
echo '-- TEST: symbol extractor --'
echo '----------------------------'
dart --checked test/tools/symbol_inspector/symbol_inspector_spec.dart
$DART --checked $NGDART_BASE_DIR/test/tools/symbol_inspector/symbol_inspector_spec.dart

./scripts/generate-expressions.sh
./scripts/analyze.sh
$NGDART_SCRIPT_DIR/generate-expressions.sh
$NGDART_SCRIPT_DIR/analyze.sh

echo '-----------------------'
echo '-- TEST: transformer --'
echo '-----------------------'
dart --checked test/tools/transformer/all.dart

$DART --checked $NGDART_BASE_DIR/test/tools/transformer/all.dart

echo '---------------------'
echo '-- TEST: changelog --'
echo '---------------------'
./node_modules/jasmine-node/bin/jasmine-node ./scripts/changelog/;
$NGDART_BASE_DIR/node_modules/jasmine-node/bin/jasmine-node \
$NGDART_SCRIPT_DIR/changelog/;

(
echo '----------------'
echo '-- TEST: perf --'
echo '----------------'
cd perf
pub install
cd $NGDART_BASE_DIR/perf
$PUB install

for file in *_perf.dart; do
echo ======= $file ========
$DART $file
Expand All @@ -100,11 +102,11 @@ echo '-----------------------'
echo '-- TEST: AngularDart --'
echo '-----------------------'
echo BROWSER=$BROWSERS
./node_modules/jasmine-node/bin/jasmine-node playback_middleware/spec/ &&
node "node_modules/karma/bin/karma" start karma.conf \
$NGDART_BASE_DIR/node_modules/jasmine-node/bin/jasmine-node playback_middleware/spec/ &&
node "node_modules/karma/bin/karma" start karma.conf \
--reporters=junit,dots --port=8765 --runner-port=8766 \
--browsers=$BROWSERS --single-run --no-colors

if [[ $TESTS != "dart2js" ]]; then
./scripts/generate-documentation.sh;
$NGDART_SCRIPT_DIR/generate-documentation.sh;
fi