Skip to content

Script to run sample files and compare against known outputs - #34

Merged
Zamua merged 1 commit into
JMU-CS:masterfrom
hinescd:master
Feb 4, 2019
Merged

Zamua merged 1 commit into
JMU-CS:masterfrom
hinescd:master

Conversation

@hinescd

@hinescd hinescd commented Feb 4, 2019

Copy link
Copy Markdown
Contributor

I wrote a script (dotests.sh - open to renaming) that compiles, runs, and tests .lj files and then diffs their outputs against previously known outputs. This script can be helpful when making changes to the compiler so you can be sure that you didn't break anything that was previously working.

@hinescd hinescd mentioned this pull request Feb 4, 2019

@Zamua Zamua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

I think the expected files should not include gradle output. The only output we should consider is output from the compiler itself.

An example: The file tests/outputs/precedence_compile.exp should have an expected value of an empty file (or whatever the LJ compiler spits out on success), but not anything from the gradle build tool (ex: BUILD SUCCESSFUL)

Do you think that would be a simple change?

@hinescd

hinescd commented Feb 4, 2019

Copy link
Copy Markdown
Contributor Author

I changed the compile script to run in quiet mode; that should suppress gradle's messages, but it still prints compiler messages if there are any

@Zamua

Zamua commented Feb 4, 2019

Copy link
Copy Markdown
Contributor

Nice! last thing, can you squash those commits into one? You can keep the 'make a script to run all sample programs and test their outputs' message, throwaway others

@hinescd

hinescd commented Feb 4, 2019

Copy link
Copy Markdown
Contributor Author

Squashed

@Zamua
Zamua merged commit b3e4434 into JMU-CS:master Feb 4, 2019
@lam2mo

lam2mo commented Feb 4, 2019 •

Copy link
Copy Markdown
Member

Right now some of the tests are only valid for running xor testing. We should probably improve the tests at some point so that they are all valid for both running and testing. This would reduce confusion for newcomers as well.

Thanks @hinescd for writing this!

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

Successfully merging this pull request may close these issues.

3 participants