Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move source tree down into src and introduce build.xml to replace ./test

  • Loading branch information...
commit b2351b2d7bb1d6b123dcbf6e28bfe3eca92ae2ee 1 parent 6192dd5
@duelinmarkers authored
Showing with 69 additions and 16 deletions.
  1. +2 −0  .gitignore
  2. +53 −0 build.xml
  3. BIN  lib/clojure-contrib.jar
  4. BIN  lib/clojure.jar
  5. 0  { → src}/clj_record/associations.clj
  6. 0  { → src}/clj_record/boot.clj
  7. 0  { → src}/clj_record/callbacks.clj
  8. 0  { → src}/clj_record/callbacks/built_ins.clj
  9. 0  { → src}/clj_record/core.clj
  10. 0  { → src}/clj_record/meta.clj
  11. 0  { → src}/clj_record/query.clj
  12. 0  { → src}/clj_record/serialization.clj
  13. 0  { → src}/clj_record/test/associations_test.clj
  14. 0  { → src}/clj_record/test/callbacks_built_ins_test.clj
  15. 0  { → src}/clj_record/test/callbacks_test.clj
  16. 0  { → src}/clj_record/test/core_test.clj
  17. +14 −14 { → src}/clj_record/test/main.clj
  18. 0  { → src}/clj_record/test/model/config.clj
  19. 0  { → src}/clj_record/test/model/manufacturer.clj
  20. 0  { → src}/clj_record/test/model/product.clj
  21. 0  { → src}/clj_record/test/query_test.clj
  22. 0  { → src}/clj_record/test/serialization_test.clj
  23. 0  { → src}/clj_record/test/test_helper.clj
  24. 0  { → src}/clj_record/test/util_test.clj
  25. 0  { → src}/clj_record/test/validation_built_ins_test.clj
  26. 0  { → src}/clj_record/test/validation_test.clj
  27. 0  { → src}/clj_record/util.clj
  28. 0  { → src}/clj_record/validation.clj
  29. 0  { → src}/clj_record/validation/built_ins.clj
  30. +0 −2  test
  31. BIN  test_lib/derby.jar
  32. BIN  test_lib/derbyclient.jar
