efi/udp.c: Save UDP Port in core_udp_open()
[syslinux/sherbszt.git] / tests / recipes.mk
blobf01c1add3b084014b02b77efc94ac6e5ebf3cd4a
2 # Copyright (C) 2013 Intel Corporation; author Matt Fleming
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, Inc., 53 Temple Place Ste 330,
7 # Boston MA 02111-1307, USA; either version 2 of the License, or
8 # (at your option) any later version; incorporated herein by reference.
10 # Canned recipes
13 # copy-files - copy a config to the mounted filesystem
15 # Copies $(cfg) to the default Syslinux config location.
16 # Usually this wants pairing with a use of $(remove-config).
18 # To use, your config filename must be the same as your target
20 define copy-files =
21 for f in $($@_files); do \
22 sudo cp $$f $(INSTALL_DIR) ;\
23 done
24 sync
25 endef
28 # install-config
30 define install-config =
31 sudo sh -c 'echo INCLUDE $($@_cfg) >> $(CONFIG_FILE)'
32 sync
33 endef
36 # remove-files - deletes files from the mounted filesystem
38 # Deletes $(mytest_files)
40 define remove-files =
41 for f in $($@_files); do \
42 sudo rm $(INSTALL_DIR)/$$f ;\
43 done
44 endef
47 # delete-config - remove a test's config file from the master config
49 define delete-config =
50 sudo sed -i -e '/INCLUDE $($@_cfg)/d' $(CONFIG_FILE)
51 endef
54 # run-test - begin executing the tests
56 define run-test =
57 $(copy-files)
58 $(install-config)
60 sudo $(QEMU) $(QEMU_FLAGS) -serial file:$@.log
62 $(delete-config)
63 $(remove-files)
65 sudo sort $@.log -o $@.log
66 if [ `comm -1 -3 $@.log $($@_results) | wc -l` -ne 0 ]; then \
67 printf " [!] $@ failed\n" ;\
68 else \
69 printf " [+] $@ passed\n" ;\
71 endef