-
Notifications
You must be signed in to change notification settings - Fork 0
/
runTests.html
60 lines (55 loc) · 1.91 KB
/
runTests.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>sim tests</title>
<link rel="stylesheet" href="libs/qunit.css">
<style type="text/css">
#message {
padding: 0.5em 0 0.5em 1em;
color: #8699a4;
background-color: #0d3349;
font-family: sans-serif;
font-size: 1em;
line-height: 1em;
font-weight: normal;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
</style>
</head>
<body>
<div id="message"></div>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script type="text/javascript" src="libs/qunit.js"></script>
<script type="text/javascript" src="libs/coffee-script.js"
charset="utf-8"></script>
<script type="text/javascript" src="libs/jshamcrest.js"
charset="utf-8"></script>
<script type="text/javascript" src="libs/jsmockito.js"
charset="utf-8"></script>
<script type="text/coffeescript">
JsHamcrest.Integration.QUnit()
JsMockito.Integration.QUnit()
CoffeeScript.load "src/main.coffee"
files = ['models/alu.coffee', 'models/ram.coffee',
'util/utils.coffee', 'models/cpu.coffee', 'models/mac.coffee', 'models/rom.coffee'
]
noTestFiles = ['listeners/ram_listener.coffee', 'listeners/rom_listener.coffee',
'listeners/alu_listener.coffee', 'listeners/cpu_listener.coffee',
'listeners/mac_listener.coffee']
message = document.getElementById 'message'
message.innerHTML = "Wait for tests [#{files}] to load...<br />"
CoffeeScript.load "src/#{file}" for file in noTestFiles
for file in files
lib = "src/#{file}"
load_test = ->
test = "tests/#{file}"
-> CoffeeScript.load(test, -> message.innerHTML += "loaded #{test}<br/>")
CoffeeScript.load lib, load_test()
</script>
</body>
</html>