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

Tozier problems #145

Merged
merged 18 commits into from Jul 23, 2015
Merged

Tozier problems #145

merged 18 commits into from Jul 23, 2015

Conversation

Vaguery
Copy link
Contributor

@Vaguery Vaguery commented Jul 13, 2015

These changes do four things:

  • comments out the content of the legacy "test" files, since they would be run every few seconds when using lein midje :autotest test and that would be bad
  • adds midje as a dependency
  • adds a few simple facts about the interpreter's handling of literals, in test/clojush/midje/interpreter (really just to start to understand the way things are wired together before writing more comprehensive tests before refactoring)
  • adds two of my "evil" problems
    1. in src/clojush/problems/tozier/winkler01.clj and accompanying tests in test/clojush/probems/tozier/winkler01.clj is what I call "Winkler's zeroes and ones problem"
      1. in src/clojush/problems/tozier/the-idea-of-numbers.clj and accompanying tests in test/clojush/probems/tozier/the-idea-of-numbers.clj is a pedagogic problem I often use when teaching GP classes; it's simple symbolic regression, with all instructions but no ERCs

Before being able to run midje you will want to change your ~/.lein/profiles.clj file, as described at Marick's repo.

NOTE: @NicMcPhee and I discovered that the structure of the Clojush repo does not allow the "simple" testing syntax Midje prefers: DO NOT RUN lein midje

Instead, we have been using lein midje :autotest test. The other variants may not be working yet because of setup. The midje :autotest mode will re-run all tests (clojure.test and midje) it finds in the test folder the first time it's invoked, and will re-run the tests in any files you save as soon as you save them.

NicMcPhee and others added 12 commits July 6, 2015 14:04
Commented out all the pseudo-non-test things and added a very simple test to confirm that we can run `clojure.test` style tests.
It turns out by default that midje loads _all_ the files in both `src` and `test`. This dies horribly because many of the files in `src` have side effects on global atoms, so evaluating them all leads to many conflicts. So to avoid this when running midje use `lein midje :autotest test`. This tells midje to only evaluate the files in the `test` sub-directory, ignoring everything in `src`.
We have tests that confirm that a null instruction doesn't change the state, and that an integer constant as an instruction is pushed onto the integer stack.
@Vaguery
Copy link
Contributor Author

Vaguery commented Jul 13, 2015

Hang on; I am having some trouble testing the new instructions I'm adding.

@Vaguery Vaguery closed this Jul 13, 2015
@Vaguery
Copy link
Contributor Author

Vaguery commented Jul 14, 2015

I've managed to figure out how to test the error functions themselves, and also run programs in the tests.

Also have added a problem I often use when teaching GP: simple symbolic regression with a complete suite of instructions but no ERCs, called the-idea-of-numbers.clj

@Vaguery
Copy link
Contributor Author

Vaguery commented Jul 22, 2015

This one is ready to merge.

lspector added a commit that referenced this pull request Jul 23, 2015
@lspector lspector merged commit 4bad391 into lspector:master Jul 23, 2015
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.

None yet

3 participants