Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1n7pjS-0003Yw-6n for mharc-grub-devel@gnu.org; Wed, 12 Jan 2022 21:20:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7pjO-0003Wa-EG for grub-devel@gnu.org; Wed, 12 Jan 2022 21:20:50 -0500 Received: from [2607:f8b0:4864:20::72c] (port=37852 helo=mail-qk1-x72c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7pih-0004Xf-AM for grub-devel@gnu.org; Wed, 12 Jan 2022 21:20:10 -0500 Received: by mail-qk1-x72c.google.com with SMTP id t66so5622188qkb.4 for ; Wed, 12 Jan 2022 18:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cUtqipIznpTbIGCrkSwB39b/SxmoAiKAYk81myIp4tM=; b=DYebJfxjKfG5LMNA0W1gZyxgqYoDkLJEyupWSZE/dsqdOyWvvihQluvexlUdmPxor5 yIO+t5O+D1HdT4iNBM+vlSLQ4yd9bqBqQ4iRtv8D4J+V/znxN+RKglAbKXMEH9kNNbG4 J94Bpa8bSZNqi6WWlGBkKPHAexISic1ECZThhnTtAeE0KMXnBVSMlRfscdG2QQucOvGh eQT8tfJMVFoh5/AA8a5+KIWE7gFVY+LCS84JmnpY3Xx6tcSQbr0U9PW9JayCZB3mVdvl oy3thvviGc7v+nQD4LPsx1oESg7KbPOoCROFqD5v/trqyyVUulWzA8OB/m+GPy2Nvkvf jE7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cUtqipIznpTbIGCrkSwB39b/SxmoAiKAYk81myIp4tM=; b=CupMw5yf4gFcl+9T1TmwmyMTJtzESSxHHRjVDvPVrjdhIckUpuDrJ+JMtAJizvJuBz 4jLXQCRbt88851eCJuzuspA4Qmn06zWIDbFODyOcbDSPBeljuwON0/2p2W1zdOoci1rZ M8QoglKXmUtevF8dJvBCiEwczYIE1coK7ELOg7Ex8mi/eKZo9WQBwpp2mj0/e4va29YW m+E7hcP0Ojoyon9J9Ty+bFnHOJ7oTdGn+VZnXZbh4Wyde5+Ya5M+9xpjTcA1q0JUqp4A jOoqQew9hZ2TPKRLos6kS4YESgbj5ubb9JskxI6dxvT/HvJ6LdGN8h1qP7RszUjPiHA+ vg+Q== X-Gm-Message-State: AOAM533R+Cp7GKf/u9C6f+W/oInchzBG8YsDIFqmbONmFNfYZI3iPuFO TuShJmyOIebS+fweU9tB8q+8IAroOUQdZQ== X-Google-Smtp-Source: ABdhPJwxXKheFy2lfnhlNdTsR1mN5AOgfrtc/luFuHAinj6FLf4cSLobAFptWmOM1wcTAeWAzVgYuQ== X-Received: by 2002:a05:620a:2806:: with SMTP id f6mr1893788qkp.687.1642040393340; Wed, 12 Jan 2022 18:19:53 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id o10sm182294qki.61.2022.01.12.18.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:19:53 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , Vladimir Serbinenko , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH 2/2] tests: Add check-native and check-nonnative make targets Date: Wed, 12 Jan 2022 20:19:04 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::72c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=development@efficientek.com; helo=mail-qk1-x72c.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2022 02:20:51 -0000 This allows for testing only tests that run directly on the build machine or only tests that run in a virtualized environment. When testing multiple targets on the same build machine the native tests only need to be run once for all targets. Whereas, the nonnative tests must be run for each target because the test is potentially compiled differently for each target. Signed-off-by: Glenn Washburn --- Makefile.am | 9 +++ Makefile.util.def | 164 +++++++++++++++++++++---------------------- conf/Makefile.common | 4 ++ gentpl.py | 6 +- 4 files changed, 97 insertions(+), 86 deletions(-) diff --git a/Makefile.am b/Makefile.am index bf9c1ba64..10faf670b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,6 +24,15 @@ CCASFLAGS_PROGRAM += $(CCASFLAGS_GNULIB) include $(srcdir)/Makefile.util.am +check_SCRIPTS = $(check_SCRIPTS_native) $(check_SCRIPTS_nonnative) +check_PROGRAMS = $(check_PROGRAMS_native) $(check_PROGRAMS_nonnative) +TESTS = $(check_SCRIPTS) $(check_PROGRAMS) + +check-native: + $(MAKE) TESTS="$(check_PROGRAMS_native) $(check_SCRIPTS_native)" check +check-nonnative: + $(MAKE) TESTS="$(check_PROGRAMS_nonnative) $(check_SCRIPTS_nonnative)" check + # XXX Use Automake's LEX & YACC support grub_script.tab.h: $(top_srcdir)/grub-core/script/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(top_srcdir)/grub-core/script/parser.y diff --git a/Makefile.util.def b/Makefile.util.def index f8b356cc1..b098d5bba 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -749,470 +749,470 @@ script = { }; script = { - testcase; + testcase = native; name = ext234_test; common = tests/ext234_test.in; }; script = { - testcase; + testcase = native; name = squashfs_test; common = tests/squashfs_test.in; }; script = { - testcase; + testcase = native; name = iso9660_test; common = tests/iso9660_test.in; }; script = { - testcase; + testcase = native; name = hfsplus_test; common = tests/hfsplus_test.in; }; script = { - testcase; + testcase = native; name = ntfs_test; common = tests/ntfs_test.in; }; script = { - testcase; + testcase = native; name = reiserfs_test; common = tests/reiserfs_test.in; }; script = { - testcase; + testcase = native; name = fat_test; common = tests/fat_test.in; }; script = { - testcase; + testcase = native; name = minixfs_test; common = tests/minixfs_test.in; }; script = { - testcase; + testcase = native; name = xfs_test; common = tests/xfs_test.in; }; script = { - testcase; + testcase = native; name = f2fs_test; common = tests/f2fs_test.in; }; script = { - testcase; + testcase = native; name = nilfs2_test; common = tests/nilfs2_test.in; }; script = { - testcase; + testcase = native; name = romfs_test; common = tests/romfs_test.in; }; script = { - testcase; + testcase = native; name = exfat_test; common = tests/exfat_test.in; }; script = { - testcase; + testcase = native; name = tar_test; common = tests/tar_test.in; }; script = { - testcase; + testcase = native; name = udf_test; common = tests/udf_test.in; }; script = { - testcase; + testcase = native; name = hfs_test; common = tests/hfs_test.in; }; script = { - testcase; + testcase = native; name = jfs_test; common = tests/jfs_test.in; }; script = { - testcase; + testcase = native; name = btrfs_test; common = tests/btrfs_test.in; }; script = { - testcase; + testcase = native; name = zfs_test; common = tests/zfs_test.in; }; script = { - testcase; + testcase = native; name = cpio_test; common = tests/cpio_test.in; }; script = { - testcase; + testcase = native; name = example_scripted_test; common = tests/example_scripted_test.in; }; script = { - testcase; + testcase = native; name = gettext_strings_test; common = tests/gettext_strings_test.in; extra_dist = po/exclude.pot; }; script = { - testcase; + testcase = nonnative; name = pata_test; common = tests/pata_test.in; }; script = { - testcase; + testcase = nonnative; name = ahci_test; common = tests/ahci_test.in; }; script = { - testcase; + testcase = nonnative; name = uhci_test; common = tests/uhci_test.in; }; script = { - testcase; + testcase = nonnative; name = ohci_test; common = tests/ohci_test.in; }; script = { - testcase; + testcase = nonnative; name = ehci_test; common = tests/ehci_test.in; }; script = { - testcase; + testcase = nonnative; name = example_grub_script_test; common = tests/example_grub_script_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_eval; common = tests/grub_script_eval.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_test; common = tests/grub_script_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_echo1; common = tests/grub_script_echo1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_leading_whitespace; common = tests/grub_script_leading_whitespace.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_echo_keywords; common = tests/grub_script_echo_keywords.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_vars1; common = tests/grub_script_vars1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_for1; common = tests/grub_script_for1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_while1; common = tests/grub_script_while1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_if; common = tests/grub_script_if.in; }; script = { - testcase; + testcase = native; name = grub_script_blanklines; common = tests/grub_script_blanklines.in; }; script = { - testcase; + testcase = native; name = grub_script_final_semicolon; common = tests/grub_script_final_semicolon.in; }; script = { - testcase; + testcase = native; name = grub_script_dollar; common = tests/grub_script_dollar.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_comments; common = tests/grub_script_comments.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_functions; common = tests/grub_script_functions.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_break; common = tests/grub_script_break.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_continue; common = tests/grub_script_continue.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_shift; common = tests/grub_script_shift.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_blockarg; common = tests/grub_script_blockarg.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_setparams; common = tests/grub_script_setparams.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_return; common = tests/grub_script_return.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_regexp; common = tests/grub_cmd_regexp.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_date; common = tests/grub_cmd_date.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_set_date; common = tests/grub_cmd_set_date.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_sleep; common = tests/grub_cmd_sleep.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_expansion; common = tests/grub_script_expansion.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_not; common = tests/grub_script_not.in; }; script = { - testcase; + testcase = native; name = grub_script_no_commands; common = tests/grub_script_no_commands.in; }; script = { - testcase; + testcase = nonnative; name = partmap_test; common = tests/partmap_test.in; }; script = { - testcase; + testcase = nonnative; name = hddboot_test; common = tests/hddboot_test.in; }; script = { - testcase; + testcase = nonnative; name = fddboot_test; common = tests/fddboot_test.in; }; script = { - testcase; + testcase = nonnative; name = cdboot_test; common = tests/cdboot_test.in; }; script = { - testcase; + testcase = nonnative; name = netboot_test; common = tests/netboot_test.in; }; script = { - testcase; + testcase = nonnative; name = pseries_test; common = tests/pseries_test.in; }; script = { - testcase; + testcase = nonnative; name = core_compress_test; common = tests/core_compress_test.in; }; script = { - testcase; + testcase = nonnative; name = xzcompress_test; common = tests/xzcompress_test.in; }; script = { - testcase; + testcase = nonnative; name = gzcompress_test; common = tests/gzcompress_test.in; }; script = { - testcase; + testcase = nonnative; name = lzocompress_test; common = tests/lzocompress_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_echo; common = tests/grub_cmd_echo.in; }; script = { - testcase; + testcase = nonnative; name = help_test; common = tests/help_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_gettext; common = tests/grub_script_gettext.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_escape_comma; common = tests/grub_script_escape_comma.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_strcmp; common = tests/grub_script_strcmp.in; }; script = { - testcase; + testcase = nonnative; name = test_sha512sum; common = tests/test_sha512sum.in; }; script = { - testcase; + testcase = nonnative; name = test_unset; common = tests/test_unset.in; }; script = { - testcase; + testcase = nonnative; name = grub_func_test; common = tests/grub_func_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_tr; common = tests/grub_cmd_tr.in; }; script = { - testcase; + testcase = nonnative; name = file_filter_test; common = tests/file_filter_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_test; common = tests/grub_cmd_test.in; }; script = { - testcase; + testcase = native; name = syslinux_test; common = tests/syslinux_test.in; }; program = { - testcase; + testcase = native; name = example_unit_test; common = tests/example_unit_test.c; common = tests/lib/unit_test.c; @@ -1227,7 +1227,7 @@ program = { }; program = { - testcase; + testcase = native; name = printf_test; common = tests/printf_unit_test.c; common = tests/lib/unit_test.c; @@ -1242,7 +1242,7 @@ program = { }; program = { - testcase; + testcase = native; name = date_test; common = tests/date_unit_test.c; common = tests/lib/unit_test.c; @@ -1257,7 +1257,7 @@ program = { }; program = { - testcase; + testcase = native; name = priority_queue_unit_test; common = tests/priority_queue_unit_test.cc; common = tests/lib/unit_test.c; @@ -1274,7 +1274,7 @@ program = { }; program = { - testcase; + testcase = native; name = cmp_test; common = tests/cmp_unit_test.c; common = tests/lib/unit_test.c; diff --git a/conf/Makefile.common b/conf/Makefile.common index f0bb6e160..02107898d 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -105,7 +105,11 @@ KERNEL_HEADER_FILES = bin_SCRIPTS = bin_PROGRAMS = check_SCRIPTS = +check_SCRIPTS_native = +check_SCRIPTS_nonnative = check_PROGRAMS = +check_PROGRAMS_native = +check_PROGRAMS_nonnative = dist_grubconf_DATA = dist_noinst_DATA = grubconf_SCRIPTS = diff --git a/gentpl.py b/gentpl.py index c86550d4f..28ec24209 100644 --- a/gentpl.py +++ b/gentpl.py @@ -817,8 +817,7 @@ def program(defn, platform, test=False): set_canonical_name_suffix("") if 'testcase' in defn: - gvar_add("check_PROGRAMS", name) - gvar_add("TESTS", name) + gvar_add("check_PROGRAMS_" + defn['testcase'], name) else: var_add(installdir(defn) + "_PROGRAMS", name) if 'mansection' in defn: @@ -859,8 +858,7 @@ def script(defn, platform): name = defn['name'] if 'testcase' in defn: - gvar_add("check_SCRIPTS", name) - gvar_add ("TESTS", name) + gvar_add("check_SCRIPTS_" + defn['testcase'], name) else: var_add(installdir(defn) + "_SCRIPTS", name) if 'mansection' in defn: -- 2.27.0