Permalink
Browse files

Clean up the shell scripts in opy/ dir.

Many exploratory scripts moved to old/.  These will probably be gone
soon, but I want to automate more tests.
  • Loading branch information...
Andy Chu
Andy Chu committed Apr 9, 2018
1 parent d6f5ce9 commit 44afb9aa8f3daa7eb8e7da3bb8f9d7b4e2a00f5f
View
@@ -48,7 +48,7 @@ necessary to build the `py27.grammar` file and so forth.
Then:
$ ./smoke.sh opy-hello2 # basic test of compiler and runtime
opy$ ../bin/opyc run gold/hello_py2.py # basic test of compiler and runtime
Compile Oil with the OPy compiler:
View

This file was deleted.

Oops, something went wrong.
View
@@ -44,7 +44,7 @@ all() {
echo
echo SCRIPTS
echo *.sh */*.sh | _count
echo *.sh */*.sh | xargs ls | grep -v '^old/' | _count
echo
}
View
@@ -21,4 +21,13 @@ osh-byterun-speed() {
popd
}
osh-byterun-parse() {
local prog='echo "hello world"'
pushd $THIS_DIR/..
time bin/osh -n -c "$prog"
time bin/osh-byterun -n -c "$prog"
popd
}
"$@"
File renamed without changes.
File renamed without changes.
@@ -30,17 +30,6 @@ parser-bug() {
_parse-one $out
}
# This might not work
_stdlib-parse-one() {
PYTHONPATH=. ./opy_main.py 2to3.grammar stdlib-parse "$@"
}
stdlib-parse-test() {
_stdlib-parse-one testdata/hello_py3.py
echo ---
_stdlib-parse-one testdata/hello_py2.py
}
_compile-and-run() {
local path=$1
local basename=$(basename $path .py)
@@ -12,88 +12,6 @@ set -o errexit
source common.sh
source compare.sh # for DIFF
_fill-opy-tree() {
echo TODO: grammar pickle
}
compile-opy-tree() {
local src=$PWD
local files=( $(find $src \
-name _tmp -a -prune -o \
-name '*.py' -a -printf '%P\n') )
#local dest=_tmp/opy-compile2/
#_compile-tree $src $dest compiler2 "${files[@]}"
#local dest=_tmp/opy-stdlib/
#_compile-tree $src $dest stdlib "${files[@]}"
_compile-tree $src _tmp/opy-ccompile/ ccompile "${files[@]}"
_compile-tree $src _tmp/opy-opy/ opy "${files[@]}"
}
zip-oil-tree() {
#pushd _tmp/osh-opy
rm -f _tmp/oil.zip
pushd _tmp/osh-ccompile
zip ../oil.zip -r .
popd
}
_byterun() {
# Wow this is SO confusing.
# Not executable on master branch
#python ~/git/other/byterun/byterun/__main__.py "$@"
#python ~/git/other/byterun/byterun "$@"
#python -m ~/git/other/byterun/byterun "$@"
#PYTHONPATH=~/git/other/byterun
# WHY is this the only way to make it work?
pushd ~/git/languages/byterun
python -m byterun.__main__ "$@"
popd
}
byterun-speed-test() {
write-speed
echo OLD BYTERUN
time _byterun $PWD/_tmp/speed_main.py 10000
time _byterun $PWD/_tmp/speed.py 10000
}
#
# Byterun smoke tests
#
# Wow! Runs itself to parse itself... I need some VM instrumentation to make
# sure it's not accidentally cheating or leaking.
opy-parse-on-byterun() {
local arg=$PWD/testdata/hello_py2.py
pushd _tmp/opy-opy
opyc-run opy_main.pyc parse $arg
popd
}
osh-parse-on-byterun() {
cmd=(osh -n -c 'echo "hello world"')
../bin/oil.py "${cmd[@]}" # Run with CPython
echo ---
# Run with byterun
opyc-run -- _tmp/oil-opy/bin/oil.pyc "${cmd[@]}"
}
opy-hello2() {
opyc-run testdata/hello_py2.py
}
opy-hello3() {
opyc-run testdata/hello_py3.py
}
#
# Determinism
#

0 comments on commit 44afb9a

Please sign in to comment.