Skip to content

Commit

Permalink
Added simple passing test case and new build targets:
Browse files Browse the repository at this point in the history
./build.sh test
./build.sh testrun
  • Loading branch information
PhilHarnish committed Feb 9, 2009
1 parent 8404428 commit ae33018
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
32 changes: 28 additions & 4 deletions src/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
mtasc -swf ../web/latest.swf\
#!/bin/sh

case "$1" in
test*)
CP="-cp ../lib/asunit/as25/ -cp ../test/"
OUT="../test/RunTests.swf"
MAIN="AllTests.as"
;;
*)
CP=""
OUT="../web/latest.swf"
MAIN="Main.as"
;;
esac

mtasc -swf $OUT\
-version 8\
-cp ~/bin/std8/\
$CP\
-cp .\
-header 640:480:20\
-trace yubi.util.Firebug.out\
yubi/util/Firebug.as\
-strict -infer -wimp\
-main\
Main.as
-main $MAIN

if [ $? != 0 ]; then
echo "Build failed."
exit -1
fi

if [ "$1" = "testrun" ] && [ -n "$(which open)" ]; then
open ../test/RunTests.swf
fi
20 changes: 20 additions & 0 deletions test/AllTests.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Entry point for test suite
*/

import asunit.framework.TestSuite;
import asunit.textui.TestRunner;

class AllTests extends TestSuite {
private var className:String = "AllTests";

public function AllTests() {
super();
addTest(new PassingTest());
}

public static function main():Void {
var runner:TestRunner = new TestRunner();
runner.start(AllTests);
}
}
9 changes: 9 additions & 0 deletions test/PassingTest.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import asunit.framework.TestCase;

class PassingTest extends TestCase {
private var className:String = "PassingTest";

public function test():Void {
assertTrue("passing test", true);
}
}

0 comments on commit ae33018

Please sign in to comment.