aboutsummaryrefslogtreecommitdiff
path: root/tests/scripts.scm
blob: 0315642f3848b7c735ada30f17968e1fbc63cb3f (about) (plain)
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
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2019 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.


(define-module (test-scripts)
  #:use-module (guix scripts)
  #:use-module (guix tests)
  #:use-module ((guix scripts build)
                #:select (%standard-build-options))
  #:use-module (srfi srfi-64))

;; Test the (guix scripts) module.


(test-begin "scripts")

(test-equal "parse-command-line"
  '((argument . "bar") (argument . "foo")
    (cores . 10)                                  ;takes precedence
    (substitutes? . #f) (keep-failed? . #t)
    (max-jobs . 77) (cores . 42))

  (with-environment-variable "GUIX_BUILD_OPTIONS" "-c 42 -M 77"
    (parse-command-line '("--keep-failed" "--no-substitutes"
                          "--cores=10" "foo" "bar")
                        %standard-build-options
                        (list '()))))

(test-equal "parse-command-line and --no options"
  '((argument . "foo")
    (substitutes? . #f))                          ;takes precedence

  (with-environment-variable "GUIX_BUILD_OPTIONS" "--no-substitutes"
    (parse-command-line '("foo")
                        %standard-build-options
                        (list '((substitutes? . #t))))))

(test-end "scripts")

;;; Local Variables:
;;; eval: (put 'with-environment-variable 'scheme-indent-function 2)
;;; End:
2021-12-27facilitate egistering dynamic content scripts with mappings dataWojtek Kosior 2021-12-22reworked build system; added missing license noticesWojtek Kosior 2021-12-16facilitate tracking of IndexedDB item store contentsWojtek Kosior 2021-12-15facilitate mocking imported valuesWojtek Kosior 2021-12-14facilitate broadcasting messages to different execution contexts within the ↵Wojtek Kosior webextension 2021-12-13add `is_object_empty` utility functionWojtek Kosior 2021-12-13change extension's author to something sensibleWojtek Kosior 2021-12-13facilitate creating and installing WebExtensions during testsWojtek Kosior It is now possible to more conveniently test WebExtension APIs code by wrapping it into a test WebExtension and temporarily installing in the driven browser. 2021-12-13enable in-line command editing in the Python prompt shown as part of `make ↵Wojtek Kosior test-environment` 2021-12-10improve IndexedDB useWojtek Kosior 2021-12-08facilitate initialization of IndexedDB for use by HaketiloWojtek Kosior 2021-12-04merge alicense removal to `koszko`Wojtek Kosior 2021-12-04remove alicenseWojtek Kosior 2021-12-04finish implementing more efficient querying of URL patternsWojtek Kosior The algorithm is implemented and tested. However, it is yet to be hooked into the actual extension. 2021-12-03merge `master` (license notices) and `koszko` (v1.0 development)Wojtek Kosior 2021-12-03add COPYING fileWojtek Kosior 2021-12-03start implementing more efficient querying of URL patternsWojtek Kosior 2021-12-01improve unit testing approachWojtek Kosior Unit tests were moved to their own subdirectory. Fixtures common to many unit tests were moved to test/unit/conftest.py. A facility to execute scripts in page's global scope was added. A workaround was employed to present information about errors in injected scripts. Sample unit tests for regexes in common/patterns.js were added. 2021-12-01facilitate testing javascript functionsWojtek Kosior Haketilo's .js files can now be loaded together with their dependencies and executed on a page opened in a selenium-driven Firefox instance. 2021-11-30rewrite parts of build script in awkWojtek Kosior 2021-11-27add Selenium- and Python-based test systemWojtek Kosior 2021-11-20replace cookies with synchronous XmlHttpRequest as policy smuggling method.Wojtek Kosior Note: this breaks Mozilla port of Haketilo. Synchronous XmlHttpRequest doesn't work as well there. This will be fixed with dynamically-registered content scripts later. 2021-10-30Fix license notices on JS and SH filesjahoti Other files have been left, as no model notice is available 2021-10-14merge build systemWojtek Kosior 2021-10-14Add target and install directory auto-detectionjahoti It's simplistic, yet (hopefully) good enough. 2021-10-14Add (basic) install supportjahoti The extension can be installed if DESTDIR is supplied 2021-10-14Adjust makefile targetsjahoti Rename some files used in building and remove redundant aliases 2021-10-13Add GNU's make targets, implementing distjahoti Distribution tarballs can now be made with "make dist". 2021-10-13Tidy up Makefilejahoti Add file prerequisites and some other minor changes 2021-10-13Add VPATH and Haketilo version to the makefile as part of configure.jahoti 2021-10-10Add a configuration systemjahoti 2021-10-10Correct copyright and license notices on Makefilejahoti No template code ended up being drawn from JShelter. 2021-10-10Quote $BUILDDIR throughout build.shjahoti Ensure build.sh can deal with arbitrary build directories. 2021-10-07Start on a makefilejahoti Currently includes targets for unpacked versions and zips 2021-10-06Restart modifications to build with a makefile in mindjahoti 2021-10-01Add complete firefox extension upload and download functionalityWojtek Kosior 2021-10-01add shell script facilitating generation of JWTWojtek Kosior 2021-09-15Add default repository to default settingsnickjahoti 2021-09-14bump version to 0.1Wojtek Kosior 2021-09-14use default settings that only contain a demo script (the rest is available ↵Wojtek Kosior through Hydrilla)