From afec10c5bfb6a7931928e68fe242992b7d09db45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 27 Jul 2011 22:00:31 +0100 Subject: [PATCH] Move prepro.js to lib/and include() statements for test units to their own files inside tests/ --- build/load.sh | 4 ++-- {src/load => lib}/prepro.js | 0 src/{load => }/load.js | 5 +++-- src/paper.js | 35 ----------------------------------- test/index.html | 10 +++++++--- test/lib/load.js | 3 +++ test/tests/load.js | 28 ++++++++++++++++++++++++++++ 7 files changed, 43 insertions(+), 42 deletions(-) rename {src/load => lib}/prepro.js (100%) rename src/{load => }/load.js (82%) create mode 100644 test/lib/load.js create mode 100644 test/tests/load.js diff --git a/build/load.sh b/build/load.sh index a347a0c1..8ed8a3cc 100755 --- a/build/load.sh +++ b/build/load.sh @@ -18,5 +18,5 @@ # development of the library itself. echo "// Paper.js loader for development, as produced by the build/load.sh script -document.write(''); -document.write('');" > ../dist/paper.js; \ No newline at end of file +document.write(''); +document.write('');" > ../dist/paper.js; \ No newline at end of file diff --git a/src/load/prepro.js b/lib/prepro.js similarity index 100% rename from src/load/prepro.js rename to lib/prepro.js diff --git a/src/load/load.js b/src/load.js similarity index 82% rename from src/load/load.js rename to src/load.js index 33631d9f..dd6e230a 100644 --- a/src/load/load.js +++ b/src/load.js @@ -22,8 +22,9 @@ var options = { browser: true, stats: true, - tests: this.tests, version: 'dev' }; -include('../paper.js'); +// This folder is specified relatively to the lib folder from which prepro.js is +// loaded, and which is referenced as the root. +include('../src/paper.js'); diff --git a/src/paper.js b/src/paper.js index 3cdcfcca..1d8ae5ac 100644 --- a/src/paper.js +++ b/src/paper.js @@ -219,38 +219,3 @@ var paper = new function() { return new (PaperScope.inject(this)); /*#*/ } // options.version != 'dev' }; - -/*#*/ // Load unit tests after library if we're asked to do so -/*#*/ if (options.tests) { -/*#*/ include('../test/lib/qunit/qunit.js'); -/*#*/ include('../test/lib/helpers.js'); - -/*#*/ include('../test/tests/Point.js'); -/*#*/ include('../test/tests/Size.js'); -/*#*/ include('../test/tests/Rectangle.js'); - -/*#*/ include('../test/tests/Color.js'); - -/*#*/ include('../test/tests/Project.js'); - -/*#*/ include('../test/tests/Item.js'); -/*#*/ include('../test/tests/Item_Cloning.js'); -/*#*/ include('../test/tests/Item_Order.js'); - -/*#*/ include('../test/tests/Layer.js'); -/*#*/ include('../test/tests/Group.js'); -/*#*/ include('../test/tests/Segment.js'); - -/*#*/ include('../test/tests/Path.js'); -/*#*/ include('../test/tests/PathStyle.js'); -/*#*/ include('../test/tests/Path_Shapes.js'); -/*#*/ include('../test/tests/Path_Drawing_Commands.js'); -/*#*/ include('../test/tests/Path_Curves.js'); -/*#*/ include('../test/tests/Path_Bounds.js'); -/*#*/ include('../test/tests/Path_Length.js'); -/*#*/ include('../test/tests/CompoundPath.js'); - -/*#*/ include('../test/tests/PlacedSymbol.js'); - -/*#*/ include('../test/tests/HitResult.js'); -/*#*/ } // options.tests diff --git a/test/index.html b/test/index.html index 05b9a621..c5279539 100644 --- a/test/index.html +++ b/test/index.html @@ -3,9 +3,13 @@ Paper.js Tests - - - + + +

QUnit Test Suite

diff --git a/test/lib/load.js b/test/lib/load.js new file mode 100644 index 00000000..949a6526 --- /dev/null +++ b/test/lib/load.js @@ -0,0 +1,3 @@ +/*#*/ include('qunit/qunit.js'); +/*#*/ include('helpers.js'); +/*#*/ include('../tests/load.js'); diff --git a/test/tests/load.js b/test/tests/load.js new file mode 100644 index 00000000..9b38d690 --- /dev/null +++ b/test/tests/load.js @@ -0,0 +1,28 @@ +/*#*/ include('Point.js'); +/*#*/ include('Size.js'); +/*#*/ include('Rectangle.js'); + +/*#*/ include('Color.js'); + +/*#*/ include('Project.js'); + +/*#*/ include('Item.js'); +/*#*/ include('Item_Cloning.js'); +/*#*/ include('Item_Order.js'); + +/*#*/ include('Layer.js'); +/*#*/ include('Group.js'); +/*#*/ include('Segment.js'); + +/*#*/ include('Path.js'); +/*#*/ include('PathStyle.js'); +/*#*/ include('Path_Shapes.js'); +/*#*/ include('Path_Drawing_Commands.js'); +/*#*/ include('Path_Curves.js'); +/*#*/ include('Path_Bounds.js'); +/*#*/ include('Path_Length.js'); +/*#*/ include('CompoundPath.js'); + +/*#*/ include('PlacedSymbol.js'); + +/*#*/ include('HitResult.js');