osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/35112?usp=email )
Change subject: gen_makefile: don't shell out to nproc
......................................................................
gen_makefile: don't shell out to nproc
Use python's multiprocessing.cpu_count() instead of "$(nproc)". The
latter didn't work properly in Makefiles, the right syntax would have
been "$(shell nproc)". Make didn't complain about it and assumed that we
want to use all CPUs with an empty argument "-j ", but meson doesn't
accept this syntax.
Change-Id: I58ca082339f3aff813f587f4c2be9c0951b9b2dd
---
M gen_makefile.py
1 file changed, 19 insertions(+), 1 deletion(-)
Approvals:
osmith: Looks good to me, approved; Verified
diff --git a/gen_makefile.py b/gen_makefile.py
index 9a8a5cf..7fc2bd2 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -49,6 +49,7 @@
import sys
import os
import argparse
+import multiprocessing
topdir = os.path.dirname(os.path.realpath(__file__))
all_deps_file = os.path.join(topdir, "all.deps")
@@ -85,7 +86,9 @@
parser.add_argument('-o', '--output', dest='output', default='Makefile',
help='''Makefile filename (default: 'Makefile').''')
-parser.add_argument('-j', '--jobs', dest='jobs', default='$(nproc)', nargs='?', const='$(nproc)',
+parser.add_argument('-j', '--jobs', dest='jobs', type=int,
+ default=multiprocessing.cpu_count(), nargs='?',
+ const=multiprocessing.cpu_count(),
help='''-j option to pass to 'make'.''')
parser.add_argument('-I', '--sudo-make-install', dest='sudo_make_install',
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/35112?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I58ca082339f3aff813f587f4c2be9c0951b9b2dd
Gerrit-Change-Number: 35112
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/35108?usp=email )
Change subject: ttcn3.sh: add arg to only run one test
......................................................................
ttcn3.sh: add arg to only run one test
Depends: docker-playground I1f45a05e089b429918096fcd64f7c02033d5a9dd
Change-Id: I07a76f6c58d379608ecadfc3ba845651929f668c
---
M ttcn3/ttcn3.sh
1 file changed, 23 insertions(+), 4 deletions(-)
Approvals:
osmith: Looks good to me, approved; Verified
diff --git a/ttcn3/ttcn3.sh b/ttcn3/ttcn3.sh
index c315eda..3426e7b 100755
--- a/ttcn3/ttcn3.sh
+++ b/ttcn3/ttcn3.sh
@@ -8,6 +8,7 @@
JOBS="$(nproc)"
KERNEL_DIR=""
KERNEL_SKIP_MARKER="$DIR_MAKE/.kernel_built_from_source"
+ARG_TEST_NAME=""
# Osmocom libraries and programs relevant for the current testsuite will be
# built in this container. It must have all build dependencies available and
@@ -38,8 +39,11 @@
}
parse_args() {
- while getopts 'hdkf' OPTION; do
+ while getopts 'ht:dkf' OPTION; do
case "$OPTION" in
+ t)
+ ARG_TEST_NAME="$OPTARG"
+ ;;
d)
if [ -n "$KERNEL_TEST" ]; then
echo "ERROR: use either -d or -k"
@@ -73,11 +77,12 @@
;;
h|*)
local name="$(basename $0)"
- echo "usage: $name [-h] [-d|-k [-f]] PROJECT"
+ echo "usage: $name [-h] [-t] [-d|-k [-f]] PROJECT"
echo " or: $name clean"
echo
echo "arguments:"
echo " -h show help"
+ echo " -t only run the test with this name"
echo
echo "arguments for kernel tests:"
echo " -d run kernel tests with debian kernel"
@@ -89,7 +94,7 @@
echo "examples:"
echo " $name bsc"
echo " $name bsc-sccplite"
- echo " $name hlr"
+ echo " $name -t TC_gsup_check_imei hlr"
echo " $name -d ggsn"
echo " $name -k ggsn"
echo " $name -k -f ggsn"
@@ -464,11 +469,15 @@
fi
cd "$(get_testsuite_dir_docker)"
- export DOCKER_ARGS="\
+ DOCKER_ARGS="\
-e LD_LIBRARY_PATH=/usr/local/lib \
-v "$DIR_USR_LOCAL":/usr/local:ro \
-v $hacks:/osmo-ttcn3-hacks:ro \
"
+ if [ -n "$ARG_TEST_NAME" ]; then
+ DOCKER_ARGS="$DOCKER_ARGS -e TEST_NAME=$ARG_TEST_NAME"
+ fi
+ export DOCKER_ARGS
export NO_LIST_OSMO_PACKAGES=1
./jenkins.sh
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/35108?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I07a76f6c58d379608ecadfc3ba845651929f668c
Gerrit-Change-Number: 35108
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged