Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Please use .diff or .patch (not .txt) as a suffix for patch files.
  • Please use a name different from all existing attachments on the ticket.  JIRA allows you to add multiple attachments with the same name, but later ones do not replace earlier ones.  This can lead to confusion when referring to patches by name.
  • Include the file name and date of the patch in any comments referring to it.  It is possible to match up comments with patches based on the date and time, but it is tedious and error prone.
  • To get email whenever the ticket is updated, click on the word "Watch" in the top right area of the page.  This can help you know when someone else comments on your patch, or creates a new one, etc.  Click "Watching" if you want to stop these update emails for that ticket.  You may want to verify that the automated emails get through your spam filter.  Emails will be sent to the address associated with your JIRA account, and will come from the address jira@dev.clojure.org 
  • If you create a new patch that incorporates one or more earlier ones, please combine them all into one patch file, and indicate in your comments that you have done this (with file names and dates of the patches you are superseding).
  • If one of your patches becomes superseded by a later one, consider removing your patch to avoid confusion.  See the instructions under the heading "Removing Patches" below.

...

To reduce the duration of the pseudo-randomly generated generative tests from 60 sec down to 1 sec (for example), edit the file file src/scriptsscript/run_teststest_generative.clj clj and change the 60000 number.  Just be careful not to include such changes in any patches you submit.  (The file was called src/scripts/run_tests.clj in Clojure 1.6.0 and earlier)

Run An Individual Test

First, build the latest Clojure without running any tests:

Code Block
languagebash
$ ant jar
# If no compilation errors, 'ant jar' creates clojure.jar in Clojure tree root dir

# Or, if you prefer Maven
$ mvn -Dmaven.test.skip=true package
# If no compilation errors, mvn command above creates target/clojure-1.67.0-master-SNAPSHOT.jar

The commands above build a Clojure jar file, but neither compile nor run the tests.

...

Code Block
# Replace clojure.jar with target/clojure-1.67.0-master-SNAPSHOT.jar if you ran mvn command
$ java -cp test:clojure.jar clojure.main
Clojure 1.67.0-master-SNAPSHOT
;; We're testing with clojure.test 
=> (require 'clojure.test)
nil
;; Load a test file 
user=> (require 'clojure.test-clojure.data)
nil
;; Run it 
user=> (clojure.test/run-tests 'clojure.test-clojure.data)
 
Testing clojure.test-clojure.data
Ran 1 tests containing 17 assertions.
0 failures, 0 errors.
{:type :summary, :pass 17, :test 1, :error 0, :fail 0}   

Start a repl and run a generative test from it:

Generative tests use additional testing jars (installed when you run ./antsetup.sh). Thus, you'll need to have some additional classpath which antsetup.sh will leave in the maven-classpath file. If you are on *nix, the easiest way to leverage this file is:

Code Block
# Replace clojure.jar with target/clojure-1.7.0-master-SNAPSHOT.jar if you ran mvn command 
$ java -cp `cat maven-classpath`:test:clojure.jar clojure.main 
Clojure 1.7.0-master-SNAPSHOT 
;; Load a test file that uses test.generative
user=> (require 'clojure.test-clojure.reader)
nil
;; Load the test.generative runner ns 
user=> (use 'clojure.test.generative.runner)
nil
;; Test a specification on 1 thread for 200 ms
user=> (run 1 200 #'clojure.test-clojure.reader/types-that-should-roundtrip)
{:iter 60, :seed 1255541066, :test clojure.test-clojure.reader/types-that-should-roundtrip}
nil