Skip to content

Commit

Permalink
Fixed the test suite to also work when doing "make test". I also adde…
Browse files Browse the repository at this point in the history
…d common/Math to the build process in build.js, because without it the compiled version was breaking on the tests that required Math.js.
  • Loading branch information
JSilver999 committed Sep 29, 2011
1 parent 6b217b1 commit 12dd997
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -18,8 +18,9 @@ GLADIUS_DIST := $(DIST_DIR)/$(GLADIUS).js
GLADIUS_MIN := $(DIST_DIR)/$(GLADIUS).min.js
TOOLS_DIR := ./tools
DIST_TEST_DIR := $(DIST_DIR)/test
DIST_TOOLS_DIR := $(DIST_DIR)/tools

CORE_FILES := $(SRC_DIR)/gladius.js $(wildcard $(SRC_DIR)/core/*.js) $(wildcard $(SRC_DIR)/core/component/*.js)
CORE_FILES := $(SRC_DIR)/gladius.js $(wildcard $(SRC_DIR)/common/*.js) $(wildcard $(SRC_DIR)/core/*.js) $(wildcard $(SRC_DIR)/core/component/*.js)

SUBSYSTEM_FILES := \

Expand Down Expand Up @@ -47,7 +48,9 @@ $(GLADIUS_MIN): $(DIST_DIR) $(GLADIUS_SRC)
test: $(DIST_DIR) $(GLADIUS_MIN)
@@echo "Creating tests in $(DIST_TEST_DIR)"
@@mv $(GLADIUS_MIN) $(GLADIUS_DIST)
@@cp -R $(TEST_DIR) $(DIST_TEST_DIR)
@@cp -R $(TEST_DIR) $(DIST_DIR)
@@mkdir -p $(DIST_TOOLS_DIR)/qunit
@@cp -R $(TOOLS_DIR)/qunit/qunit $(DIST_TOOLS_DIR)/qunit
@@echo "Starting web server in $(DIST_TEST_DIR), browse to http://localhost:9914/ (ctrl+c to stop)..."
@@cd $(DIST_DIR) && python ../$(TOOLS_DIR)/test_server.py

Expand Down
9 changes: 5 additions & 4 deletions test/index.html
Expand Up @@ -2,12 +2,13 @@
<html>
<head>
<title>Gladius Test Suite</title>
<link rel="stylesheet" href="../tools/qunit/qunit/qunit.css" type="text/css" media="screen">
<script src="../tools/qunit/qunit/qunit.js"></script>
<link rel="stylesheet" href="../tools/qunit/qunit/qunit.css" type="text/css" media="screen">
<!-- To test the dist file, uncomment the line below and comment out
the src/gladius.js script. -->
<!-- script src="../dist/gladius.js"></script -->
<script src="../src/gladius.js"></script>
<!-- script src="../dist/gladius.js"></script -->
<script src="../tools/qunit/qunit/qunit.js"></script>
<script src="../src/gladius.js"></script>
<script src="../gladius.js"></script>
<script src="core/engine.js"></script>
<script src="common/Math.js"></script>
<script src="common/Math.Vector2.js"></script>
Expand Down
1 change: 1 addition & 0 deletions tools/build.js
Expand Up @@ -38,6 +38,7 @@
// not be found by the AST analysis done in the optimizer.
include: [
'gladius',
'common/Math',
'gladius-src',
],

Expand Down

0 comments on commit 12dd997

Please sign in to comment.