From 516354166643980a2a0c35ff50ce985e4988987e Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Thu, 16 Aug 2018 12:26:08 +0800 Subject: [PATCH] [report] remove test-report-system-flag This flag is not required if we test (gnucash-ui-is-running) instead. --- gnucash/report/report-system/report.scm | 9 +++------ gnucash/report/report-system/test/test-report-system.scm | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/gnucash/report/report-system/report.scm b/gnucash/report/report-system/report.scm index 39ea6cad8d..017dcd3471 100644 --- a/gnucash/report/report-system/report.scm +++ b/gnucash/report/report-system/report.scm @@ -72,9 +72,6 @@ (define gnc:optname-stylesheet (N_ "Stylesheet")) (define gnc:menuname-business-reports (N_ "_Business")) (define gnc:optname-invoice-number (N_ "Invoice Number")) -(define test-report-system-flag #f) - -(export test-report-system-flag) ;; We want to warn users if they've got an old-style, non-guid custom ;; report-template, but only once @@ -142,7 +139,7 @@ ;; FIXME: We should pass the top-level window ;; instead of the '() to gnc-error-dialog, but I ;; have no idea where to get it from. - (if (not test-report-system-flag) + (if (gnucash-ui-is-running) (gnc-error-dialog '() (string-append (_ "One of your reports has a report-guid that is a duplicate. Please check the report system, especially your saved reports, for a report with this report-guid: ") report-guid)) @@ -175,14 +172,14 @@ (if (not gnc:old-style-report-warned) (begin (set! gnc:old-style-report-warned #t) - (if (not test-report-system-flag) ;; do not call this during "make test" + (if (gnucash-ui-is-running) (gnc-error-dialog '() (string-append (_ "The GnuCash report system has been upgraded. Your old saved reports have been transferred into a new format. If you experience trouble with saved reports, please contact the GnuCash development team.")))) (hash-set! *gnc:_report-templates_* (gnc:report-template-report-guid report-rec) report-rec) ) ) ) ;;there is no parent -> this is an inital faulty report definition - (if (not test-report-system-flag) ;; do not call this during "make test" + (if (gnucash-ui-is-running) (gnc-error-dialog '() (string-append (_ "Wrong report definition: ") (gnc:report-template-name report-rec) (_ " Report is missing a GUID."))) diff --git a/gnucash/report/report-system/test/test-report-system.scm b/gnucash/report/report-system/test/test-report-system.scm index 289ce6dce9..470365ae53 100644 --- a/gnucash/report/report-system/test/test-report-system.scm +++ b/gnucash/report/report-system/test/test-report-system.scm @@ -8,7 +8,6 @@ (use-modules (gnucash engine test srfi64-extras)) (define (run-test) - (set! test-report-system-flag #t) (test-runner-factory gnc:test-runner) (test-begin "Testing/Temporary/test-report-system") ;; if (test-runner-factory gnc:test-runner) is commented out, this ;; will create Testing/Temporary/test-asset-performance.log @@ -16,7 +15,6 @@ (test-assert "Missing GUID detection" (test-check2)) (test-assert "Detect double GUID" (test-check3)) (test-assert "Report with Full Argument Set" (test-check4)) - (set! test-report-system-flag #f) (test-end "Testing/Temporary/test-report-system") )