View
2  .gitignore
@@ -1 +1,3 @@
derby.log
+classes
+*.swp
View
53 build.xml
@@ -0,0 +1,53 @@
+<project name="clj-record" basedir="." default="test">
+
+ <property name="classes.dir" value="classes" />
+ <property name="lib.dir" value="lib" />
+ <property name="test.lib.dir" value="test_lib" />
+ <property name="src.dir" value="src" />
+
+ <path id="project.classpath">
+ <pathelement path="${classes.dir}" />
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+
+ <path id="test.classpath">
+ <path refid="project.classpath" />
+ <fileset dir="${test.lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+
+ <target name="clean">
+ <delete dir="${classes.dir}" />
+ <delete file="clj-record.jar" />
+ </target>
+
+ <target name="init">
+ <mkdir dir="${classes.dir}" />
+ </target>
+
+ <target name="compile" depends="clean,init">
+ <java classname="clojure.lang.Compile" classpathref="project.classpath" fork="true" failonerror="true">
+ <classpath path="${src.dir}" />
+ <sysproperty key="clojure.compile.path" value="${classes.dir}" />
+ <arg value="clj-record.boot" />
+ <arg value="clj-record.test.main" />
+ </java>
+ </target>
+
+ <target name="test" depends="compile">
+ <java classname="clj_record.test.main" classpathref="test.classpath" fork="true" failonerror="true">
+ <classpath path="${src.dir}" />
+ <arg value="${src.dir}/clj_record/test" />
+ </java>
+ </target>
+
+ <target name="jar" depends="compile">
+ <fail message="no jar task yet" />
+ </target>
+
+ <target name="all" depends="test,jar" />
+
+</project>
View
BIN  lib/clojure-contrib.jar
Binary file not shown
View
BIN  lib/clojure.jar
Binary file not shown
View
0  clj_record/associations.clj → src/clj_record/associations.clj
File renamed without changes
View
0  clj_record/boot.clj → src/clj_record/boot.clj
File renamed without changes
View
0  clj_record/callbacks.clj → src/clj_record/callbacks.clj
File renamed without changes
View
0  clj_record/callbacks/built_ins.clj → src/clj_record/callbacks/built_ins.clj
File renamed without changes
View
0  clj_record/core.clj → src/clj_record/core.clj
File renamed without changes
View
0  clj_record/meta.clj → src/clj_record/meta.clj
File renamed without changes
View
0  clj_record/query.clj → src/clj_record/query.clj
File renamed without changes
View
0  clj_record/serialization.clj → src/clj_record/serialization.clj
File renamed without changes
View
0  clj_record/test/associations_test.clj → src/clj_record/test/associations_test.clj
File renamed without changes
View
0  clj_record/test/callbacks_built_ins_test.clj → ..._record/test/callbacks_built_ins_test.clj
File renamed without changes
View
0  clj_record/test/callbacks_test.clj → src/clj_record/test/callbacks_test.clj
File renamed without changes
View
0  clj_record/test/core_test.clj → src/clj_record/test/core_test.clj
File renamed without changes
View
28 clj_record/test/main.clj → src/clj_record/test/main.clj
@@ -1,4 +1,5 @@
(ns clj-record.test.main
+ (:gen-class)
(:require [clojure.contrib.sql :as sql]
[clojure.contrib.test-is :as test-is]
[clojure.contrib.str-utils :as str-utils]
@@ -29,18 +30,17 @@
[:price :int]
[:manufacturer_id :int "NOT NULL"]))
-(sql/with-connection clj-record.test.model.config/db
- (sql/transaction
- (drop-tables)
- (create-tables)))
+(defn -main [test-dirname]
+ (sql/with-connection clj-record.test.model.config/db
+ (sql/transaction
+ (drop-tables)
+ (create-tables)))
+ (println (str (clj-record.test.model.config/db :subprotocol) " database setup complete."))
+ (let [test-files (for [f (-> test-dirname java.io.File. .listFiles)
+ :when (re-find #"test.clj$" (.getPath f))]
+ f)
+ test-namespaces (map #(symbol (str "clj-record.test." (str-utils/re-gsub #"_" "-" (re-find #"[^.]+" (.getName %))))) test-files)]
+ (doseq [file test-files]
+ (load (str-utils/re-sub #"src/" "/" (re-find #"[^.]+" (.getPath file)))))
+ (apply test-is/run-tests test-namespaces)))
-(println (str (clj-record.test.model.config/db :subprotocol) " database setup complete."))
-
-(let [test-files (for [f (-> *file* java.io.File. .getParentFile .list)
- :when (re-find #"test.clj$" f)]
- (re-find #"[^.]+" f))
- base-namespace (re-find #"^\w*.*\." (str *ns*))
- test-namespaces (map #(symbol (str base-namespace (str-utils/re-gsub #"_" "-" %))) test-files)]
- (doseq [file test-files]
- (load file))
- (apply test-is/run-tests test-namespaces))
View
0  clj_record/test/model/config.clj → src/clj_record/test/model/config.clj
File renamed without changes
View
0  clj_record/test/model/manufacturer.clj → src/clj_record/test/model/manufacturer.clj
File renamed without changes
View
0  clj_record/test/model/product.clj → src/clj_record/test/model/product.clj
File renamed without changes
View
0  clj_record/test/query_test.clj → src/clj_record/test/query_test.clj
File renamed without changes
View
0  clj_record/test/serialization_test.clj → src/clj_record/test/serialization_test.clj
File renamed without changes
View
0  clj_record/test/test_helper.clj → src/clj_record/test/test_helper.clj
File renamed without changes
View
0  clj_record/test/util_test.clj → src/clj_record/test/util_test.clj
File renamed without changes
View
0  ...record/test/validation_built_ins_test.clj → ...record/test/validation_built_ins_test.clj
File renamed without changes
View
0  clj_record/test/validation_test.clj → src/clj_record/test/validation_test.clj
File renamed without changes
View
0  clj_record/util.clj → src/clj_record/util.clj
File renamed without changes
View
0  clj_record/validation.clj → src/clj_record/validation.clj
File renamed without changes
View
0  clj_record/validation/built_ins.clj → src/clj_record/validation/built_ins.clj
File renamed without changes
View
2  test
@@ -1,2 +0,0 @@
-#!/usr/bin/env clj
-(load-file "clj_record/test/main.clj")
View
BIN  test_lib/derby.jar
Binary file not shown
View
BIN  test_lib/derbyclient.jar
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.