diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-08-17 17:47:47 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-29 14:03:52 +0100 |
commit | 14d44456ad5b9f280772a712d8a5312a5dee8d55 (patch) | |
tree | d5381d7c7b760c46d04f0dc48d6a3b0b2d04f1d8 /bitbake/lib | |
parent | ab9644f7aca3de443d8da323b7937c4c10d266a1 (diff) | |
download | poky-14d44456ad5b9f280772a712d8a5312a5dee8d55.tar.gz |
bitbake: toastergui: Add frontend javascript unit tests
Use Jquery's Qunit tests to create some unit tests for javascript
components used in toaster.
(Bitbake rev: 1c2f6b9b7b9e700146944b9d6d2114e0d014ee81)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/toaster/toastergui/urls.py | 3 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index f74090b9ba..46e5761443 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py | |||
@@ -145,6 +145,9 @@ urlpatterns = patterns('toastergui.views', | |||
145 | url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'), | 145 | url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'), |
146 | url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'), | 146 | url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'), |
147 | 147 | ||
148 | # JS Unit tests | ||
149 | url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'), | ||
150 | |||
148 | # default redirection | 151 | # default redirection |
149 | url(r'^$', RedirectView.as_view( url= 'landing')), | 152 | url(r'^$', RedirectView.as_view( url= 'landing')), |
150 | ) | 153 | ) |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index c8ff693ae6..c583d9613a 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -31,6 +31,7 @@ from django.shortcuts import render, redirect | |||
31 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable | 31 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable |
32 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency | 32 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency |
33 | from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact | 33 | from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact |
34 | from orm.models import BitbakeVersion | ||
34 | from bldcontrol import bbcontroller | 35 | from bldcontrol import bbcontroller |
35 | from django.views.decorators.cache import cache_control | 36 | from django.views.decorators.cache import cache_control |
36 | from django.core.urlresolvers import reverse, resolve | 37 | from django.core.urlresolvers import reverse, resolve |
@@ -2260,6 +2261,21 @@ if True: | |||
2260 | 2261 | ||
2261 | return context | 2262 | return context |
2262 | 2263 | ||
2264 | def jsunittests(request): | ||
2265 | """ Provides a page for the js unit tests """ | ||
2266 | bbv = BitbakeVersion.objects.filter(branch="master").first() | ||
2267 | release = Release.objects.filter(bitbake_version=bbv).first() | ||
2268 | |||
2269 | name = "_js_unit_test_prj_" | ||
2270 | |||
2271 | # If there is an existing project by this name delete it. We don't want | ||
2272 | # Lots of duplicates cluttering up the projects. | ||
2273 | Project.objects.filter(name=name).delete() | ||
2274 | |||
2275 | new_project = Project.objects.create_project(name=name, release=release) | ||
2276 | |||
2277 | context = { 'project' : new_project } | ||
2278 | return render(request, "js-unit-tests.html", context) | ||
2263 | 2279 | ||
2264 | from django.views.decorators.csrf import csrf_exempt | 2280 | from django.views.decorators.csrf import csrf_exempt |
2265 | @csrf_exempt | 2281 | @csrf_exempt |