Import LinuxCNC source tree
This commit is contained in:
0
tests/halcompile/command_line_flags/expected
Normal file
0
tests/halcompile/command_line_flags/expected
Normal file
21
tests/halcompile/command_line_flags/flags.c
Normal file
21
tests/halcompile/command_line_flags/flags.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
flags.c
|
||||
To test command line compiler flags to halcompile
|
||||
|
||||
Copyright (C) 2023 Andy Pugh
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ULAPI
|
||||
#error This is intended as a userspace component only.
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <readline.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char* res;
|
||||
rl_initialize();
|
||||
return 0;
|
||||
}
|
||||
33
tests/halcompile/command_line_flags/test.sh
Executable file
33
tests/halcompile/command_line_flags/test.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
if [ -e flags ]
|
||||
then
|
||||
rm flags
|
||||
fi
|
||||
halcompile --userspace --compile flags.c > /dev/null
|
||||
if [ -e flags ]
|
||||
then
|
||||
echo "No flags, compile succeeded but should fail"
|
||||
exit 1
|
||||
fi
|
||||
halcompile --userspace --compile --extra-compile-args="-I/usr/include/readline" flags.c > /dev/null
|
||||
if [ -e flags ]
|
||||
then
|
||||
echo "Linker flags only, compile succeeded but should fail"
|
||||
exit 1
|
||||
fi
|
||||
halcompile --userspace --compile --extra-link-args="-lm -lreadline" flags.c > /dev/null
|
||||
if [ -e flags ]
|
||||
then
|
||||
echo "Compiler flags only, compile succeeded but should fail"
|
||||
exit 1
|
||||
fi
|
||||
halcompile --userspace --compile --extra-compile-args="-I/usr/include/readline" --extra-link-args="-lm -lreadline" flags.c > /dev/null
|
||||
if [ -e flags ]
|
||||
then
|
||||
rm flags
|
||||
exit 0
|
||||
else
|
||||
echo "Compile failed but should succeed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user