Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler-tests-suite cannot check negative answers for self-defined var_test #21

Open
rundong08 opened this issue Nov 17, 2022 · 0 comments

Comments

@rundong08
Copy link

rundong08 commented Nov 17, 2022

Description

Even after applying the workaround in #20, compiler-tests-suite still cannot check for negative answers (or in fact any answer not in the range 0-255). For example,
Let's say we have a var_test_5.rkt file with simple content

(- 1)

and when you run racket run-tests.rkt, it will generate error like

--------------------
var_test_5 > compiler tests > code generation
FAILURE
name:       check
location:   utilities.rkt:2275:46
params:     '(#<procedure:result-check> 255 "-1")
message:    "Mismatched output from x86 execution"
--------------------

Expected Behavior (assuming your compiler implementation is correct)

All tests should pass

Cause

compiler-tests-suite uses exit code to check result. However, on most system, exit code will be truncated to the lowest 8-bit (0-255), such that -1 became 255.

Workaround

Modify your self-defined var_test to return a nonnegative number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant