Permalink
Browse files

OSH spec tests all pass under byterun!

(Unrelated: remove unused 2to3 grammar.  We only care about
py27.grammar.)
  • Loading branch information...
Andy Chu
Andy Chu committed Apr 9, 2018
1 parent 44afb9a commit 9a0d22b5d39ec769196e479bf7540583415e03ba
Showing with 17 additions and 193 deletions.
  1. +0 −173 opy/2to3.grammar
  2. +5 −5 opy/README.md
  3. +9 −12 opy/test.sh
  4. +3 −3 test/sh_spec.py
View

This file was deleted.

Oops, something went wrong.
View
@@ -66,6 +66,11 @@ Gold tests in gold/:
$ ./test.sh gold
Oil spec tests (slow):
opy$ ./test.sh spec smoke # like $REPO_ROOT/test/spec.sh smoke
opy$ ./test.sh spec all # like $REPO_ROOT/test/spec.sh all
They can be run manually like this:
$ gold/regex_compile.py # run with CPython
@@ -75,11 +80,6 @@ Demo: speed difference between OSH under CPython and OSH under byterun:
./demo.sh osh-byterun-speed
TODO:
- Spec tests
- ./test.sh spec all # Some failures due to $0
OPy Compiler Regtest
--------------------
View
@@ -161,20 +161,17 @@ unit() {
PYTHONPATH=. "$@"
}
# NOTE: I checked with set -x that it's being run. It might be nicer to be
# sure with --verison.
export OSH_PYTHON=opy/_tmp/oil-opy/bin/osh
# NOTE: Failures in 'var-num' and 'special-vars' due to $0. That proves
# we're running the right binary!
spec() {
local action=${1:-smoke}
# Spec tests under byterun.
spec() {
local action=$1 # e.g. 'smoke' or 'all'
shift
pushd ..
# Could also export OSH_OVM
test/spec.sh $action "$@"
pushd $THIS_DIR/..
# TODO: Should be OSH_ALT instead of OSH_OVM?
# Usually it is dev build vs. release build, but here it is CPython vs.
# byterun.
OSH_OVM=bin/osh-byterun test/spec.sh $action "$@"
popd
}
View
@@ -363,7 +363,7 @@ def CreateAssertions(case, sh_label):
status = False
# So the assertion are exactly the same for osh and osh_ALT
if sh_label == 'osh_ALT':
if sh_label in ('osh_ALT', 'osh-byterun'):
sh_label = 'osh'
if sh_label in case:
@@ -514,7 +514,7 @@ def RunCases(cases, case_predicate, shells, env, out):
if cell_result == Result.FAIL:
# Special logic: don't count osh_ALT beacuse its failures will be
# counted in the delta.
if sh_label != 'osh_ALT':
if sh_label not in ('osh_ALT', 'osh-byterun'):
stats['num_failed'] += 1
if sh_label == 'osh':
@@ -532,7 +532,7 @@ def RunCases(cases, case_predicate, shells, env, out):
else:
raise AssertionError
if sh_label == 'osh_ALT':
if sh_label in ('osh_ALT', 'osh-byterun'):
osh_alt_result = result_row[-1]
cpython_result = result_row[-2]
if osh_alt_result != cpython_result:

0 comments on commit 9a0d22b

Please sign in to comment.