Move prepro.js to lib/and include() statements for test units to their own files inside tests/

This commit is contained in:
Jürg Lehni 2011-07-27 22:00:31 +01:00
parent a750564d24
commit afec10c5bf
7 changed files with 43 additions and 42 deletions

View file

@ -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('<script type=\"text/javascript\" src=\"../../src/load/prepro.js\"></script>');
document.write('<script type=\"text/javascript\" src=\"../../src/load/load.js\"></script>');" > ../dist/paper.js;
document.write('<script type=\"text/javascript\" src=\"../../lib/prepro.js\"></script>');
document.write('<script type=\"text/javascript\" src=\"../../src/load.js\"></script>');" > ../dist/paper.js;

View file

@ -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');

View file

@ -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

View file

@ -3,9 +3,13 @@
<head>
<title>Paper.js Tests</title>
<link rel="stylesheet" href="lib/qunit/qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="../src/load/prepro.js"></script>
<script type="text/javascript">var tests = true;</script>
<script type="text/javascript" src="../src/load/load.js"></script>
<script type="text/javascript" src="../lib/prepro.js"></script>
<script type="text/javascript" src="../src/load.js"></script>
<script type="text/javascript">
// Load the tests relatively to the lib folder from which prepro.js is
// loaded, and which is referenced as the root.
include('../test/lib/load.js');
</script>
</head>
<body>
<h1 id="qunit-header">QUnit Test Suite</h1>

3
test/lib/load.js Normal file
View file

@ -0,0 +1,3 @@
/*#*/ include('qunit/qunit.js');
/*#*/ include('helpers.js');
/*#*/ include('../tests/load.js');

28
test/tests/load.js Normal file
View file

@ -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');