diff --git a/repos/base-foc/run/cap_integrity.run b/repos/base-foc/run/cap_integrity.run index b5eb9271f8..065aa33c53 100644 --- a/repos/base-foc/run/cap_integrity.run +++ b/repos/base-foc/run/cap_integrity.run @@ -1,4 +1,4 @@ -build "core init test/cap_integrity" +build { core init lib/ld test/cap_integrity } create_boot_directory @@ -20,7 +20,7 @@ install_config { } -build_boot_image "core ld.lib.so init test-cap_integrity" +build_boot_image [build_artifacts] append qemu_args "-nographic " diff --git a/repos/base-hw/run/cpu_scheduler.run b/repos/base-hw/run/cpu_scheduler.run index d6f80737e7..3e36cf4b03 100644 --- a/repos/base-hw/run/cpu_scheduler.run +++ b/repos/base-hw/run/cpu_scheduler.run @@ -1,16 +1,7 @@ -# -# \brief Test CPU-scheduler implementation of core -# \author Martin Stein -# \date 2014-09-30 -# +build { core init lib/ld test/cpu_scheduler } -# build program images -build "core init test/cpu_scheduler" - -# create directory where the boot files are written to create_boot_directory -# the init config is not used but the build system needs it install_config { @@ -28,15 +19,12 @@ install_config { } -# create single boot image from the compiled program images -build_boot_image "core ld.lib.so init test-cpu_scheduler" +build_boot_image [build_artifacts] -# configure qemu to use 64 MB RAM and avoid GUI mode -append qemu_args " -nographic" +append qemu_args " -nographic" -# execute the test in qemu if the targeted platform is supported run_genode_until "child .test-cpu_scheduler. exited with exit value .*\n" 10 -# check the output grep_output {child .test-cpu_scheduler. exited with exit value} + compare_output_to { [init] child "test-cpu_scheduler" exited with exit value 0 } diff --git a/repos/base-hw/run/double_list.run b/repos/base-hw/run/double_list.run index e4a699b04e..56dc6176f3 100644 --- a/repos/base-hw/run/double_list.run +++ b/repos/base-hw/run/double_list.run @@ -1,16 +1,7 @@ -# -# \brief Test double-list implementation of core -# \author Martin Stein -# \date 2014-09-30 -# +build { core init lib/ld test/double_list } -# build program images -build "core init test/double_list" - -# create directory where the boot files are written to create_boot_directory -# the init config is not used but the build system needs it install_config { @@ -29,16 +20,12 @@ install_config { } -# create single boot image from the compiled program images -build_boot_image "core ld.lib.so init test-double_list" +build_boot_image [build_artifacts] -# configure qemu to use 64 MB RAM and avoid GUI mode append qemu_args " -nographic" -# execute the test in qemu if the targeted platform is supported run_genode_until "done.*\n" 10 -# check the output grep_output {\[init -> test-double_list\]} compare_output_to { [init -> test-double_list] print each diff --git a/repos/base-linux/run/lx_fs.run b/repos/base-linux/run/lx_fs.run index 91d0094e88..80cf14ad21 100644 --- a/repos/base-linux/run/lx_fs.run +++ b/repos/base-linux/run/lx_fs.run @@ -11,7 +11,7 @@ assert_spec linux # Build # -build { core init server/lx_fs test/libc_vfs } +build { core init lib/ld lib/libc lib/vfs server/lx_fs test/libc_vfs } create_boot_directory @@ -61,10 +61,7 @@ exec mkdir -p bin/libc_vfs # Boot modules # -build_boot_image { - core init ld.lib.so libc.lib.so vfs.lib.so lx_fs test-libc_vfs - libc_vfs -} +build_boot_image [list {*}[build_artifacts] libc_vfs] # # Execute test case diff --git a/repos/base-linux/run/lx_fs_notify.run b/repos/base-linux/run/lx_fs_notify.run index 1944d26856..ef77682b97 100644 --- a/repos/base-linux/run/lx_fs_notify.run +++ b/repos/base-linux/run/lx_fs_notify.run @@ -283,7 +283,7 @@ exec mkdir -p bin/lx_fs_notify/mnt # # Boot modules # -build_boot_image { lx_fs test-rom_log test-file_writer lx_fs_notify } +build_boot_image [list {*}[build_artifacts] lx_fs_notify] # # build the test program for Linux diff --git a/repos/base-linux/run/lx_hybrid_ctors.run b/repos/base-linux/run/lx_hybrid_ctors.run index 53465130b3..d968a0ab8e 100644 --- a/repos/base-linux/run/lx_hybrid_ctors.run +++ b/repos/base-linux/run/lx_hybrid_ctors.run @@ -5,21 +5,10 @@ # \date 2011-11-24 # -# -# Build -# - -build { - core init - test/lx_hybrid_ctors -} +build { core init lib/ld test/lx_hybrid_ctors } create_boot_directory -# -# Generate config -# - install_config { @@ -38,28 +27,10 @@ install_config { } -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - test-lx_hybrid_ctors -} - -build_boot_image $boot_modules - -# -# Execute test case -# +build_boot_image [build_artifacts] run_genode_until {child "test-lx_hybrid_ctors" exited with exit value 0.*\n} 10 -# -# Compare output -# - grep_output {\[init -\> test-lx_hybrid_ctors\]} compare_output_to { diff --git a/repos/base-linux/run/lx_hybrid_errno.run b/repos/base-linux/run/lx_hybrid_errno.run index d68f917f53..aaa7747169 100644 --- a/repos/base-linux/run/lx_hybrid_errno.run +++ b/repos/base-linux/run/lx_hybrid_errno.run @@ -1,21 +1,7 @@ -# -# \brief Test thread-local errno works for hybrid Linux/Genode programs -# \author Norman Feske -# \date 2011-12-05 -# - -# -# Build -# - -build { core init test/lx_hybrid_errno } +build { core init lib/ld test/lx_hybrid_errno } create_boot_directory -# -# Generate config -# - install_config { @@ -27,24 +13,13 @@ install_config { - + } -# -# Boot modules -# - -# generic modules -set boot_modules { core ld.lib.so init test-lx_hybrid_errno } - -build_boot_image $boot_modules - -# -# Execute test case -# +build_boot_image [build_artifacts] run_genode_until "--- finished thread-local errno test ---.*\n" 10 diff --git a/repos/base-linux/run/lx_hybrid_exception.run b/repos/base-linux/run/lx_hybrid_exception.run index 18bc0d228f..55f780f1e6 100644 --- a/repos/base-linux/run/lx_hybrid_exception.run +++ b/repos/base-linux/run/lx_hybrid_exception.run @@ -1,24 +1,7 @@ -# -# \brief Test if the exception mechanism works in hybrid applications -# \author Christian Prochaska -# \date 2011-11-22 -# - -# -# Build -# - -build { - core init - test/lx_hybrid_exception -} +build { core init lib/ld test/lx_hybrid_exception } create_boot_directory -# -# Generate config -# - install_config { @@ -37,21 +20,7 @@ install_config { } -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - test-lx_hybrid_exception -} - -build_boot_image $boot_modules - -# -# Execute test case -# +build_boot_image [build_artifacts] run_genode_until {child "test-lx_hybrid_exception" exited with exit value 0.*\n} 10 diff --git a/repos/base-linux/run/lx_hybrid_pthread_ipc.run b/repos/base-linux/run/lx_hybrid_pthread_ipc.run index 1468b210ab..881cc92629 100644 --- a/repos/base-linux/run/lx_hybrid_pthread_ipc.run +++ b/repos/base-linux/run/lx_hybrid_pthread_ipc.run @@ -1,21 +1,7 @@ -# -# \brief Test IPC from pthread created outside of Genode -# \author Norman Feske -# \date 2011-12-20 -# - -# -# Build -# - -build { core init test/lx_hybrid_pthread_ipc } +build { core init lib/ld test/lx_hybrid_pthread_ipc } create_boot_directory -# -# Generate config -# - install_config { @@ -34,17 +20,6 @@ install_config { } -# -# Boot modules -# - -# generic modules -set boot_modules { core ld.lib.so init test-lx_hybrid_pthread_ipc } - -build_boot_image $boot_modules - -# -# Execute test case -# +build_boot_image [build_artifacts] run_genode_until "--- finished pthread IPC test ---.*\n" 10 diff --git a/repos/base-linux/run/lx_rmap.inc b/repos/base-linux/run/lx_rmap.inc index 19525a0822..e0fdc6010e 100644 --- a/repos/base-linux/run/lx_rmap.inc +++ b/repos/base-linux/run/lx_rmap.inc @@ -6,24 +6,11 @@ assert_spec linux -# -# Build -# - -set build_components { core init } - -lappend_if [expr {$test_type eq "static"}] build_components test/lx_rmap/static -lappend_if [expr {$test_type eq "dynamic"}] build_components test/lx_rmap/dynamic - -build $build_components +build [list core init lib/ld [test_build_target]] create_boot_directory -# -# Config -# - -set config { +install_config { @@ -34,40 +21,17 @@ set config { - } - -append_if [expr {$test_type eq "static"}] config { - } -append_if [expr {$test_type eq "dynamic"}] config { - } -append config { + + } -install_config $config -# -# Boot modules -# +build_boot_image [build_artifacts] -set boot_modules { core ld.lib.so init } +run_genode_until "child \"[test_program_name]\" exited with exit value 0.*\n" 10 -lappend_if [expr {$test_type eq "static"}] boot_modules test-lx_rmap_static -lappend_if [expr {$test_type eq "dynamic"}] boot_modules test-lx_rmap_dynamic -lappend_if [expr {$test_type eq "dynamic"}] boot_modules ld.lib.so - -build_boot_image $boot_modules - -# -# Execute test -# - -if {$test_type eq "static"} { - run_genode_until {child "test-lx_rmap_static" exited with exit value 0.*\n} 10 -} else { - run_genode_until {child "test-lx_rmap_dynamic" exited with exit value 0.*\n} 10 -} puts "Test succeeded" # vi: set ft=tcl : diff --git a/repos/base-linux/run/lx_rmap_dynamic.run b/repos/base-linux/run/lx_rmap_dynamic.run index 2d08bd5fa1..0589d4963f 100644 --- a/repos/base-linux/run/lx_rmap_dynamic.run +++ b/repos/base-linux/run/lx_rmap_dynamic.run @@ -1,10 +1,5 @@ -# -# \brief Test for Linux-specific region map (dynamic binary) -# \author Christian Helmuth -# \date 2013-09-06 -# - -set test_type "dynamic" +proc test_build_target { } { return "test/lx_rmap/static" } +proc test_program_name { } { return "test-lx_rmap_static" } source ${genode_dir}/repos/base-linux/run/lx_rmap.inc diff --git a/repos/base-linux/run/lx_rmap_static.run b/repos/base-linux/run/lx_rmap_static.run index 4143055577..2b9ebc1315 100644 --- a/repos/base-linux/run/lx_rmap_static.run +++ b/repos/base-linux/run/lx_rmap_static.run @@ -1,10 +1,5 @@ -# -# \brief Test for Linux-specific region map (static binary) -# \author Christian Helmuth -# \date 2013-09-06 -# - -set test_type "static" +proc test_build_target { } { return "test/lx_rmap/dynamic" } +proc test_program_name { } { return "test-lx_rmap_dynamic" } source ${genode_dir}/repos/base-linux/run/lx_rmap.inc diff --git a/repos/base-linux/run/lx_uid.run b/repos/base-linux/run/lx_uid.run deleted file mode 100644 index 9e86448ea0..0000000000 --- a/repos/base-linux/run/lx_uid.run +++ /dev/null @@ -1,98 +0,0 @@ -# -# \brief Test for assigning custom UIDs and GIDs to Genode processes -# \author Norman Feske -# \date 2012-11-21 -# - -build "core init test/printf" - -assert_spec linux - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -# -# Copy boot modules into run directory -# -# We cannot use the predefined 'build_boot_image' function here because -# this would create mere symlinks. However, we need to enable the setuid -# and setgid capabilities for core, which won't work if core were a symlink. -# -foreach binary { core ld.lib.so init } { - exec cp -H bin/$binary [run_dir] } - -# -# Allow core to set arbitrary UIDs and GIDs -# -exec sudo setcap cap_setuid,cap_setgid=ep [run_dir]/core - -# -# Execute Genode until the point where init_sub_77 is up -# -run_genode_until {\[init -> init_77 -> init_sub_77\].*No children to start.*\n} 10 - -# -# Obtain the list of Genode user processes starting with the name 'init' -# -set ps_output [exec ps -eo uid,gid,cmd | grep Genode | grep init] - -puts "Genode user processes:\n$ps_output" - -# -# Validate output of ps -# -# We are only interested in the lines for the init instances with the -# customized UIDs and GIDs. -# -if {![regexp {55\s*66 \[Genode\] init_55_66} $ps_output] - || ![regexp {77\s*77 \[Genode\] init_77} $ps_output] - || ![regexp {77\s*77 \[Genode\] init_77 -> init_sub_77} $ps_output]} { - puts stderr "Unexpected output of ps" - exit 1 -} - -puts "Test succeeded" - diff --git a/repos/base-linux/run/region_map_mmap.run b/repos/base-linux/run/region_map_mmap.run index 4f822ee850..b9ae7782dd 100644 --- a/repos/base-linux/run/region_map_mmap.run +++ b/repos/base-linux/run/region_map_mmap.run @@ -1,4 +1,4 @@ -build "core init test/region_map_mmap timer test/signal" +build { core init lib/ld test/region_map_mmap timer test/signal } create_boot_directory @@ -6,9 +6,6 @@ install_config { - - - @@ -27,12 +24,17 @@ install_config { - + } -build_boot_image "core ld.lib.so init test-region_map_mmap timer test-signal" +build_boot_image [build_artifacts] -run_genode_until forever +run_genode_until {--- Signalling test finished ---.*\n} 30 +grep_output {\[init -\> test-region_map_mmap\] Done.} + +compare_output_to { +[init -> test-region_map_mmap] Done. +} diff --git a/repos/base-nova/run/platform.run b/repos/base-nova/run/platform.run index 0adfbcd627..b4293981f8 100644 --- a/repos/base-nova/run/platform.run +++ b/repos/base-nova/run/platform.run @@ -1,4 +1,4 @@ -build "core init test/platform" +build { core init lib/ld test/platform } set check_pat 1 if {[have_include power_on/qemu]} { @@ -37,7 +37,7 @@ append config { install_config $config -build_boot_image "core ld.lib.so init test-platform" +build_boot_image [build_artifacts] append qemu_args "-nographic -smp 2" diff --git a/repos/base-okl4/run/priority.run b/repos/base-okl4/run/priority.run index 7728bcee62..308c62829f 100644 --- a/repos/base-okl4/run/priority.run +++ b/repos/base-okl4/run/priority.run @@ -1,12 +1,12 @@ assert_spec okl4 -build "core init" +build { core init lib/ld } create_boot_directory install_config "[exec cat [genode_dir]/repos/os/src/init/config.priority]" -build_boot_image "core ld.lib.so init" +build_boot_image [build_artifacts] append qemu_args "-nographic " diff --git a/repos/base/run/log.run b/repos/base/run/log.run index 5cabc9f120..340c8fea9a 100644 --- a/repos/base/run/log.run +++ b/repos/base/run/log.run @@ -1,4 +1,4 @@ -build "core init test/log" +build { core init lib/ld test/log } create_boot_directory @@ -20,7 +20,7 @@ install_config { } -build_boot_image "core ld.lib.so init test-log" +build_boot_image [build_artifacts] append qemu_args "-nographic " append xen_args { sdl="0" } diff --git a/repos/base/run/migrate.run b/repos/base/run/migrate.run index 12534ac927..878320d58d 100644 --- a/repos/base/run/migrate.run +++ b/repos/base/run/migrate.run @@ -1,4 +1,4 @@ -build "core init test/migrate timer" +build { core init lib/ld test/migrate timer } if {![have_include "power_on/qemu"]} { puts "Run script is not supported on this platform" @@ -45,7 +45,7 @@ append config { install_config $config -build_boot_image "core ld.lib.so init test-migrate timer" +build_boot_image [build_artifacts] append qemu_args "-nographic " append qemu_args "-smp 4,cores=4,threads=1" diff --git a/repos/base/run/smp.run b/repos/base/run/smp.run index 30a93051b6..686095bcc1 100644 --- a/repos/base/run/smp.run +++ b/repos/base/run/smp.run @@ -10,7 +10,7 @@ if { [get_cmd_switch --autopilot] && [have_include "power_on/qemu"] } { exit 0 } -build "core init test/smp" +build { core init lib/ld test/smp } create_boot_directory @@ -32,7 +32,7 @@ install_config { } -build_boot_image "core ld.lib.so init test-smp" +build_boot_image [build_artifacts] if {[have_include "power_on/qemu"]} { # in general we want to have at least 2 CPUs diff --git a/repos/base/run/sub_rm.run b/repos/base/run/sub_rm.run index 4f6dd9528f..97abc6828c 100644 --- a/repos/base/run/sub_rm.run +++ b/repos/base/run/sub_rm.run @@ -1,4 +1,4 @@ -build "core init test/sub_rm" +build { core init lib/ld test/sub_rm } create_boot_directory @@ -30,7 +30,7 @@ append config { install_config $config -build_boot_image "core ld.lib.so init test-sub_rm" +build_boot_image [build_artifacts] append qemu_args "-nographic " diff --git a/repos/base/run/thread.run b/repos/base/run/thread.run index 7c5f9ec78f..bfd5bd603f 100644 --- a/repos/base/run/thread.run +++ b/repos/base/run/thread.run @@ -1,4 +1,4 @@ -build "core init test/thread" +build { core init lib/ld test/thread } create_boot_directory @@ -45,7 +45,7 @@ append config { install_config $config -build_boot_image "core ld.lib.so init test-thread" +build_boot_image [build_artifacts] append qemu_args "-nographic " diff --git a/repos/base/run/timeout_smp.run b/repos/base/run/timeout_smp.run index 826e8aca74..da6e556426 100644 --- a/repos/base/run/timeout_smp.run +++ b/repos/base/run/timeout_smp.run @@ -1,4 +1,4 @@ -build { core init timer test/timeout_smp } +build { core init timer lib/ld test/timeout_smp } create_boot_directory @@ -30,11 +30,14 @@ install_config { } -build_boot_image { core ld.lib.so init timer test-timeout_smp } + +build_boot_image [build_artifacts] append qemu_args " -nographic" run_genode_until "child \"test\" exited with exit value.*\n" 60 + grep_output {\[init\] child "test" exited with exit value} + compare_output_to {[init] child "test" exited with exit value 0} diff --git a/repos/base/run/timer_accuracy.run b/repos/base/run/timer_accuracy.run index 14e8c38fe3..d88c20662c 100644 --- a/repos/base/run/timer_accuracy.run +++ b/repos/base/run/timer_accuracy.run @@ -1,10 +1,7 @@ -# build program images -build { core init timer test/timer_accuracy } +build { core init timer lib/ld test/timer_accuracy } -# create directory where boot files are written to create_boot_directory -# define XML configuration for init install_config { @@ -31,10 +28,9 @@ install_config { } -# build boot files from source binaries -build_boot_image { core ld.lib.so init timer test-timer_accuracy } -# configure Qemu +build_boot_image [build_artifacts] + append qemu_args " -nographic" set err_cnt 0 diff --git a/repos/base/run/timer_rate.run b/repos/base/run/timer_rate.run index e18fbf3bd1..6be666c3a8 100644 --- a/repos/base/run/timer_rate.run +++ b/repos/base/run/timer_rate.run @@ -1,4 +1,4 @@ -build { core init timer test/timer_rate } +build { core init timer lib/ld test/timer_rate } create_boot_directory @@ -33,11 +33,14 @@ install_config { } -build_boot_image { core ld.lib.so init timer test-timer_rate } + +build_boot_image [build_artifacts] append qemu_args " -nographic" run_genode_until "child \"test\" exited with exit value.*\n" 120 + grep_output {\[init\] child "test" exited with exit value} + compare_output_to {[init] child "test" exited with exit value 0} diff --git a/repos/os/src/test/lx_fs_notify/file_writer/Makefile b/repos/os/src/test/lx_fs_notify/file_writer/Makefile index 5917d135d8..65532b64f5 100644 --- a/repos/os/src/test/lx_fs_notify/file_writer/Makefile +++ b/repos/os/src/test/lx_fs_notify/file_writer/Makefile @@ -1,11 +1,11 @@ - -SRC_C = main.cc +SRC_C = main.cc C_WARNINGS = -Wall -Werror -BUILD_DIR = /tmp/bin +BUILD_DIR = /tmp/bin +SHELL = bash all: mkdir -p $(BUILD_DIR) g++ $(C_WARNINGS) $(SRC_C) -o $(BUILD_DIR)/file_writer clean: - rm -Rf bin \ No newline at end of file + rm -Rf bin