-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
137 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/bin/bash | ||
|
||
|
||
# test wepy new demo | ||
|
||
# Start in tasks/ even if run from root directory | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
name=$(basename "$0" .sh) | ||
cd /tmp/templates/ | ||
|
||
wepy init empty $name --no-interactive | ||
|
||
cd "$name" | ||
npm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
name=$(basename "$0" .sh) | ||
cd /tmp/templates/ | ||
|
||
wepy init standard $name --no-interactive --name test-interactive | ||
|
||
cd "$name" | ||
npm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
# test wepy new demo | ||
|
||
# Start in tasks/ even if run from root directory | ||
cd "$(dirname "$0")" | ||
|
||
function cleanup() { | ||
echo 'Cleaning up.' | ||
} | ||
|
||
|
||
# Error messages are redirected to stderr | ||
function handle_error() { | ||
echo "$(basename $0): ERROR! An error was encountered executing line $1." 1>&2; | ||
cleanup | ||
echo 'Exiting with error.' 1>&2; | ||
exit 1 | ||
} | ||
|
||
|
||
function handle_exit() { | ||
cleanup | ||
echo 'Exiting without error.' 1>&2; | ||
exit | ||
} | ||
|
||
|
||
# Exit the script with a helpful error message when any error is encountered | ||
trap 'set +x; handle_error $LINENO $BASH_COMMAND' ERR | ||
|
||
# Cleanup before exit on any termination signal | ||
trap 'set +x; handle_exit' SIGQUIT SIGTERM SIGINT SIGKILL SIGHUP | ||
|
||
# Echo every command being executed | ||
set -x | ||
|
||
|
||
# Go to root | ||
cd .. | ||
root_path=$PWD | ||
|
||
|
||
npm link packages/cli | ||
|
||
wepy -v | ||
|
||
wepy list | ||
|
||
mkdir -p /tmp/templates/ | ||
cd /tmp/templates/ | ||
|
||
buildcases="${root_path}/test/build-cases" | ||
for bc in ${buildcases}/*; do | ||
name=$(basename $bc .sh) | ||
"$root_path"/scripts/buildcases/"$name".sh | ||
cd "/tmp/templates/${name}" | ||
node "$root_path"/packages/cli/bin/wepy.js build | ||
done | ||
|
||
# Test build demos | ||
cd /tmp/templates | ||
|
||
# node "$root_path"/packages/cli/bin/wepy.js init wepyjs/wepy-wechat-demo wepy-wechat-demo | ||
git clone https://github.com/wepyjs/wepy-wechat-demo.git --branch 2.0 | ||
|
||
cd wepy-wechat-demo | ||
npm install | ||
npm run build | ||
|
||
cd .. | ||
|
||
# Cleanup | ||
cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const path = require('path'); | ||
const { spawnSync } = require('child_process'); | ||
|
||
const packages = [ | ||
'babel-plugin-import-regenerator', | ||
'cli', | ||
//'compiler-babel', | ||
'compiler-less', | ||
'compiler-sass', | ||
//'compiler-stylus', | ||
//'compiler-typescript', | ||
'core', | ||
'plugin-define' | ||
//'plugin-eslint', | ||
//'plugin-uglifyjs', | ||
//'redux', | ||
//'use-promisify', | ||
//'x', | ||
]; | ||
|
||
function testAll(pkgs) { | ||
if (pkgs.length === 0) { | ||
pkgs = packages; | ||
} | ||
pkgs.forEach(pkg => { | ||
testOne(pkg); | ||
}); | ||
} | ||
|
||
function testOne(name) { | ||
process.env.FORCE_COLOR = 1; | ||
spawnSync('npm', ['run', 'test'], { | ||
cwd: path.join(process.cwd(), 'packages', name), | ||
env: process.env, | ||
stdio: 'inherit' | ||
}); | ||
} | ||
|
||
// eslint-disable-next-line no-unused-vars | ||
(function main([bin, file, ...args]) { | ||
testAll(args); | ||
})(process.argv); |