Commit 3c214912 authored by Elana Hashman's avatar Elana Hashman

Update autopkgtests to check correct behaviour

parent ffd24dbe
Depends: @, clojure
Restrictions: allow-stderr
Tests: import-core import-lein
Tests: import-core, test-lein
#!/bin/sh
CLASSPATH="/usr/share/maven-repo/org/clojure/clojure/1.8.0/clojure-1.8.0.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-transport-wagon/debian/maven-resolver-transport-wagon-debian.jar:/usr/share/maven-repo/org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar:/usr/share/maven-repo/org/apache/maven/maven-resolver-provider/3.x/maven-resolver-provider-3.x.jar:/usr/share/maven-repo/org/codehaus/plexus/plexus-interpolation/debian/plexus-interpolation-debian.jar:/usr/share/maven-repo/org/apache/commons/commons-lang3/debian/commons-lang3-debian.jar:/usr/share/maven-repo/com/hypirion/io/0.3.1/io-0.3.1.jar:/usr/share/maven-repo/org/apache/maven/wagon/wagon-provider-api/debian/wagon-provider-api-debian.jar:/usr/share/maven-repo/org/clojure/tools.nrepl/0.2.12/tools.nrepl-0.2.12.jar:/usr/share/maven-repo/clojure-complete/clojure-complete/0.2.4/clojure-complete-0.2.4.jar:/usr/share/maven-repo/robert/hooke/1.3.0/hooke-1.3.0.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-impl/debian/maven-resolver-impl-debian.jar:/usr/share/maven-repo/org/slf4j/slf4j-api/debian/slf4j-api-debian.jar:/usr/share/maven-repo/org/tcrawley/dynapath/1.0.0/dynapath-1.0.0.jar:/usr/share/maven-repo/org/jsoup/jsoup/debian/jsoup-debian.jar:/usr/share/maven-repo/org/codehaus/plexus/plexus-component-annotations/debian/plexus-component-annotations-debian.jar:/usr/share/maven-repo/org/apache/httpcomponents/httpcore/debian/httpcore-debian.jar:/usr/share/maven-repo/org/slf4j/slf4j-nop/1.7.25/slf4j-nop-1.7.25.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-api/debian/maven-resolver-api-debian.jar:/usr/share/maven-repo/org/apache/maven/maven-repository-metadata/3.x/maven-repository-metadata-3.x.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-transport-file/debian/maven-resolver-transport-file-debian.jar:/usr/share/maven-repo/org/apache/maven/maven-builder-support/3.x/maven-builder-support-3.x.jar:/usr/share/maven-repo/commons-logging/commons-logging/debian/commons-logging-debian.jar:/usr/share/maven-repo/com/google/guava/guava/debian/guava-debian.jar:/usr/share/maven-repo/commons-io/commons-io/debian/commons-io-debian.jar:/usr/share/maven-repo/org/apache/maven/wagon/wagon-http-shared/2.x/wagon-http-shared-2.x.jar:/usr/share/maven-repo/bultitude/bultitude/0.2.8/bultitude-0.2.8.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-spi/debian/maven-resolver-spi-debian.jar:/usr/share/maven-repo/org/apache/httpcomponents/httpclient/debian/httpclient-debian.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-util/debian/maven-resolver-util-debian.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-transport-http/debian/maven-resolver-transport-http-debian.jar:/usr/share/maven-repo/org/slf4j/jcl-over-slf4j/debian/jcl-over-slf4j-debian.jar:/usr/share/maven-repo/org/apache/maven/maven-model/3.x/maven-model-3.x.jar:/usr/share/maven-repo/org/apache/maven/maven-model-builder/3.x/maven-model-builder-3.x.jar:/usr/share/maven-repo/org/apache/maven/wagon/wagon-http/2.12/wagon-http-2.12.jar:/usr/share/maven-repo/org/apache/maven/maven-artifact/3.x/maven-artifact-3.x.jar:/usr/share/maven-repo/org/flatland/classlojure/0.7.1/classlojure-0.7.1.jar:/usr/share/maven-repo/org/codehaus/plexus/plexus-utils/2.x/plexus-utils-2.x.jar:/usr/share/maven-repo/org/apache/maven/resolver/maven-resolver-connector-basic/debian/maven-resolver-connector-basic-debian.jar:/usr/share/maven-repo/commons-codec/commons-codec/debian/commons-codec-debian.jar:/usr/share/maven-repo/com/cemerick/pomegranate/1.0.0/pomegranate-1.0.0.jar"
for lib in classpath eval main pedantic project ssl user utils; do
clojure -cp /usr/share/java/leiningen-core.jar -e "(use 'leiningen.core.$lib)"
clojure -cp /usr/share/maven-repo/leiningen-core/leiningen-core/2.8.1/leiningen-core-2.8.1.jar:$CLASSPATH -e "(use 'leiningen.core.$lib)"
done
#!/bin/sh
while read lib; do
clojure -cp /usr/share/java/leiningen.jar -e "(use 'leiningen.$lib)"
done <<EOF
deploy
help
test
repl
classpath
run
do
check
vcs
version
with_profile
compile
clean
change
retest
pom
new
deps
plugin
upgrade
search
show_profiles
uberjar
javac
update_in
install
jar
release
new.templates
new.default
new.template
new.app
new.plugin
trampoline
EOF
#!/bin/sh
cd /tmp
HELP_TEXT=<<EOF
Leiningen is a tool for working with Clojure projects.
Several tasks are available:
change Rewrite project.clj by applying a function.
check Check syntax and warn on reflection.
classpath Print the classpath of the current project.
clean Remove all files from project's target-path.
compile Compile Clojure source into .class files.
deploy Build and deploy jar to remote repository.
deps Download all dependencies.
do Higher-order task to perform other tasks in succession.
help Display a list of tasks or help for a given task.
install Install the current project to the local repository.
jar Package up all the project's files into a jar file.
javac Compile Java source files.
new Generate project scaffolding based on a template.
plugin DEPRECATED. Please use the :user profile instead.
pom Write a pom.xml file to disk for Maven interoperability.
release Perform :release-tasks.
repl Start a repl session either with the current project or standalone.
retest Run only the test namespaces which failed last time around.
run Run a -main function with optional command-line arguments.
search Search Central and Clojars for published artifacts.
show-profiles List all available profiles or display one if given an argument.
test Run the project's tests.
trampoline Run a task without nesting the project's JVM inside Leiningen's.
uberjar Package up the project files and dependencies into a jar file.
update-in Perform arbitrary transformations on your project map.
upgrade Upgrade Leiningen to specified version or latest stable.
vcs Interact with the version control system.
version Print version for Leiningen and the current JVM.
with-profile Apply the given task with the profile(s) specified.
Run `lein help $TASK` for details.
Global Options:
-o Run a task offline.
-U Run a task after forcing update of snapshots.
-h, --help Print this help or help for a specific task.
-v, --version Print Leiningen's version.
These aliases are available:
downgrade, expands to upgrade
See also: readme, faq, tutorial, news, sample, profiles, deploying, gpg,
mixed-source, templates, and copying.
EOF
HELP_OUTPUT=`lein help`
if [[ ! $HELP_TEXT =~ "$HELP_OUTPUT" ]]; then
echo "lein help check failed"
exit 1
fi
NEW_APP_TEXT="Generating a project called foo based on the 'app' template."
NEW_APP_OUTPUT=`lein new app foo`
if [[ ! $NEW_APP_TEXT =~ "$NEW_APP_OUTPUT" ]]; then
echo "lein new app check failed"
exit 1
fi
cd /tmp/foo
TEST_TEXT=<<EOF
lein test foobar.core-test
lein test :only foobar.core-test/a-test
FAIL in (a-test) (core_test.clj:7)
FIXME, I fail.
expected: (= 0 1)
actual: (not (= 0 1))
Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
Tests failed.
EOF
TEST_OUTPUT=`lein test`
if [[ ! $TEST_TEXT =~ "$TEST_OUTPUT" ]]; then
echo "lein test check failed"
exit 1
fi
POM_TEXT="Wrote /tmp/foo/pom.xml"
POM_OUTPUT=`lein pom`
if [[ ! $POM_TEXT =~ "$POM_OUTPUT" ]]; then
echo "lein pom check failed"
exit 1
fi
CHECK_TEXT="Compiling namespace foobar.core"
CHECK_OUTPUT=`lein check`
if [[ ! $CHECK_TEXT =~ "$CHECK_OUTPUT" ]]; then
echo "lein check check failed"
exit 1
fi
UBERJAR_TEXT=<<EOF
Compiling foobar.core
Created /debian/foobar/target/uberjar/foobar-0.1.0-SNAPSHOT.jar
Created /debian/foobar/target/uberjar/foobar-0.1.0-SNAPSHOT-standalone.jar
EOF
UBERJAR_OUTPUT=`lein uberjar`
if [[ ! $UBERJAR_TEXT =~ "$UBERJAR_OUTPUT" ]]; then
echo "lein uberjar check failed"
exit 1
fi
cd /tmp
rm -r /tmp/foo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment