lua-test.sh (574a8bf981301e233e953c3119165bea36118006) lua-test.sh (f98c671d073627099f6ac3bd2e79747c5b72caef)
1#!/bin/sh
2# $FreeBSD$
3
4# Will image the test directory (default /tmp/loadertest) if it doesn't exist
5
6die() {
7 echo $*
8 exit 1
9}
10
11dir=$1
12scriptdir=$(dirname $(realpath $0))
13cd $(make -V SRCTOP)/stand
14obj=$(make -V .OBJDIR)
15t=$obj/userboot/test/test
1#!/bin/sh
2# $FreeBSD$
3
4# Will image the test directory (default /tmp/loadertest) if it doesn't exist
5
6die() {
7 echo $*
8 exit 1
9}
10
11dir=$1
12scriptdir=$(dirname $(realpath $0))
13cd $(make -V SRCTOP)/stand
14obj=$(make -V .OBJDIR)
15t=$obj/userboot/test/test
16u=$obj/userboot/userboot/userboot.so
17
18[ -n "$dir" ] || dir=/tmp/loadertest
19[ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir}
16
17[ -n "$dir" ] || dir=/tmp/loadertest
18[ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir}
19# We'll try userboot.so from the test directory before plucking it straight out
20# of .OBJDIR.
21u=$dir/boot/userboot.so
22[ -f "$u" ] || u=$obj/userboot/userboot_lua/userboot_lua.so
20[ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found"
21[ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load"
22[ -x "$t" ] || die "no userboot test jig found ($t)"
23[ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found"
24[ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load"
25[ -x "$t" ] || die "no userboot test jig found ($t)"
23[ -x "$u" ] || die "no userboot.so ($u) found"
26[ -f "$u" ] || die "no userboot.so ($u) found"
24
25$t -h $dir -b $u
27
28$t -h $dir -b $u