[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs ffc0195b9a 346/472: Merge pull request #176 from c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs ffc0195b9a 346/472: Merge pull request #176 from codingteam/refactor-it-recorder |
Date: |
Thu, 6 Jan 2022 21:59:38 -0500 (EST) |
branch: elpa/pacmacs
commit ffc0195b9ab1c62791d520b0bb0226f7137e69ea
Merge: 84598f8f20 3e25c67590
Author: Alexey Kutepov <reximkut@gmail.com>
Commit: Alexey Kutepov <reximkut@gmail.com>
Merge pull request #176 from codingteam/refactor-it-recorder
Semi-automatic ATT measuring
---
tools/README.md | 10 +++++--
tools/att.el | 17 +++++++++++
tools/{it-recorder.el => pacmacs-rr.el} | 53 +++++++++++++++++++++++++++++----
3 files changed, 72 insertions(+), 8 deletions(-)
diff --git a/tools/README.md b/tools/README.md
index a19b055937..299e60f774 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -2,11 +2,17 @@
Tools that help to develop the game
+## att.el ##
+
+Runs `./it-cases/it-case03.el` it case using `pacmacs-rr` module and
+outputs the ATT to `./att.txt` file.
+
## compile.el ##
Compiles all the source code, treats warnings as errors and exits with
non-zero exit code on any error (which `cask build` does not yet).
-## it-recorder.el ##
+## pacmacs-rr.el ##
-Tool for recording and replaying integration test cases.
+RR stands for Record and Replay. Additional module for recording and
+replaying integration test cases.
diff --git a/tools/att.el b/tools/att.el
new file mode 100644
index 0000000000..8a3902c68e
--- /dev/null
+++ b/tools/att.el
@@ -0,0 +1,17 @@
+(add-to-list 'load-path default-directory)
+(add-to-list 'load-path (concat default-directory "/tools/"))
+
+(require 'pacmacs-rr)
+(require 'f)
+
+(defconst att-result-file-path "./att.txt")
+(defvar att-it-case-path "./it-cases/it-case03.el")
+
+(defun att-replayer-finished ()
+ (f-write (format "Average Tick Time: %fms" (pacmacs--average-tick-time))
+ 'utf-8
+ att--result-file-path)
+ (kill-emacs 0))
+
+(add-hook 'pacmacs-replay-finished-hook #'performance-replayer-finished)
+(pacmacs--start-it-replayer att-it-case-path)
diff --git a/tools/it-recorder.el b/tools/pacmacs-rr.el
similarity index 56%
rename from tools/it-recorder.el
rename to tools/pacmacs-rr.el
index fa5a73bf9e..b673e112e4 100644
--- a/tools/it-recorder.el
+++ b/tools/pacmacs-rr.el
@@ -1,3 +1,38 @@
+;;; pacmacs-rr.el --- Pacman for Emacs -*- lexical-binding: t -*-
+
+;; Copyright (C) 2015 Codingteam
+
+;; Author: Codingteam <codingteam@conference.jabber.ru>
+;; Maintainer: Alexey Kutepov <reximkut@gmail.com>
+;; URL: http://github.com/rexim/pacmacs.el
+
+;; Permission is hereby granted, free of charge, to any person
+;; obtaining a copy of this software and associated documentation
+;; files (the "Software"), to deal in the Software without
+;; restriction, including without limitation the rights to use, copy,
+;; modify, merge, publish, distribute, sublicense, and/or sell copies
+;; of the Software, and to permit persons to whom the Software is
+;; furnished to do so, subject to the following conditions:
+
+;; The above copyright notice and this permission notice shall be
+;; included in all copies or substantial portions of the Software.
+
+;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+;; SOFTWARE.
+
+;;; Commentary:
+
+;; Additional module for recording and replaying integration test
+;; cases.
+
+;;; Code:
+
(require 'pacmacs)
(require 'dash)
@@ -7,6 +42,7 @@
(defvar pacmacs--tick-counter 0)
(defvar pacmacs--recorded-actions nil)
(defvar pacmacs--tick-times nil)
+(defvar pacmacs-replay-finished-hook nil)
(defun pacmacs--record-action (action-name)
(add-to-list 'pacmacs--recorded-actions
@@ -62,12 +98,13 @@
(pacmacs--measure-time
(pacmacs-tick)))
- (if (not pacmacs--recorded-actions)
- (pacmacs-quit)
- (-let ((((action . tick-number) . _) pacmacs--recorded-actions))
- (when (= tick-number pacmacs--tick-counter)
- (funcall action)
- (setq pacmacs--recorded-actions (cdr pacmacs--recorded-actions))))))
+ (if pacmacs--recorded-actions
+ (-let ((((action . tick-number) . _) pacmacs--recorded-actions))
+ (when (= tick-number pacmacs--tick-counter)
+ (funcall action)
+ (setq pacmacs--recorded-actions (cdr pacmacs--recorded-actions))))
+ (pacmacs-quit)
+ (run-hooks 'pacmacs-replay-finished-hook)))
(define-derived-mode pacmacs-it-recorder-mode pacmacs-mode
"pacmacs-it-recorder-mode"
(define-key pacmacs-it-recorder-mode-map (kbd "<up>") 'pacmacs-record-up)
@@ -92,3 +129,7 @@
(setq pacmacs--recorded-actions (pacmacs--load-test-case filename))
(setq pacmacs--tick-counter 0)
(setq pacmacs--tick-times nil))
+
+(provide 'pacmacs-rr)
+
+;;; pacmacs-rr.el ends here
- [nongnu] elpa/pacmacs 22355a4954 276/472: Add Terrified Ghost animation. Close #83, (continued)
- [nongnu] elpa/pacmacs 22355a4954 276/472: Add Terrified Ghost animation. Close #83, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 97973dd305 288/472: Rough implementaion of escaping for TGs (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 3758d601d3 304/472: Fix blinking terrified ghost animation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 27c7ba7bbb 314/472: Update README about minimal version of Emacs (#165), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d6b63ef5b9 317/472: Merge pull request #166 from codingteam/drop-emacs-24.3-165, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 3344de1bbe 322/472: Adapt render-track-board for new track board, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 481eb8bd37 326/472: Merge pull request #169 from codingteam/distances-instead-of-directions-159, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 31d7305439 331/472: Add 2nd big pill level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 862f9b7f9e 332/472: Add 3d big pill level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 375d85e49b 344/472: Add pacmacs-replay-finished-hook, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ffc0195b9a 346/472: Merge pull request #176 from codingteam/refactor-it-recorder,
ELPA Syncer <=
- [nongnu] elpa/pacmacs ebeba826ce 356/472: Merge pull request #180 from codingteam/headers-urls-178, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ab77f7a391 360/472: Terrify already terrified ghosts first (#173), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2425a26d88 364/472: Use push instead of add-to-list (#182), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a90b8d6352 372/472: Clear wall cache on game start (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 6bb1f0d0a7 375/472: Rename wall-blocks to wall-tiles (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 20d89a67cf 384/472: Enable debug on error for ATT script (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a97d195e12 391/472: Merge pull request #188 from codingteam/qfix/move-measure-time-to-rr, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 75e26090e5 393/472: Add UT for clear-wall-tiles-cache, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1b658fe6aa 405/472: Calc new score position (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 508d15dff5 415/472: Fix compilation errors (#134), ELPA Syncer, 2022/01/06