Skip to content

Commit

Permalink
moved tests to make file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2Brownlee committed Apr 12, 2013
1 parent 9804fc9 commit d66b01b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 115 deletions.
45 changes: 41 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ lulu: r
clean:
rm -rf ${BOOK}/*.pdf ${BOOK}/*.aux ${BOOK}/*.log ${BOOK}/*.out ${BOOK}/*.toc \
${BOOK}/*.idx ${BOOK}/*.ilg ${BOOK}/*.ind ${BOOK}/*.bak ${BOOK}/*.bbl ${BOOK}/*.blg
rm -rf ${WEB}/docs ${WEB}/epub_temp ${WEB}/*.epub
rm -rf ${WEB}/docs ${WEB}/epub_temp
rm -rf *.epub
rm -rf tests.log

# View the development PDF on Linux
vl:
Expand All @@ -45,6 +47,41 @@ vm:
jl:
java -jar /opt/jabref/JabRef-2.7.2.jar 2>1 1>/dev/null &

# create the webpage version
web: web/generate.rb
ruby web/generate.rb
# create the webpage version for CleverAlgorithms.com
web: ${WEB}/generate.rb
ruby ${WEB}/generate.rb

# create epub version for iphone/ipad and friends
epub: ${WEB}/generate_epub.rb
ruby ${WEB}/generate_epub.rb

# unit test ruby source code - DRY this up a bit
test:
rm -rf tests.log
echo "testing..."
for file in src/algorithms/evolutionary/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
for file in src/algorithms/immune/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
for file in src/algorithms/neural/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
for file in src/algorithms/physical/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
for file in src/algorithms/probabilistic/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
for file in src/algorithms/stochastic/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
for file in src/algorithms/swarm/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
for file in src/programming_paradigms/tests/* ; do \
ruby $$file | tee -a tests.log ; \
done
echo "DONE"
cat tests.log | grep -E ' Error:| Failure:|No such file or directory'
1 change: 1 addition & 0 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ h3. How to Build
# @cd CleverAlgorithms@
# @make r@ (creates the file @book/book.pdf@)
# @make vl@ (to view the PDF on linux) or @make vm@ (to view the PDF on mac)
# @make epub@ (creates epub versions)

h3. Contribute

Expand Down
105 changes: 0 additions & 105 deletions src/algorithms/all_tests.sh

This file was deleted.

12 changes: 6 additions & 6 deletions web/generate_epub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Australia License.

require 'rubygems'
require 'generate'
require File.expand_path(File.dirname(__FILE__)) + '/generate'
require 'pp'
require 'cgi'
require 'digest/sha1'
Expand All @@ -24,7 +24,7 @@
exit
end

OUTPUT_DIR = "epub_temp"
OUTPUT_DIR = "web/epub_temp"

# Returns the svg for the latex expression
def render_svg(latex)
Expand Down Expand Up @@ -95,11 +95,11 @@ def epubize_file(filename)
def nav_for_topic(topic, label, folder_prefix_letter)
item = {:label => label,
:content => "#{topic}.html"}
lines = get_all_data_lines("../book/c_#{topic}.tex")
lines = get_all_data_lines("book/c_#{topic}.tex")
data = general_process_file(lines)
subpages = collect_subpages_for_page(data)
item[:nav] = subpages.map do |page|
{:label => get_algorithm_name("../book/#{folder_prefix_letter}_#{topic}/#{page}.tex"),
{:label => get_algorithm_name("book/#{folder_prefix_letter}_#{topic}/#{page}.tex"),
:content => "#{page}.html"}
end
item
Expand Down Expand Up @@ -207,7 +207,7 @@ def replace_png_links_with_inline_svg
identifier 'urn:uuid:978-1-4467-8506-5-x', :scheme => 'ISBN'
uid 'http://www.cleveralgorithms.com/'

files Dir.glob("./epub_assets/**")+ordered_html_files+Dir.glob("./#{OUTPUT_DIR}/LaTeX*.png")
files Dir.glob("./web/epub_assets/**")+ordered_html_files+Dir.glob("./#{OUTPUT_DIR}/LaTeX*.png")
nav navigation_map
end
puts "Building epub file with LaTeX in pngs"
Expand All @@ -223,7 +223,7 @@ def replace_png_links_with_inline_svg
identifier 'urn:uuid:978-1-4467-8506-5-x', :scheme => 'ISBN'
uid 'http://www.cleveralgorithms.com/'

files Dir.glob("./epub_assets/**")+ordered_html_files+Dir.glob("./#{OUTPUT_DIR}/LaTeX*.svg")
files Dir.glob("./web/epub_assets/**")+ordered_html_files+Dir.glob("./#{OUTPUT_DIR}/LaTeX*.svg")
nav navigation_map
end
puts "Building epub file with LaTeX in svgs"
Expand Down

0 comments on commit d66b01b

Please sign in to comment.