Hi! > diff --git a/testcases/kernel/power_management/pm_check_env.sh > b/testcases/kernel/power_management/pm_check_env.sh > new file mode 100755 > index 0000000..ebfaf08 > --- /dev/null > +++ b/testcases/kernel/power_management/pm_check_env.sh > @@ -0,0 +1,41 @@ > +# > +# Copyright (c) 2015 Fujitsu Ltd. > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 2 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License along > +# with this program; if not, write to the Free Software Foundation, Inc., > +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > +# > + > +check_env() { > + # Checking the system type > + ./pm_check_uclinux; rc=$? > + if [ $rc -eq 1 ]; then > + tst_brkm TCONF "UCLINUX not supported; not running testcases" > + fi > + > + # Checking required kernel version and architecture > + tst_kvercmp 2 6 21; rc=$? > + if [ $rc -ne 1 -a $rc -ne 2 ] ; then > + tst_brkm TCONF "Kernel version not supported; not running \ > + testcases" > + else > + case "$(uname -m)" in > + i[4-6]86|x86_64) > + ;; > + *) > + tst_brkm TCONF "Arch not supported; not running \ > + testcases" > + ;; > + esac > + fi > +} > diff --git a/testcases/kernel/power_management/pm_check_uclinux.c > b/testcases/kernel/power_management/pm_check_uclinux.c > new file mode 100644 > index 0000000..e3823b1 > --- /dev/null > +++ b/testcases/kernel/power_management/pm_check_uclinux.c > @@ -0,0 +1,29 @@ > +/* > + * Copyright (c) 2015 Fujitsu Ltd. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License along > + * with this program; if not, write to the Free Software Foundation, Inc., > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +/* Check wether the current system is uclinux. */ > +int main(int argc, char **argv) > +{ > + int chkcmp; > +#ifdef UCLINUX > + chkcmp = 1; > +#else > + chkcmp = 0; > +#endif > + return chkcmp; > +}
I do not like this. It's compile time check executed in runtime. The configure check is far better. > diff --git a/testcases/kernel/power_management/runpwtests.sh > b/testcases/kernel/power_management/runpwtests.sh > index 9055964..0a66dc4 100755 > --- a/testcases/kernel/power_management/runpwtests.sh > +++ b/testcases/kernel/power_management/runpwtests.sh > @@ -42,6 +42,7 @@ YES=0 > NO=1 > #List of reusable functions defined in pm_include.sh > . pm_include.sh > +. pm_check_env.sh Is the same check needed in more than one file? Because if it's not there is no need to move it into separate file... -- Cyril Hrubis chru...@suse.cz ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list